| profMat-xcmsSet | R Documentation |
The profile matrix is an n x m matrix, n (rows) representing equally spaced m/z values (bins) and m (columns) the retention time of the corresponding scans. Each cell contains the maximum intensity measured for the specific scan and m/z values falling within the m/z bin.
The profMat method creates a new profile matrix or returns the
profile matrix within the object's @env slot, if available.
Settings for the profile matrix generation, such as step (the bin
size), method or additional settings are extracted from the
respective slots of the xcmsRaw object.
Alternatively it is possible to specify all of the settings as
additional parameters.
## S4 method for signature 'xcmsRaw'
profMat(object, method, step, baselevel, basespace,
mzrange.)
object |
The |
method |
The profile matrix generation method. Allowed are |
step |
numeric(1) representing the m/z bin size. |
baselevel |
numeric(1) representing the base value to which
empty elements (i.e. m/z bins without a measured intensity) should be
set. Only considered if |
basespace |
numeric(1) representing the m/z length after
which the signal will drop to the base level. Linear interpolation will
be used between consecutive data points falling within
|
mzrange. |
Optional numeric(2) manually specifying the mz value range to be used for binnind. If not provided, the whole mz value range is used. |
Profile matrix generation methods:
The default profile matrix generation method that does a simple binning, i.e. aggregating of intensity values falling within an m/z bin.
Binning followed by linear interpolation to impute missing values. The value for m/z bins without a measured intensity are inferred by a linear interpolation between neighboring bins with a measured intensity.
Binning followed by a linear interpolation to impute
values for empty elements (m/z bins) within a user-definable proximity to
non-empty elements while stetting the element's value to the
baselevel otherwise. See impute = "linbase" parameter of
imputeLinInterpol for more details.
Set the elements' values to the integral of the linearly interpolated data from plus to minus half the step size.
profMat returns the profile matrix (rows representing scans,
columns equally spaced m/z values).
From xcms version 1.51.1 on only the profMat method
should be used to extract the profile matrix instead of the previously
default way to access it directly via object@env$profile.
Johannes Rainer
xcmsRaw, binYonX and
imputeLinInterpol for the employed binning and
missing value imputation methods, respectively.
profMat,XCMSnExp-method for the method on
XCMSnExp objects.
file <- system.file('cdf/KO/ko15.CDF', package = "faahKO")
## Load the data without generating the profile matrix (profstep = 0)
xraw <- xcmsRaw(file, profstep = 0)
## Extract the profile matrix
profmat <- profMat(xraw, step = 0.3)
dim(profmat)
## If not otherwise specified, the settings from the xraw object are used:
profinfo(xraw)
## To extract a profile matrix with linear interpolation use
profmat <- profMat(xraw, step = 0.3, method = "binlin")
## Alternatively, the profMethod of the xraw objects could be changed
profMethod(xraw) <- "binlin"
profmat_2 <- profMat(xraw, step = 0.3)
all.equal(profmat, profmat_2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.