lskatz / mashtree

:deciduous_tree: Create a tree using Mash distances
GNU General Public License v3.0
156 stars 24 forks source link

Mashtree::createTreeFromPhylip: Can't call method "as_text" on an undefined value #54

Closed karel-brinda closed 3 years ago

karel-brinda commented 4 years ago

Describe the bug I'm trying to compute a tree from precomputed sketches (sketches.tar.gz). I always get the following error (see also the full log.txt):

mashtree: mashDistance: Databasing distances (5/8, TID13)
mashtree: mashDistance: Waiting to join thread (6/8, TID14)
mashtree: mashDistance: Databasing distances (6/8, TID14)
mashtree: mashDistance: Waiting to join thread (7/8, TID15)
mashtree: mashDistance: Databasing distances (7/8, TID15)
mashtree: mashDistance: Waiting to join thread (8/8, TID16)
mashtree: mashDistance: Databasing distances (8/8, TID16)
mashtree: mashDistance: Converting to phylip format into /var/folders/5c/b4402v855qd5lf_dr0cj93gh0000gn/T/MASHTREE.YtCWcT/distances.phylip
mashtree: Mashtree::createTreeFromPhylip: Can't call method "as_text" on an undefined value 
Stopped at /Users/karel/miniconda/envs/mashtree/lib/site_perl/5.26.2/Mashtree.pm line 217.

Desktop (please complete the following information):

lskatz commented 4 years ago

This was a tough one but I think I have a potential reason, that they all seem to be named the same thing. They seem to be colliding with each other in the sqlite database.

[gzu2@monolith1 mashtree-help]$ \ls sketches/*.msh | xargs -n 1 mash info | grep '\.fa' | sort | uniq -c
     46   /well/iqbal/people/phelim/mash/tmp/1696.fa
     99   /well/iqbal/people/phelim/mash/tmp/1697.fa
    100   /well/iqbal/people/phelim/mash/tmp/1698.fa
    100   /well/iqbal/people/phelim/mash/tmp/1699.fa
     53   /well/iqbal/people/phelim/mash/tmp/1700.fa
karel-brinda commented 4 years ago

Great, thank you so much for figuring out what's going wrong! I thought Mashtree was using names of the actual files and had no idea that the original names are stored in the .msh files.