Heatmapping Beta diversity

Hi all, newcomer to both qiime2 and microbial science here.

I'm wondering (and not finding an answer in either qiime2 docs or the forum) whether it's possible in qiime2 to produce a heatmap where both x and y axes represent samples (designated 1 to 20, let's say) and colour shades at the crossing represent the value of selected Beta-diversity metric.

I have the core Beta diversity metrics computed in qiime2 for my samples so I have everything needed as input, I believe. This should be a simple feat to achieve, the question is through which plugin?

Thanks in advance for any ideas!



Hi @Jan_Kollar ,

QIIME 2 does not have such a function itself, but it is easy to make one by passing a QIIME 2 distance matrix to the python package scikit-bio.

Give the following a try (working example from a Jupyter Notebook, will need some tweaks to run outside of a notebook):

import qiime2 as q2
import skbio
%matplotlib inline

dm = q2.Artifact.load('weighted_unifrac_distance_matrix.qza')
dm = dm.view(skbio.DistanceMatrix)

Thanks for your attention! I've already resolved the issue by simply exporting the distance matrices from the respective QIIME2 artefacts, feeding them to R and building the heatmaps there. Nevertheless, the suggested python-based solution is certainly more elegant and gives the same result, of course. Thanks a lot!

1 Like