How to make a consolidated beta diversity heatmap?

Hi, I am trying to create a figure similar to fig. d and e in the below image

I ran the following code

qiime feature-table filter-features /
--i-table abc-merged-table.qza /
--m-metadata-file abc-transposed-table.qza /
--o-filtered-table abc-filtered-table.qza'

And got the below output:

heatmap.qzv (2.1 MB)

I have 2 questions:

  1. The heatmap generated contains 9 columns each representing a given sample. Is there a way to combine/consolidate some of these to create groups showing trends between each of these groups? For example: these 9 columns may include 3 groups with n=3, so combining each group so we only have 3 columns depicting group-wise trends

  2. As you can see, there are hashes visible in the qzv file. How do I replace them with the respective genera/taxonomic level as shown in fig e of the first image?


Check out this plugin that can group a feature table according to one of the columns in the metadata file.

One way around it will be to collapse ASV table to taxonomy.


Thank you @timanix. I used your suggestion to generate a heatmap (below) which is in 3 groups and also collapsed the ASVs. Is there a better way to just get genera in a more clean way i.e. just the genera words as shown in the original reference image and not in the "k_Bacteria;p_Bacteroidetes..." type format. Thank you!

Also follow up question: Is there a way to generate the solar plot using this data as shown in figure (d) of the reference figure?


  • Manipulate either .csv or .png figures from visualization using 3-side software like inkspace, GIMP or photoshop.
  • Export collapsed table as biom, convert to .tsv, edit IDs, convert back to biom and import to qiime, then redo the plot.
  • Edit taxonomy.tsv file inside taxonomy.qza artifact to show only genera and collapse feature table to the first level.

As well as I know, there is no plugin for it in Qiime2, at least in the core plugins. I would search for tools outside of Qiime2 or in qiime2 plugins library.

Thank you! I just used photoshop to edit them. However, I have a similar but more complicated question which cannot be done through photoshop.

I am creating a phylogenetic tree (below) and wanted to do something similar i.e. display only the genera without the k_Bacteria format. I am using the rooted-tree.qza file as input. Is there a way to edit the rooted tree files?

Unfortunately, I don't think that there are some tools for it in Qiime2.
In theory, one can export tree from Qiime2 and manipulate it or sequences IDs before tree construction using bash, R or Python custom scripts, but it is not straightforward and will require some skills and time.

1 Like

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