sampleRI {TargetSearch} | R Documentation

## Sample specific RI detection

### Description

Return a matrix of the sample specific retention indices (RI) based on the correlating selective masses.

### Usage

    sampleRI(samples, Lib, r_thres = 0.95, columns = NULL,
             method = "dayNorm", minPairObs = 5, showProgressBar = FALSE,
             makeReport = FALSE, pdfFile = "medianLibRep.pdf")

### Arguments

`samples` | A `tsSample` object created by `ImportSamples` function.
`Lib` | A `tsLib` object created by `ImportLibrary` function with corrected RI values. See `medianRILib`.
`r_thres` | A correlation threshold.
`columns` | Either `NULL`, a `character` vector, or an `integer` vector. In most cases, leave it as `NULL`. This parameter is used to configure the column names or positions of RI text files. See the documentation on the `text2bin` function for further details.
`method` | Normalization method. Options are `"dayNorm"`, a day based median normalization, `"medianNorm"`, normalization using the median of all the intensities of a given mass, and `"none"`, no normalization at all.
`minPairObs` | Minimum number of pair observations. Correlations between two variables are computed using all complete pairs of observations in those variables. If the number of observations is too small, you may get high correlations values just by chance, so this parameters is used to avoid that. Cannot be set lower than 5.
`showProgressBar` | Logical. Should the progress bar be displayed?
`makeReport` | Logical. If `TRUE` will report the RI deviations for every metabolite in the library.
`pdfFile` | The file name where the report will be saved.

### Value

A matrix of correlating selective masses RI. Columns represent samples and rows the median RI of the selective masses.

### Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

### See Also

`ImportSamples`, `ImportLibrary`, `medianRILib`, `tsLib`, `tsSample`

### Examples

    require(TargetSearchData)
    data(TSExample)

    # get RI file path
    RI.path <- file.path(find.package("TargetSearchData"), "gc-ms-data")
    # update RI file path
    RIpath(sampleDescription) <- RI.path
    # Import Library
    refLibrary        <- ImportLibrary(file.path(RI.path,'library.txt'))

    # get the sample RI
    corRI <- sampleRI(sampleDescription, refLibrary, r_thres = 0.95)

    # same as above, but changing the correlation threshold and the minimum number
    # of observations
    corRI <- sampleRI(sampleDescription, refLibrary, r_thres = 0.9,
    			minPairObs = 10)

[Package TargetSearch version 1.50.1 Index]