Nice-looking PCoA with ellipsoid in Python

Hi coomunity!

I have noticed there are soe topics in the forum regarding exporting PCoA results to R to generate publication-quality PCoA plots (with ellipsoids, which we often want).

I wonder - can someone help me with how to do it in matplotlib (/seaborn) as a python guy? Should I export the distance matrix or the PCoA artifact?
Would love to get some help from python users...

Happy new year!

Hello,

you export PCoA results and use this code to draw ellipses.

Good luck!
Valentyn

2 Likes

Thanks!

The ax in that function is just the PCoA obtained from QIIME?

So let's say my workflow should be:

  • Creating PCoA in QIIME
  • exporting it to my python environmment
  • use it as ax in the function from that post
    ?

Thanks!

To clear up the confusion:

  • PCoA results are not a plot, they're numeric results of applying a method to a FeatureTable
  • You use 2 first dimensions of PCoA results to plot a regular scatterplot in matplotlib.
  • You operate on figure and ax objects from matplotlib.

Cheers
V

1 Like

Thanks for the clarification.
Is there a way to stratify ellipsoids between metadata column groups? (i.e different ellipsoids for different values in the metadata column)