Description Usage Arguments Value Author(s) Examples
Identify masses using kernel density of centroided data.
1 |
xraw |
an xcms raw object |
rtrange |
range of retention times of scans |
ppm |
mass deviation between scans for obtaining EIC for each mass |
minSignal |
lowest signal intensity that could be considered a mass |
ms1_mat |
matrix where the rows are scans (ordered by retention time) and columns are masses |
Igor Nikolskiy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (xraw, rtrange = NULL, ppm = 25, minSignal = 400)
{
if (is.null(rtrange)) {
scans = 1:length(xraw@scantime)
}
else {
scans = which(xraw@scantime >= rtrange[1] & xraw@scantime <=
rtrange[2])
}
combinedScans = do.call(rbind, sapply(scans, getScan, object = xraw))
cons_masses = getConsensusMasses(combinedScans, ppm = ppm)
ms1_mat = c()
for (s in scans) {
scan = getScan(xraw, s)
intensities = sapply(cons_masses, function(m) {
matches = ppm_diff(m, scan[, "mz"]) < ppm
if (any(matches))
return(max(scan[matches, "intensity"]))
else return(0)
})
ms1_mat = rbind(ms1_mat, intensities)
}
colnames(ms1_mat) = cons_masses
rownames(ms1_mat) = round(xraw@scantime[scans], 2)
ms1_mat
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.