This function takes a filter object of class 'moleculeFilt', 'massFilt', 'formulaFilt', 'emetaFilt', or 'confFilt' and applies the filter to a dataset of class ftmsData
or CoreMSData
applyFilt(filter_object, msObj, ...)
# S3 method for moleculeFilt
applyFilt(filter_object, msObj, min_num = 2, ...)
# S3 method for massFilt
applyFilt(filter_object, msObj, min_mass = 200, max_mass = 900, ...)
# S3 method for formulaFilt
applyFilt(filter_object, msObj, remove = "NoFormula", ...)
# S3 method for emetaFilt
applyFilt(
filter_object,
msObj,
min_val = NULL,
max_val = NULL,
cats = NULL,
na.rm = TRUE,
...
)
# S3 method for confFilt
applyFilt(filter_object, msObj, min_conf = 0.5, ...)
an object of the class 'moleculeFilt', 'massFilt', 'formulaFilt', 'emetaFilt', or 'confFilt'
an object of the class ftmsData
or CoreMSData
, created by as.peakData
or as.CoreMSData
, respectively
further arguments as described below based on the class of filter_object
[moleculeFilt
object] an integer value specifying the minimum number of times each biomolecule must be observed across all samples in order to retain the biomolecule. Default value is 2.
[massFilt
object] a numeric value greater than 0, specifying the minimum mass a peak should have in order to retain the peak. Default value is 200.
[massFilt
object] a numeric value greater than min_mass
, specifying the maximum mass a peak should have in order to retain the peak. Default value is 900.
[formulaFilt
object] a character string specifying which set of peaks to filter. Valid options are "NoFormula" and "Formula", defaults to "NoFormula".
[emetaFilt
object] a numeric value specifying the minimum value (inclusive) that a peak should have for the specified 'e_meta' column.
[emetaFilt
object] a numeric value specifying the maximum value (inclusive) that a peak should have for the specified 'e_meta' column.
[emetaFilt
object] a vector of character values specifying the level(s) of the specified 'e_meta' column which should be retained.
[emetaFilt
object] logical value specifying if peaks with NA values for the specified 'e_meta' column should be removed. Default value is TRUE.
a numeric value greater than 0 specifying the minimum confidence score a peak should have in order to be retained
An object of the class ftmsData
or CoreMSData
with specified molecules filtered out of the appropriate datasets