Metaphlan 2 heat map

I’m getting the following error when trying to generate a heat map:

higleyadmin@JOAN9000 ~ % metaphlan_hclust_heatmap.py -c bbcry --top 25 --minv 0.1 -s log --in water_metaphlan_combined.txt --out abundance_heatmap.png
Traceback (most recent call last):
File “/opt/anaconda/envs/python2/bin/metaphlan_hclust_heatmap.py”, line 481, in
tax_lev = pars[‘tax_lev’]
File “/opt/anaconda/envs/python2/bin/metaphlan_hclust_heatmap.py”, line 452, in hclust
heatmap_panel( fig, D, minv, maxv, idx1, idx2, cm_name, scale, sample_labels, feat_labels, label_font_size, -cm_h8.0/ysize, cm_h0.88.0/ysize, flabelon, slabelon, cm_ticks, gridon, ydend_offset+sdend_h8.0
/ysize )
File “/opt/anaconda/envs/python2/bin/metaphlan_hclust_heatmap.py”, line 235, in heatmap_panel
axisbg=bottom_col)
File “/opt/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/figure.py”, line 1149, in add_axes
a = projection_class(self, rect, **kwargs)
File “/opt/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/axes/_base.py”, line 541, in init
self.update(kwargs)
File “/opt/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/artist.py”, line 888, in update
for k, v in props.items()]
File “/opt/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/artist.py”, line 881, in _update_property
raise AttributeError(‘Unknown property %s’ % k)
AttributeError: Unknown property axisbg
higleyadmin@JOAN9000 ~ %

Any ideas?

Hi, which version of matplotlib have you installed?

I checked my conda install and it has matplotlib 2.2.3

The metaphlan_hclust_heatmap.py script is deprecated, I’d advise you for using hclust2 for heatmap visualization. The script is removed in MetaPhlAn 3.0.

If you have a conda environment for MetaPhlAn3, you can clone the hclust2 repo and use from it, it has all the right dependencies installed.

Thank you. The new script works fine. There should be a mention of the deprecation in the documentation.