joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
569 stars 187 forks source link

Aggregate_taxa #1656

Open mariamaseng opened 1 year ago

mariamaseng commented 1 year ago

Hello! Thanks for this awsome package.

My question is: I have a phyloseq object (see below), and want to aggregate_taxa(py, level="species"), but I am then getting this which does not look right: top 5 species: [1] "dBacteria_p__Bacteroidota_cBacteroidia_oBacteroidales_f__Bacteroidaceae_gBacteroides_" [2] "sBacteroides fragilis"
[3] "s
Ruthenibacterium lactatiformans"
[4] "dBacteria____"
[5] "dBacteria_p__Bacteroidota_cBacteroidia_oBacteroidales_f__Bacteroidaceae_gPhocaeicola_"

My taxa_table seems correct. Any tips on what to do to not have the bacteria domain as a species? Thanks!

phyloseq-class experiment-level object otu_table() OTU Table: [ 2561 taxa and 32 samples ] sample_data() Sample Data: [ 32 samples by 20 sample variables ] tax_table() Taxonomy Table: [ 2561 taxa by 7 taxonomic ranks ] phy_tree() Phylogenetic Tree: [ 2561 tips and 2560 internal nodes ]

david-barnett commented 1 year ago

you might find useful the function tax_fix from my package microViz 🙂 https://david-barnett.github.io/microViz/articles/web-only/tax-fixing.html

mariamaseng commented 1 year ago

Thank you! That worked! Or, at least it says "domain" behind, and I will try with your package to filter those away. Thank you!!! :D