phyloseq
phyloseq copied to clipboard
filter_taxa after tax_glom
Hello,
I am trying to filter out genera that have relative abundances less than 10% after collapsing the ASVs into Genus using tax_glom. I am attempting to do this as follows:
1.subset core genera of interest
core.95prev.int <- com.rarefied.min.int.exclude.1.3.rooted %>% subset_taxa(Genus %in% core.genus.all.clusters.95.tosub)
2. Collapse ASVs at the genus level
core.95prev.int.genus <- tax_glom(core.95prev.int, taxrank = "Genus")
3. filter for relative abundances > 10%
total sample_sums(core.95prev.int.genus)
core.95prev.int.genus.exc10 = filter_taxa(core.95prev.int.genus, function(x) sum(x > total*0.10) > 0,TRUE)
While I had no troubles with 1 and 2, 3 results in the following error: Error: Unsupported class: phyloseq
Does this mean that it is not possible to apply this filtering step after a tax_glom?
How could I possibly filter a phyloseq after tax_glom?