Finding the samples dominated by user provided taxa in a phyloseq object. This is useful especially if user suspects a taxa to be contaminant and wishes to identify which samples are dominated by the contaminant taxa.
find_samples_taxa(x, taxa = NULL, relative = FALSE)
phyloseq-class
object
this should match the rownames of otu_table(x)
Logical. If TRUE will transform input to relative abundance. Default=FALSE
A character with sample ids.
library(microbiomeutilities)
data("zackular2014")
p0 <- zackular2014
p0.f <- aggregate_taxa(p0, "Genus")
bac_dom <- find_samples_taxa(p0.f, taxa = "g__Bacteroides")
# get samples dominated by g__Bacteroides
ps.sub <- prune_samples(sample_names(p0.f) %in% bac_dom, p0.f)