PCoA- taxonomic level


When we do the PCoA, in my case with Bray Curtis, the data is at which taxonomic level (by default)?

Thank you!

Ana Santos

No, your data should be at ASVs level, until you tweaked it specially to perform it with collapsed data

1 Like


Thank you for your reply.

How i do that? I want to do a PCoA with species and another at genus level.

You should be able to do it by creating first a new tree with a collapsed at the desired level table instead of ASV table. After you can run the same commands as for ASV table but indicate collapsed tree and collapsed table. I did it earlier but then I realized that I received a completely different results because of collapsing table, since I lost a lot of insights on real beta diversity by combining ASVs into taxons. I prefer to perform this analysis at ASV level.

Do you have the commands or the drafts? It would help me to have a better idea.

Thank you

It was about a year ago and I didn’t keep it since I didn’t like the output. I wrote a Python script to tweak a tree and rep-seq.qza files.

Use qiime taxa collapse to collapse at the taxonomic level of your choice, and then use that feature table as input to qiime diversity core-metrics. See the --help documentation or qiime2.org for more details on using the collapse method.

Good luck!


but is it “legal” to run PCoA on ‘collapsed taxa’? After collapsing to the “genus” level, we lose information about individual sequences (ASVs) (at least I didn’t see that any “genus representative ASVs” appear). As we don’t have this “genus-representant-AVSs”, we can’t build a tree with sequence distances that is needed to feed PCoA…

After collapsing taxa we should rather use a normal PCA, no? I’m not an expert… I’d like somebody to enlight me :slight_smile:

Hi! As @Nicholas_Bokulich already corrected, no need to build a tree with collapsed data and one may just provide a collapsed table to a standard pipeline. I agree that the resolution of collapsed data is much lower it is why I decided not to use it, but I don’t know how exactly it is affecting the outputs

You can run a PCoA on a non-phylogenetic metric (bray curtis, jaccard, canberra, etc) or you can run DECOIDE for a PCA but no, a normal PCA still isnt appropriate because it still assumes euclidean distance which isnt great for microbiome



Ok, so full approach will be like this:

  1. collapse taxa

qiime taxa collapse
–i-table table.qza
–i-taxonomy taxonomy.qza
–p-level 6
–o-collapsed-table table-collapsed-L6.qza

  1. we check the number of features per taxa:

qiime feature-table summarize
–i-table table-collapsed-L6.qza
–o-visualization table-collapsed-L6-summarize.qzv
–m-sample-metadata-file sample-meta.tsv

  1. now we do diversity core-metrics (do not miss with core-metrics-phylogenetic)
qiime diversity core-metrics \
  --i-table table-collapsed-L6.qza \
  --p-sampling-depth 1125 \
  --m-metadata-file sample-meta.tsv \
  --output-dir core-metrics_no-phylogenetics
  1. and now we can look on PCoA:

qiime tools view core-metrics_no-phylogenetics/bray_curtis_emperor.qzv

Good? Make it sense? :slight_smile:


Hi @thedam,

Looks good! Thanks for writing out a detailed example.

Sure. As @timanix noted, PCoA on ASVs is best since it preserves the most information and is most likely to differentiate your samples and allows you to use phylogenetic methods like unifrac, but there is nothing “illegal” about running PCoA on collapsed taxa. As a matter of fact, collapsing at a taxonomic level for clustering could be a useful diagnostic to see, e.g., how that information reduction influences clustering.


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