filterRPCAInput() 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,
  ...
)

Arguments

x

a SummarizedExperiment object.

...

additional arguments.

assay.type

Character scalar. Specifies the name of assay used in calculation. (Default: "counts")

min.sample.count

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)

min.feature.count

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)

min.feature.frequency

Numeric scalar or NULL. Specifies the minimum feature prevalence across samples as a proportion between 0 and

  1. Features with prevalence less than or equal to this value are removed. If NULL, this filter is skipped. (Default: 0)

Value

Filtered SummarizedExperiment object.

Details

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:

min.sample.count = 0
min.feature.count = 0
min.feature.frequency = 0

References

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

See also

Examples


data(GlobalPatterns)
tse <- GlobalPatterns

tse_sub <- filterRPCAInput(
    tse,
    min.sample.count = 5,
    min.feature.count = 10,
    min.feature.frequency = 0.3
)