quantMatrix: Create an intensity matrix using quantification masses

quantMatrixR Documentation

Create an intensity matrix using quantification masses

Description

Create an intensity matrix using quantification masses. The quantification masses can be specified when importing the library file or automatically.

Usage

quantMatrix(Lib, metabProfile, value=c("quantmass", "maxint", "maxobs"), selmass=FALSE)

Arguments

Lib

A tsLib object created by ImportLibrary function.

metabProfile

A tsProfile object. The final result of the package. This object is generated by either Profile or ProfileCleanUp.

value

The method to select automatically the quantification mass. The options are: “maxint” which selects the selective mass with the highest median intensity across all samples; “maxobs” which selects the mass which the most observations (the one with fewer missing values; or “quantmass” which uses the selected quantification mass defined by the library

selmass

Logical. If TRUE, then only selective masses are considered if the option value is either “maxint” or “maxobs”, otherwise all masses are considered (the default behavior). If value is “quantmass”, this argument has no effect

Value

An intensity matrix with metabolites as rows and samples as columns. The column names are the sample names of the respective tsSample object and the rownames correspond with the library unique identifiers.

In addition, the matrix has these attributes:

  • “quantMass” is a numeric vector that contains the quantification masses that was selected.

  • “isSelMass” is a logical vector that indicates whether the quantification mass is also a selected mass.

  • “isCorMass” to indicate that the mass is one of the correlating masses.

  • “libNames” the metabolite names (a character vector).

Author(s)

Alvaro Cuadros-Inostroza

See Also

tsLib, tsMSdata

Examples

require(TargetSearchData)
data(TSExample)

# process chromatograms and get a profile
RI.path <- tsd_data_path()
RIpath(sampleDescription) <- RI.path
refLibrary    <- ImportLibrary(tsd_file_path('library.txt'))
refLibrary    <- medianRILib(sampleDescription, refLibrary)
corRI         <- sampleRI(sampleDescription, refLibrary, r_thres = 0.95)
peakData      <- peakFind(sampleDescription, refLibrary, corRI)
metabProfile  <- Profile(sampleDescription, refLibrary, peakData, r_thres = 0.95)

# get a Matrix using use default values, ie, use the quantification masses
# defined in the library
quantMat <- quantMatrix(refLibrary, metabProfile)
quantMat

# use 'maxint' to select the metabolites with the highest median intensity
quantMat <- quantMatrix(refLibrary, metabProfile, 'maxint')

# use 'maxobs' to select the metabolites with the most observed values
quantMat <- quantMatrix(refLibrary, metabProfile, 'maxobs')

acinostroza/TargetSearch documentation built on Nov. 22, 2024, 3:31 p.m.