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.

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


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:

good luck!

1 Like