| findMultiplePeaks {MetaNetwork} | R Documentation |
Predict metabolites that may be represented by multiple mass peaks based on correlation and m/z value. If two mass peaks are highly correlated (r>0.95) and their mass difference is 1 or 2 (as isotopes) or mass ratio is 2, 3, or 1/2, 1/3 (as different charged), they are predicted as multiple peaks of a same metabolite.
findMultiplePeaks <- function( corrZeroOrder, peaks, corrThres=0.95,
filename=NULL) )
corrZeroOrder |
a zero order peak correlation matrix that has been calculated before. See corrZeroOrder example data. |
peaks |
matrix of mass/charge peaks (column1) for each trait (rownames).
See peaks2 example peaks data for unidentified example traits data traits2. |
corrThres |
(optional) numeric threshold for significant correlated peaks that should be tested for multiple peaks relationships. Default is 0.95. |
filename |
(optional) path of the csv file where the multiple peak summary is to be stored. Default NULL. |
Returns a data frame with Multiple Peaks summary containing the following headers:
cluster |
cluster id of related multiple peaks. |
peak1 |
mass over charge peak. |
mz1 |
mass over charge ratio of peak1. |
peak2 |
mass over charge peak that is related to peak1. |
mz2 |
mass over charge ratio of peak2. |
corrCoef |
correlation coefficient between peak1 and peak2. |
massDiff |
peak difference: mz1 - mz2. |
massRatio |
peak ratio: mz1/mz2. |
relationship |
putative isotope or diffCharged relationship. |
See multiplePeaks example data set.
The names of traits should be consistent over corrZeroOrder and peaks.
Jingyuan Fu <j.fu@rug.nl>, Morris Swertz <m.a.swertz@rug.nl>, Ritsert Jansen <r.c.jansen@rug.nl>
Fu J, Swertz MA, Keurentjes JJB, Jansen RC. MetaNetwork: a computational tool for the genetic study of metabolism. Nature Protocols (2007).
http://gbic.biol.rug.nl/supplementary/2007/MetaNetwork
Use traits2 and peaks2 as example unidintified peak
data set or use loadData to load your own data.
Use qtlCorrZeroOrder to calculate corrZeroOrder zero order correlation.
## load the example data provided with this package
data(traits2)
data(peaks2)
data(genotypes)
data(markers)
##OR: load your own data
#traits2 <- loadData("traits2.csv")
#peaks2 <- loadData("peaks2.csv")
#genotypes <- loadData("genotypes.csv")
#markers <- loadData("markers.csv")
##calculate the two part qtl
qtlProfiles <- qtlMapTwoPart(genotypes=genotypes, traits=traits2, spike=4)
##set the qtl threshold
qtlThres <- 3.79
##OR: estimate the threshold yourself
#qtlThres <- qtlThreshold(genotypes, traits, spike=4)
##calculate zero order correlation
corrZeroOrder <- qtlCorrZeroOrder(markers, qtlProfiles, qtlThres)
##find multiple peaks
multiplePeaks <- findMultiplePeaks(corrZeroOrder, peaks2)
##show summary
multiplePeaks