R: Conversion between peak lists from hyphenated MS (LCMS, GCMS,...
mzchannel2pktab
R Documentation
Conversion between peak lists from hyphenated MS (LCMS, GCMS, ...) data
and input for stptw.
Description
Function pktab2mzchannel allows to split a list of peaks
into several sublists, for instance on the basis of m/z values. The
result can be aligned with stptw. The peak list can be obtained
from packages like XCMS. The reverse function,
mzchannel2pktab, simply gathers all peak positions in one matrix.
a peak table as generated for example by XCMS. Necessary
information: m/z value (column name "mz"), retention time (column
name "rt") and intensity.
Ivalue
the name of the intensity value to be used. Default is
"maxo", one of the columns generated by the XCMS package.
masses
a vector of specific masses
nMasses
an optional number limiting the number of mass
channels. When both masses and nMasses are defined,
the former takes preference
massDigits
number of significant mass digits - if no
masses are supplied this number determines the number of
distinct categories in the output
mzchannels
a list of peak matrices, e.g. the output of
pktab2mzchannel
Value
Function pktab2mzchannel returns a list of peak matrices; list
elements have the name of the mz value that they represent. Function
mzchannel2pktab returns one peak matrix where all masses are in a
specific column.
Author(s)
Ron Wehrens
Examples
data(lcms)
## first couple of peaks in the first three channels
(smallset <- lapply(lcms.pks[[1]][1:3], head))
## all in one data matrix
allpeaks <- mzchannel2pktab(smallset)
## and back again
pktab2mzchannel(allpeaks, Ivalue = "I")