FAMEoutliers: FAME outlier detection

FAMEoutliersR Documentation

FAME outlier detection

Description

A function to detect retention time marker (FAME) outliers.

Usage

FAMEoutliers(samples, RImatrix, pdffile = NA, startDay = NULL, endDay = NULL,
             threshold = 3, group.threshold = 0.05)

Arguments

samples

A tsSample object created by ImportSamples function.

RImatrix

A retention time matrix of the found retention time markers.

pdffile

A character string naming a PDF file where the FAMEs report will be saved.

startDay

A character vector with the starting days of your day groups.

endDay

A character vector with the ending days of your day groups.

threshold

A standard deviations cutoff to detect outliers.

group.threshold

A numeric cutoff to detect day groups based on hierarchical clustering. Must be between 0..1.

Details

If no pdffile argument is given, the report will be saved on a file called "TargetSearch-YYYY-MM-DD.FAME-report.pdf", where YYYY-MM-DD is a date.

If both startDay and endDay are not given (both set to either NULL or NA), the function will try to detect day groups using a hierarchical clustering approach by cutting the tree using group.threshold as cutoff height. Otherwise, both must have the same length, must not contain NAs, and must match the measurement days of the object samples. See example below.

Retention time markers that deviate more than threshold standard deviations from the mean of their day group will be identified as outliers.

Value

A logical matrix of the same size of RImatrix. A TRUE value indicates that the retention time marker in that particular sample is an outlier.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

RIcorrect, ImportSamples, TSExample

Examples

# load pre-calculated example data and objects
data(TSExample)

# find the retention marker outliers of the example data and save it in "outlier.pdf"
outliers <- FAMEoutliers(sampleDescription, RImatrix, pdffile = "outlier.pdf")

# find the outliers (although they are reported in the output PDF file)
apply(outliers, 1, which)

# using `startDay` and `endDay` to set day groups manually
sampleDays(sampleDescription) <- rep(letters[1:3], each=5) # make fake days a, b, c

# set days 'a' and 'b' in a group and day 'c' by itself
startDay <- c('a', 'c')
endDay <- c('b', 'c')

outliers <- FAMEoutliers(sampleDescription, RImatrix, pdffile="outlier.pdf",
            startDay=startDay, endDay=endDay)

acinostroza/TargetSearch documentation built on Nov. 13, 2024, 12:28 a.m.