tsMSdata-class: Class for representing MS data

tsMSdata-classR Documentation

Class for representing MS data

Description

This is a class to represent MS data obtained from the sample.

Details

The method as.list converts every slot (RI, RT, and Intensity) of a tsMSdata object into a matrix. The converted matrices are stored in a list. Each converted matrix has an attribute called 'index' that relates the metabolite index with the respective rows. The components of the resulting list are named as the slots. If the slot RT is not defined or empty, then the output list will have only two components. ('RT' and 'Intensity').

These objects are created by the functions FindPeaks and peakFind and there is really no need to create them manually, so the examples focus on simple data manipulations.

The assignment methods retIndex<-, retTime<-, and Intensity<- are exposed for convenience, though they should not be needed in general. These objects are tightly coupled to the reference library (tsLib) and sample (tsSample) objects, so a modification could cause unexpected errors. Use under your own risk if you know what you are doing.

Objects from the Class

Objects be created by calling the functions FindPeaks or peakFind. See their respective documentation.

Slots

RI:

"list", a list containing an RI matrix, one matrix per metabolite

RT:

"list", a list containing an RT matrix, one matrix per metabolite

Intensity:

"list", a list containing a peak intensity matrix, one matrix per metabolite

Methods

Intensity

signature(obj = "tsMSdata"): gets the peak intensity list.

Intensity<-

signature(obj = "tsMSdata"): gets the peak intensity list.

retIndex

signature(obj = "tsMSdata"): gets RT list.

retIndex<-

signature(obj = "tsMSdata"): sets the RI list.

retTime

signature(obj = "tsMSdata"): gets the RT list.

retTime<-

signature(obj = "tsMSdata"): sets the RT list.

show

signature(object = "tsMSdata"): show function.

as.list

signature(object = "tsMSdata"): coerce a list object. See details

Note

For reasons explained in the details section, the methods retIndex<-, retTime<-, and Intensity<- are considered deprecated and could be removed without notice in the feature.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

FindPeaks, peakFind

Examples

showClass("tsMSdata")

# some example manipulations using object peakData
data(TSExample)
peakData

# extract the intensities of the metabolites
int <- Intensity(peakData)
# `int` is a list of matrices where rows are m/z values and columns are samples
head(int)

# extract retention indices (same structure for the intensities)
ri <- retIndex(peakData)
head(ri)

# coerce the whole object into a list of matrices (see details)
data <- as.list(peakData)

# it is possible to use the assignment methods `retIndex<-` and `Intensity<-`
# in these objects, but it is not recommended (only if you know what you are
# doing) for example for small tweaks (not sure what this accomplishes however)
ri[[1]][1,1] <- 234000
retIndex(peakData) <- ri

acinostroza/TargetSearch documentation built on May 5, 2024, 10:14 a.m.