quantMatrix {TargetSearch} | R 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 by manually setting its values (see example).

### Usage

    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

    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

[Package TargetSearch version 1.43.3 Index]