filter_peaks_by_rsd: Filter features by RSD% of QC samples

View source: R/filters.R

filter_peaks_by_rsdR Documentation

Filter features by RSD% of QC samples


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.


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



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.


numeric(), threshold of QC RSD% value


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.


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


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


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.


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

computational-metabolomics/pmp documentation built on April 30, 2022, 4:28 a.m.