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)

Arguments

x

phyloseq-class object

taxa

this should match the rownames of otu_table(x)

relative

Logical. If TRUE will transform input to relative abundance. Default=FALSE

Value

A character with sample ids.

Examples

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)