profMat,MsExperiment-method | 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. For [MsExperiment()] or [XcmsExperiment()] objects, the method returns a `list` of profile matrices, one for each sample in `object`. Using parameter `fileIndex` it is also possible to create a profile matrix only for selected samples (files).
## S4 method for signature 'MsExperiment'
profMat(
object,
method = "bin",
step = 0.1,
baselevel = NULL,
basespace = NULL,
mzrange. = NULL,
fileIndex = seq_along(object),
chunkSize = 1L,
msLevel = 1L,
BPPARAM = bpparam(),
...
)
## S4 method for signature 'xcmsRaw'
profMat(object, method, step, baselevel, basespace, mzrange.)
object |
An |
method |
|
step |
|
baselevel |
|
basespace |
|
mzrange. |
Optional |
fileIndex |
For |
chunkSize |
For |
msLevel |
For |
BPPARAM |
For |
... |
ignored. |
Profile matrix generation methods:
"bin"
: The default profile matrix generation method that does a
simple binning, i.e. aggregating of intensity values falling within an
m/z bin.
"binlin"
: 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.
"binlinbase"
: 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.
"intlin"
: 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). For object
being a MsExperiment
or XcmsExperiment
, the method returns a list
of profile matrices,
one for each file (sample).
Johannes Rainer
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.