metaphlan_hclust_heatmap.py error

514 views
Skip to first unread message

Hiren Ghosh

unread,
Jul 9, 2018, 1:04:39 PM7/9/18
to MetaPhlAn-users
I tried to plot heatmap from merged metaphlan2 file but ended up with some error code. Can anyone help me out to find the error?


$metaphlan_hclust_heatmap.py -c bbcry --top 25 --minv 0.1 --in merged_abundance_table.txt --out abundance_heatmap.png

Traceback (most recent call last):
File "/home/hig18/anaconda3/envs/humann2/bin/metaphlan_hclust_heatmap.py", line 481, in <module>
tax_lev = pars['tax_lev']
File "/home/hig18/anaconda3/envs/humann2/bin/metaphlan_hclust_heatmap.py", line 435, in hclust
Y2 = sch.linkage( Dt, method=method, metric=dist_func )
File "/home/hig18/anaconda3/envs/humann2/lib/python2.7/site-packages/scipy/cluster/hierarchy.py", line 713, in linkage
raise ValueError("The condensed distance matrix must contain only "
ValueError: The condensed distance matrix must contain only finite values.

Francesco Asnicar

unread,
Jul 10, 2018, 12:14:41 PM7/10/18
to Hiren Ghosh, MetaPhlAn-users
Hi,

There is a problem with the latest scipy versions. To fix this (momentarily) you should downgrade scipy to the version 0.18.1 (or older), and in case you should get the following error:
>    ValueError: Linkage 'Z' uses the same cluster more than once.

You should add the "-m complete" parameter to the command.

Please, let me know if you managed to get the heatmap.


Many thanks,
Francesco

--
You received this message because you are subscribed to the Google Groups "MetaPhlAn-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metaphlan-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nathan Johnson

unread,
Sep 21, 2018, 2:35:41 PM9/21/18
to MetaPhlAn-users
Aside from Francesco's suggestion other ways I have successfully got around the error are:

1) use python 3 instead of python 2 (could be the scipy version is different between the two)
2) there are samples that have missing information or truncated
- merge step via merge_metaphlan_tables.py does not check this

Reply all
Reply to author
Forward
0 new messages