# Hclust2.py error

**URL:** <https://forum.biobakery.org/t/hclust2-py-error/5586>\
**Category:** MetaPhlAn\
**Created:** [July 4, 2023, 4:57am UTC](https://forum.biobakery.org/t/hclust2-py-error/5586 "2023-07-04T04:57:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yiming\_Zhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yiming_zhang/32/2282_2.png) [@Yiming\_Zhang](https://forum.biobakery.org/u/Yiming_Zhang)\
**Post date:** [July 4, 2023, 4:57am UTC](https://forum.biobakery.org/t/hclust2-py-error/5586/1 "2023-07-04T04:57:01Z")

</div>

Hello,  
I’m trying to analyze my merged abundance table with hclust2.py and get the following errors. Could you please advise on what I might be doing wrong?  
Thanks.

Traceback (most recent call last):  
File “/Share/home/lk/miniconda3/envs/hclust2/bin/hclust2.py”, line 825, in   
hclust2\_main()  
File “/Share/home/lk/miniconda3/envs/hclust2/bin/hclust2.py”, line 803, in hclust2\_main  
cl.shcluster()  
File “/Share/home/lk/miniconda3/envs/hclust2/bin/hclust2.py”, line 380, in shcluster  
self.shclusters = sph.linkage(self.s\_dm, method=self.args.slinkage)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/Share/home/lk/miniconda3/envs/hclust2/lib/python3.11/site-packages/scipy/cluster/hierarchy.py”, line 1068, in linkage  
n = int(distance.num\_obs\_y(y))  
^^^^^^^^^^^^^^^^^^^^^  
File “/Share/home/lk/miniconda3/envs/hclust2/lib/python3.11/site-packages/scipy/spatial/distance.py”, line 2564, in num\_obs\_y  
raise ValueError("The number of observations cannot be determined on "  
ValueError: The number of observations cannot be determined on an empty distance matrix.

The code is as follows:  
hclust2.py -i merged\_abundance\_table\_species.txt -o heatmap.log\_scale.png \   
–ftop 20 \   
–f\_dist\_f braycurtis \   
–s\_dist\_f braycurtis   
–cell\_aspect\_ratio 1.5   
–log\_scale   
–flabel\_size 4   
–legend\_file $output/${x}\_heatmap.log\_scale.legend.png   
–max\_flabel\_len 100   
–max\_slabel\_len 100   
–metadata\_height 0.075   
–minv 0.1   
–no\_slabels   
–dpi 300

The first few lines of the input file looks like:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/9/955019968bf68d723f97a324815cbbb37ede095b.png)

---

<div class="post-metadata">

**Author:** ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)\
**Post date:** [July 28, 2023, 2:37pm UTC](https://forum.biobakery.org/t/hclust2-py-error/5586/2 "2023-07-28T14:37:22Z")

</div>

Hi @Yiming_Zhang  
Could you share the merge profile so I can try to reproduce the error?
