Is it possible to get Family and Species level diversity analysis plots?

Hi Friends,

I know that we can do different classification level taxa barplots from 1 to 7, from kingdom to species level. But, is it possible to do the same for diversity plots like beta diversity? Lets say diversity analysis at Family level.

Thanks,

Hi @danielsebas,
Certainly, though I’m not sure if it something you want to do. Beta diversity plots like PCoAs are always more meaningful when you are working at the highest resolution because as you move higher on the classification levels you tend to lose sensitivity on detecting community patterns.
With that caveat in mind if you still want to do that you can simply collapse your feature-table using the taxa collapse function and perform your beta diversity analyses using this new table.

3 Likes

Hi @Mehrbod_Estaki,

I did that but encountered this problem:

qiime taxa collapse --i-table Ionexpress_1to11-dada2-rep-seqs-V4-table4.qza --i-taxonomy Ionexpress_1to11_taxonomy-V4.qza --p-level 5 --o-collapsed-table Ionexpress_1to11-dada2-rep-seqs-V4-collapsed-5-table4.qza
Ionexpress_1to11-dada2-rep-seqs-V4-table4.qza (64.3 KB) Ionexpress_1to11-dada2-rep-seqs-V4-collapsed-5-table4.qzv (446.1 KB) Ionexpress_1to11-dada2-rep-seqs-V4-collapsed-5-table4.qza (56.9 KB) Ionexpress_1to11_taxonomy-V4.qza (86.6 KB)

qiime diversity core-metrics-phylogenetic --i-phylogeny Ionexpress_1to11_dada2-rep-seqs-rooted-tree-V4.qza --i-table Ionexpress_1to11-dada2-rep-seqs-V4-collapsed-5-table4.qza --p-sampling-depth 2000 --m-metadata-file Ionexpress_1to11_metadat.tsv --output-dir core-metrics-results-family5-V4
Ionexpress_1to11_dada2-rep-seqs-rooted-tree-V4.qza (87.0 KB)

I get this error:

Plugin error from diversity:

All feature_ids must be present as tip names in phylogeny. feature_ids not corresponding to tip names (n=57): k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;o__Rickettsiales;f__ k__Bacteria;p__Proteobacteria;c__Betaproteobacteria;o__Burkholderiales;f__Comamonadaceae k__Bacteria;p__OP3;c__koll11;o__;f__ k__Bacteria;p__Proteobacteria;c__Betaproteobacteria;o__Hydrogenophilales;f__Hydrogenophilaceae k__Bacteria;p__Bacteroidetes;c__Flavobacteriia;o__Flavobacteriales;f__Flavobacteriaceae k__Bacteria;p__TM7;c__TM7-1;o__;f__ k__Bacteria;p__Chlamydiae;c__Chlamydiia;o__Chlamydiales;__ k__Bacteria;p__Nitrospirae;c__Nitrospira;o__Nitrospirales;f__Nitrospiraceae k__Bacteria;p__TM6;c__SJA-4;o__;f__ k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Aeromonadales;f__Aeromonadaceae k__Bacteria;p__TM6;c__SJA-4;o__S1198;f__ k__Bacteria;;;; k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;o__Rhizobiales;f__Hyphomicrobiaceae k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Desulfovibrionales;f__Desulfovibrionaceae k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;; k__Bacteria;p__Bacteroidetes;c__Sphingobacteriia;o__Sphingobacteriales;f__Sphingobacteriaceae k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Legionellales;__ k__Bacteria;p__Verrucomicrobia;c__[Pedosphaerae];o__[Pedosphaerales];f__[Pedosphaeraceae] k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;o__;f__ k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__FAC87;f__ k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Alteromonadales;f__Shewanellaceae k__Bacteria;p__Actinobacteria;c__Actinobacteria;o__Actinomycetales;f__Mycobacteriaceae k__Bacteria;p__;c__;o__;f__ k__Bacteria;p__Actinobacteria;c__Actinobacteria;o__Bifidobacteriales;f__Bifidobacteriaceae k__Bacteria;p__OP3;c__BD4-9;o__;f__ k__Bacteria;p__Proteobacteria;c__Epsilonproteobacteria;o__Campylobacterales;f__Campylobacteraceae k__Bacteria;p__Proteobacteria;c__Betaproteobacteria;o__Rhodocyclales;f__Rhodocyclaceae k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__[Entotheonellales];f__[Entotheonellaceae] k__Bacteria;p__Bacteroidetes;c__Bacteroidia;o__Bacteroidales;f__Bacteroidaceae k__Bacteria;p__Firmicutes;c__Clostridia;o__Clostridiales;f__Ruminococcaceae k__Bacteria;p__Bacteroidetes;c__Bacteroidia;o__Bacteroidales;f__Prevotellaceae k__Bacteria;p__Chlamydiae;c__Chlamydiia;o__Chlamydiales;f__Rhabdochlamydiaceae k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;; k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Bdellovibrionales;f__Bacteriovoracaceae k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Spirobacillales;f__ k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Myxococcales;f__OM27 k__Bacteria;p__Chlamydiae;c__Chlamydiia;o__Chlamydiales;f__ k__Bacteria;p__Firmicutes;c__Clostridia;o__Clostridiales;f__Veillonellaceae k__Bacteria;p__Fibrobacteres;c__Fibrobacteria;o__Fibrobacterales;f__Fibrobacteraceae k__Bacteria;p__Chlamydiae;c__Chlamydiia;o__;f__ k__Bacteria;p__Proteobacteria;c__Betaproteobacteria;o__Procabacteriales;f__Procabacteriaceae k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;; k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__MIZ46;f__ Unassigned;;;; k__Bacteria;p__Bacteroidetes;c__Bacteroidia;o__Bacteroidales;__ k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Enterobacteriales;f__Enterobacteriaceae k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Alteromonadales;f__[Chromatiaceae] k__Bacteria;p__Bacteroidetes;c__[Saprospirae];o__[Saprospirales];f__Chitinophagaceae k__Bacteria;p__Fibrobacteres;c__Fibrobacteria;o__258ds10;f__ k__Bacteria;p__Proteobacteria;;;__ k__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__;f__ k__Bacteria;p__Firmicutes;c__Bacilli;o__Lactobacillales;f__Streptococcaceae k__Bacteria;p__Spirochaetes;c__[Leptospirae];o__[Leptospirales];f__Leptospiraceae k__Bacteria;p__OD1;c__;o__;f__ k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Pseudomonadales;f__Moraxellaceae k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;o__Sphingomonadales;f__Sphingomonadaceae k__Bacteria;p__Proteobacteria;c__Betaproteobacteria;o__SC-I-84;f__

Debug info has been saved to /tmp/qiime2-q2cli-err-ae90ik3w.log

Could you please let me know what could be the issue here and how can I solve it? Thanks

Hi @danielsebas!

I believe you have found a slight (and very very hard to fix) hole in our available actions. Here’s what’s happened:

When you collapsed your table by taxonomy, all of the ASVs have been removed and grouped by taxonomy. Your phyolgenetic tree is still based on ASVs. Constructing a new phylogenetic tree would required some sequence, which we don’t have readily available (databases work hard to estimate/reconstruct ancestral sequences for higher taxonomic ranks, this is certainly beyond the scope of your analysis here).

Nor is it straightforward to “group” a phylogenetic tree based on taxonomic rank, as a de-novo phylogeny is unlikely to agree as closely as you would like to your taxonomy. I suspect fragment-insertion could actually make a very strong case here as your phylogeny is based on the database, but grouping a phylogeny is unpleasant business that I would avoid.

This means you have no phylogenetic information from your samples. You could use the taxonomic database directly, however here we run into another problem. Your taxonomic classifications may not always map to a particular internal node in the database’s phylogeny, as the classifier may choose to “abort” if it can’t reliably determine a rank. This means in order to use a database phylogeny, you’d need to ensure you had ancestral OTUs available for each taxonomic rank. I believe Greengenes may fit this bill, but you’ll still need to manually map OTU ids to phylogenetic tips, and then back to a truncated form of your taxonomy. None if that is fun to do.


Instead, I would recommend using your taxonomic information as feature metadata using something like qiime emperor biplot instead.

Alternatively, you can ignore all phylogenetic metrics and run core-metrics alone (instead of core-metrics-phylogenetic)

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.