msPrepare {msProcess} | R Documentation |
Converts an msList
object to an msSet
object by
truncating the spectra to the mass range of interest,
interpolating the spectra to a common set of m/z
values, and
transforming the intensity values if specified.
msPrepare(x, mass.min=1500, transform=NULL, data.name = NULL)
x |
An object of class msList . |
mass.min |
A numeric value denoting the lowest mass (in Dalton) of interest. The portion of the spectra below this value will be removed. The low mass region is generally considered suspicious as matrix contamination may be a problem. Default: 1500. |
transform |
A function to be used to transform the intensity values.
The main purpose of the transformation is to reduce the variance of the
intensity values and to stabilize the noise component of the spectra.
Some possible choices are logarithm (log ), square root (sqrt )
and cube root. The default is not to perform any tranformation.
Default: NULL (no transform). |
data.name |
name for the data. Default: deparseText(substitute(x)) . |
An object of class msSet
that has the same number of spectra
as in the input msList
object x
.
if (!exists("qclist")) data("qclist", package="msProcess") ## extract several spectra from the build-in ## dataset qclist zList <- qclist[1:8] ## convert the subset to an msSet object cbrt <- function(x) x^(1/3) zSet <- msPrepare(zList, mass.min=950, transform=cbrt) ## visualize a portion of the spectra plot(zSet, subset=NULL, xlim=c(13000, 17000), offset=0.5)