Euclidean distance in heatmap and Shannon index formulas

Hi, does anyone know the formula used by Qiime2 to calculate Euclidean distances for creating heatmap and Shannon index? I know that Shannon index can be calculated with slightly different formulas.

Hello,
I hope you don't mind that I merged your topics into one.
Best,

2 Likes

Hi @BiancaFranco ,
Welcome to the forum!

You can check the source code in q2-diversity and q2-feature-table to be sure, but to my recollection:

As I recall, heatmap uses seaborn's clustermap under the hood, which uses scipy.spatial.distance.pdist to calculate all distance metrics. You can check there for more details on the formula etc.

Most of q2-diversity's alpha diversity metrics are defined in scikit-bio. You can see the equation and documentation here:
http://scikit-bio.org/docs/0.4.2/generated/generated/skbio.diversity.alpha.shannon.html#skbio.diversity.alpha.shannon

good luck!

1 Like