quantMatrix: Create an intensity matrix using quantification masses

Description Usage Arguments Value Author(s) See Also Examples

View source: R/quantMatrix.R

Description

Create an intensity matrix using quantification masses. The quantification masses can be specified when importing the library file or by manually setting its values (see example).

Usage

1
quantMatrix(Lib, metabProfile, value = "maxint")

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 default method to select automatically the quantification mass, in case it is not given by the user. 'maxint' selects the selective mass with the highest intensity. 'maxobs' selects the most observed mass, i.e., the one with less missing values.

Value

An intensity matrix with metabolites as rows and samples as columns. The matrix has two attributes: 'quantMass' a numeric vector that contains the quantification masses that were selected; 'isSelMass' a logical vector that indicates whether a quantification mass is also a selected mass.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

tsLib, tsMSdata

Examples

 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
require(TargetSearchData)
data(TSExample)

# process chormatograms and get a profile
RI.path    <- file.path(find.package("TargetSearchData"), "gc-ms-data")
RIpath(sampleDescription) <- RI.path
refLibrary <- ImportLibrary(file.path(RI.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)

# show quant Matrix
quantMass(refLibrary)
# no quantMass have been defined yet, so are all zeros
# 0  0  0  0  0  0  0  0  0  0  0  0

# get a Matrix using use default values, ie, select the masses
# with the highest intensity 
quantMat <- quantMatrix(refLibrary, metabProfile)
quantMat

# set the quantification Masses
quantMass(refLibrary)[1:3] <- c(89,86,100)
quantMat <- quantMatrix(refLibrary, metabProfile)
quantMat

TargetSearch documentation built on March 12, 2021, 2 a.m.