trim_cv: Trims by CV

Description Usage Arguments Value Examples

View source: R/trimming-functions.R

Description

Removes metabolites with coefficient of variation greater than the user specified threshold, calculated from the QC samples

Usage

1
trim_cv(Peak.list, search.par, QC.id)

Arguments

Peak.list

data frame. Must have QC sample columns that contain the string 'Pooled_QC_'. Should contain output columns from XCMS and CAMERA, and additional columns from IHL.search, Calc.MinFrac, CAMERA.parser, Calc.corr.stat and Combine.phenodata base functions.

search.par

a single-row data frame with 11 variables containing user-defined search parameters. Must contain the columns "ppm","rt","Voidrt","Corr.stat.pos","Corr.stat.neg", "CV","Minfrac", "Endogenous", "Solvent","gen.plots", "keep.singletons".

QC.id

character vector specifying identifier in filename designating a Pooled QC sample. Only the first value will be used. Default is "Pooled_QC_"

Value

data frame Peak.list.trimmed original Peak.list without all metabolite groups with coefficient of variation greater than user specified threshold; if dataset contains blanks, data.frame with all NA values is returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(LUMA)
# is case sensitive on Linux
file <- system.file('extdata','Search_Parameters.txt', package = "LUMA")
search.par <- read.table(file, sep = "\t", header = TRUE) #Ignore Warning message
test <- trim_cv(Peak.list = Peaklist_Pos$From_CAMERA, search.par = search.par)
nrow(Peaklist_Pos$From_CAMERA) -  nrow(test) #Equals 13

test <- trim_cv(Peak.list = Peaklist_Pos$Combined_Isotopes_and_Adducts,
search.par = search.par)
nrow(Peaklist_Pos$Combined_Isotopes_and_Adducts) -  nrow(test) #Equals 9

USEPA/LUMA documentation built on Aug. 29, 2020, 1:40 p.m.