View source: R/rtmsMeasurement.R
measureSampleSet | R Documentation |
measureSampleSet()
extracts one or more measurements for every peak in
every sample in an RTMS sample set object (of class rtmsSampleSet
).
measureSampleSet(sampleset, measure = "PeakIntensity")
sampleset |
An object of class |
measure |
A character vector of named measurements, or a list of
custom measurement functions. Supported measurement names are
"PeakIntensity", which takes the total of any local maxima within the peak
width, "PeakArea", which takes the area under the intensity curve within the
peak width, and "NumPeaks", which counts the local maxima in the peak window.
If |
A data frame with one row for each sample, peak, and measurement.
The data.frame will have a character column named "sample", containing either
the name of the sample (if the samples in sampleset
are named) or the
index of the sample if they are not (but it will always be a character
column); a column named "peakName" with the name of the relevant peak (if
the "peaks" attribute of sampleset
is a named list); a column named
"peakValue" containing the m/z value at the center of the relevant peak; a
column named "measure" containing the name of the relevant measure; and a
column named "value" containing the numeric value of the particular measure
for that sample and peak.
peaks <- rtmsPeakList(c(1516.83,1530.84),peakWidth=0.2,windowWidth = c(5,10))
names(peaks) <- c("Product","Substrate")
sample <- getSample(exampleSpectrum,peaks)
sampleSet <- rep(sample,3)
names(sampleSet) <- c("A","B","C")
measures <- measureSampleSet(sampleSet)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.