Description Usage Arguments Details Slots Author(s) See Also Examples
The Chromatogram
class is designed to store
chromatographic MS data, i.e. pairs of retention time and intensity
values. Instances of the class can be created with the
Chromatogram
constructor function but in most cases the dedicated
methods for OnDiskMSnExp
and
MSnExp
objects extracting chromatograms should be
used instead (i.e. the chromatogram
method).
Chromatogram
: create an instance of the
Chromatogram
class.
aggregationFun,aggregationFun<-
get or set the
aggregation function.
rtime
returns the retention times for the rentention time
- intensity pairs stored in the chromatogram.
intensity
returns the intensity for the rentention time
- intensity pairs stored in the chromatogram.
mz
get the mz (range) of the chromatogram. The
function returns a numeric(2)
with the lower and upper mz value.
precursorMz
get the mz of the precursor ion. The
function returns a numeric(2)
with the lower and upper mz value.
fromFile
returns the value from the fromFile
slot.
length
returns the length (number of retention time -
intensity pairs) of the chromatogram.
as.data.frame
returns the rtime
and
intensity
values from the object as data.frame
.
filterRt
: filters the chromatogram based on the provided
retention time range.
clean
: Removes unused 0-intensity data points. See
clean
documentation for more details and examples.
plot
: plots a Chromatogram
object.
msLevel
returns the MS level of the chromatogram.
isEmpty
returns TRUE
for empty chromatogram or
chromatograms with all intensities being NA
.
productMz
get the mz of the product chromatogram/ion. The
function returns a numeric(2)
with the lower and upper mz value.
bin
aggregates intensity values from a chromatogram in discrete bins
along the retention time axis and returns a Chromatogram
object with
the retention time representing the mid-point of the bins and the intensity
the binned signal.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | Chromatogram(
rtime = numeric(),
intensity = numeric(),
mz = c(NA_real_, NA_real_),
filterMz = c(NA_real_, NA_real_),
precursorMz = c(NA_real_, NA_real_),
productMz = c(NA_real_, NA_real_),
fromFile = integer(),
aggregationFun = character(),
msLevel = 1L
)
aggregationFun(object)
## S4 method for signature 'Chromatogram'
show(object)
## S4 method for signature 'Chromatogram'
rtime(object)
## S4 method for signature 'Chromatogram'
intensity(object)
## S4 method for signature 'Chromatogram'
mz(object, filter = FALSE)
## S4 method for signature 'Chromatogram'
precursorMz(object)
## S4 method for signature 'Chromatogram'
fromFile(object)
## S4 method for signature 'Chromatogram'
length(x)
## S4 method for signature 'Chromatogram'
as.data.frame(x)
## S4 method for signature 'Chromatogram'
filterRt(object, rt)
## S4 method for signature 'Chromatogram'
clean(object, all = FALSE, na.rm = FALSE)
## S4 method for signature 'Chromatogram,ANY'
plot(
x,
col = "#00000060",
lty = 1,
type = "l",
xlab = "retention time",
ylab = "intensity",
main = NULL,
...
)
## S4 method for signature 'Chromatogram'
msLevel(object)
## S4 method for signature 'Chromatogram'
isEmpty(x)
## S4 method for signature 'Chromatogram'
productMz(object)
## S4 method for signature 'Chromatogram'
bin(
object,
binSize = 0.5,
breaks = seq(floor(min(rtime(object))), ceiling(max(rtime(object))), by = binSize),
fun = max
)
|
rtime |
|
intensity |
|
mz |
|
filterMz |
|
precursorMz |
|
productMz |
|
fromFile |
|
aggregationFun |
|
msLevel |
|
object |
A |
filter |
For |
x |
For |
rt |
For |
all |
For |
na.rm |
For |
col |
For |
lty |
For |
type |
For |
xlab |
For |
ylab |
For |
main |
For |
... |
For |
binSize |
for |
breaks |
for |
fun |
for |
The mz
, filterMz
, precursorMz
and
productMz
are stored as a numeric(2)
representing a range
even if the chromatogram was generated for only a single ion (i.e. a
single mz value). Using ranges for mz
values allow this class to
be used also for e.g. total ion chromatograms or base peak chromatograms.
The slots precursorMz
and productMz
allow to represent SRM
(single reaction monitoring) and MRM (multiple SRM) chromatograms. As
example, a Chromatogram
for a SRM transition 273 -> 153 will have
a @precursorMz = c(273, 273)
and a
@productMz = c(153, 153)
.
.__classVersion__,rtime,intensity,mz,filterMz,precursorMz,productMz,fromFile,aggregationFun,msLevel
See corresponding parameter above.
Johannes Rainer
MChromatograms
for combining Chromatogram
in
a two-dimensional matrix (rows being mz-rt ranges, columns samples).
chromatogram
for the method to extract chromatogram data
from a MSnExp
or OnDiskMSnExp
object.
clean
for the method to clean a Chromatogram
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Create a simple Chromatogram object.
ints <- abs(rnorm(100, sd = 100))
rts <- seq_len(length(ints))
chr <- Chromatogram(rtime = rts, intensity = ints)
chr
## Extract intensities
intensity(chr)
## Extract retention times
rtime(chr)
## Extract the mz range - is NA for the present example
mz(chr)
## plot the Chromatogram
plot(chr)
## Create a simple Chromatogram object based on random values.
chr <- Chromatogram(intensity = abs(rnorm(1000, mean = 2000, sd = 200)),
rtime = sort(abs(rnorm(1000, mean = 10, sd = 5))))
chr
## Get the intensities
head(intensity(chr))
## Get the retention time
head(rtime(chr))
## What is the retention time range of the object?
range(rtime(chr))
## Filter the chromatogram to keep only values between 4 and 10 seconds
chr2 <- filterRt(chr, rt = c(4, 10))
range(rtime(chr2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.