Error after collapsing to phylum level


I am doing a meta-analysis with multiple different studies. I have a very strong study effect occurring on my data, making the PCoA plots look like "Y"s because it is so strong. Speaking with another person, they suggested that I collapse to the phylum level to remove the strong differences. However, I am encountering an error when I try to run the core-metrics after I collapse the table. Below is the example:

qiime taxa collapse
–i-table table.qza
–i-taxonomy taxonomy.qza
–p-level 2
–o-collapsed-table table-phylum.qza

qiime diversity core-metrics-phylogenetic
–i-phylogeny rooted-tree.qza
–i-table table-phylum.qza
–p-sampling-depth 1000
–m-metadata-file metadata.txt
–output-dir core-metrics-results

The error message is as follows:
Plugin error from diversity:

All feature_ids must be present as tip names in phylogeny. feature_ids not corresponding to tip names (n=21): k__Bacteria;p__Cyanobacteria k__Bacteria;p__Bacteroidetes k__Bacteria;p__Planctomycetes k__Bacteria;p__Fibrobacteres k__Bacteria;p__Deferribacteres k__Bacteria;p__Verrucomicrobia k__Bacteria;p__Synergistetes k__Bacteria;__ k__Bacteria;p__OD1 k__Bacteria;p__Proteobacteria k__Bacteria;p__Tenericutes Unassigned;__ k__Bacteria;p__WPS-2 k__Bacteria;p__Fusobacteria k__Bacteria;p__Firmicutes k__Bacteria;p__Lentisphaerae k__Bacteria;p__Actinobacteria k__Bacteria;p__ k__Bacteria;p__Elusimicrobia k__Bacteria;p__Spirochaetes k__Bacteria;p__TM7

I checked the table, and I couldn’t find the labels, because there was a space in-between the kingdom and phylum like this: “k__Bacteria; p__TM7” (vs this “k__Bacteria;p__TM7”).

I think that might be why the error is occurring. I tried removing the spaces, but then the file was never in the correct format to use again.

Thank you,

collapsing at phylum level will likely remove far too much information to yield a meaningful analysis. It sounds like you may not have study biases, per se, but unique ASVs/OTUs in each study; you may need to trim to the same lengths or, better yet, use q2-fragment-insertion (see notes and example here) to build your phylogeny and reduce some amount of this study bias (if that is not what you are doing already).

A collapsed table can no longer be used with the phylogeny because the feature IDs now consist of taxonomic labels rather than ASV/OTU IDs (which are the tip labels in the phylogeny). So you can collapse and then use non-phylogenetic methods, not not phylogenetic beta diversity methods (e.g., UniFrac).

I hope that helps!

1 Like