The single removal verb for contamination handling. It consumes any
contam_tbl produced by an identify_contam_*_pq() detector (or several,
combined with rbind()) and prunes the flagged taxa from physeq by name.
When the contam_tbl is empty, physeq is returned unchanged.
Arguments
- physeq
(phyloseq, required) A phyloseq object.
- contam
(contam_tbl, required) Output of an
identify_contam_*_pq()detector. Removal is keyed on thetaxoncolumn, so taxa are matched by name rather than position.- clean_phyloseq_object
(logical, default
TRUE) Whether to clean the resulting object withMiscMetabar::clean_pq()to drop emptied taxa/samples.- verbose
(logical, default
TRUE) Whether to report how many taxa were removed.
See also
identify_contam_corr_pq() and the other identify_contam_*_pq()
detectors that produce a contam_tbl.
Examples
library(MiscMetabar)
# \donttest{
flagged <- identify_contam_corr_pq(data_fungi, verbose = FALSE)
data_clean <- filter_contam_pq(data_fungi, flagged)
#> ✔ No contaminant taxa to remove.
# }