filter_peaks_by_rsd: Filter features by RSD% of QC samples

Description Usage Arguments Value Examples

View source: R/filters.R

Description

Metabolomics datasets often contain 'features' with irreproducible peak intensity values, or with large numbers of missing values. This tool facilitates the remove of such features from a data matrix, based upon relative standard deviation of intensity values for a given feature within specified QC samples.

Usage

1
filter_peaks_by_rsd(df, max_rsd, classes, qc_label, remove_peaks = TRUE)

Arguments

df

A matrix-like (e.g. an ordinary matrix, a data frame) or RangedSummarizedExperiment-class object with all values of class numeric() or integer() of peak intensities, areas or other quantitative characteristic.

max_rsd

numeric(), threshold of QC RSD% value

classes

character(), vector of class labels. Must be the same length as the number of sample in the input peak table. If input is SummarizedExperiment object, use SummarizedExperiment_object$meta_data_column_name.

qc_label

character(1) or NULL, class label used to identify QC samples.

remove_peaks

logical(1), remove filtered features from peak matrix or not.

Value

Object of class SummarizedExperiment. If input data are a matrix-like (e.g. an ordinary matrix, a data frame) object, function returns numeric() matrix-like object of filtered data set. Function flags are added to the object attributes and is a DataFrame-class with five columns. The same DataFrame-class object containing flags is added to rowData() element of SummarizedExperiment object as well.

Columns in rowData() or flags element contain:
rsd_QC numeric(), RSD% value of QC samples per feature;
rsd_flags integer(),if 0 feature is flagged to be removed.

Examples

1
2
3
df <- MTBLS79[ ,MTBLS79$Batch == 1]
out <- filter_peaks_by_rsd(df=df, max_rsd=20,
    classes=df$Class, qc_label='QC')

pmp documentation built on April 1, 2021, 6:01 p.m.