R/AllGenerics.R, R/filterRPCAInput.R
filterRPCAInput.RdfilterRPCAInput() applies Gemelli-style preprocessing filters to raw
count assays before robust centered log-ratio transformation and RPCA.
The filters are intended for raw count data, not transformed assays such as rclr. Samples are filtered by total count. Features are filtered by total count and prevalence across samples.
filterRPCAInput(x, ...)
# S4 method for class 'SummarizedExperiment'
filterRPCAInput(
x,
assay.type = "counts",
min.sample.count = 0,
min.feature.count = 0,
min.feature.frequency = 0,
...
)a SummarizedExperiment object.
additional arguments.
Character scalar. Specifies the name of assay
used in calculation. (Default: "counts")
Numeric scalar or NULL. Specifies the
minimum sample total count. Samples with total counts less than or equal to
this value are removed. If NULL, this filter is skipped.
(Default: 0)
Numeric scalar or NULL. Specifies the
minimum feature total count. Features with total counts less than or equal
to this value are removed. If NULL, this filter is skipped.
(Default: 0)
Numeric scalar or NULL. Specifies
the minimum feature prevalence across samples as a proportion between 0 and
Features with prevalence less than or equal to this value are removed.
If NULL, this filter is skipped. (Default: 0)
Filtered SummarizedExperiment object.
This function mirrors Gemelli-style RPCA table preprocessing:
sample total count must be > min.sample.count
feature total count must be > min.feature.count
feature prevalence percentage must be > min.feature.frequency
The strict > comparison is intentional.
For exact comparison with the current Gemelli script, use:
Martino, C. and Shenhav, L. et al. (2020) Context-aware dimensionality reduction deconvolutes gut microbial community dynamics. Nat. Biotechnol. doi:10.1038/s41587-020-0660-7
addRPCA and
addJointRPCA
data(GlobalPatterns)
tse <- GlobalPatterns
tse_sub <- filterRPCAInput(
tse,
min.sample.count = 5,
min.feature.count = 10,
min.feature.frequency = 0.3
)