Description Usage Arguments Details Value See Also Examples
Calculate correlations of pairs of mass peaks from MSI data (imported to
R with the msimat
function). The list of pairs is supplied
as a data.frame with the parameter pairs
.
1 2 3 |
d |
msimat; MSI data with peaks as columns and pixels as rows,
output from |
diff |
massdiff; List of mass differences, parent and putative adduct
ions, as produced by function |
p.val |
numeric; p-value cutoff (before Bonferroni correction) (default: 0.05) |
method |
string; Method to use for |
alternative |
string; Which alternative for |
how |
string; How to implement the multiple correlation tests. Options:
"loop" (for loop - slow), "parallel" (multiple processors, using
|
ncores |
integer; Number of cores if using |
... |
Other parameters to pass to |
Example usage scenario for this function: Mass differences for all pairwise
combinations of masses are tabulated with massdiff
, and the
peak pairs corresponding to a specific adduct of interest are extracted with
diffGetPeaks
. Check which peaks are significantly correlated to
each other with this function.
Correlation is calculated with cor.test
function and by default
uses the Pearson method (two-sided, because correlations can be both positive
and negative). The Bonferroni correction is applied to the p-values before
assessing significance, but the original p-value is reported in column
"P.value" and can be used e.g. for false discovery rate analysis.
Object of class data.frame with the following fields:
A - First peak mass in each pair
B - Second peak mass in the pair
Estimate - Estimated correlation
P.value - P-value for the correlation (uncorrected)
Significance - Whether p-value meets cutoff (specified by "p.val", with Bonferroni correction)
corrPairsMSIchunks
to split input data into manageable
sizes to avoid going over available memory. Suggested if using the
standard corrPairsMSI function causes R to run out of memory and
crash.
1 2 3 4 5 | d <- msimat(csv=system.file("extdata","msi.csv",package="mass2adduct"),sep=";")
d.diff <- massdiff(d) # Calculate mass differences from imported MSI data
d.diff.annot <- adductMatch(d.diff,add=adducts2) # Find mass diffs matching adducts
# Perform correlation tests on annotated peak pairs
d.diff.annot.cor <- corrPairsMSI(d,d.diff.annot,how="apply")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.