phac-nml / mob-suite

MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
Apache License 2.0
111 stars 31 forks source link

UnboundLocalError: local variable 'ETE3DBTAXAFILE' referenced before assignment #128

Closed gchalmer closed 1 year ago

gchalmer commented 1 year ago

Hello, I'm running mob_recon v3.1.2 in a clean conda environment, and am running into the following error:

2023-02-08 14:03:07,473 root INFO: Blasting contigs against reference sequence db: /home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/databases/ncbi_plasmid_full_seqs.fas [in /home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_recon.py:1261] 2023-02-08 14:04:27,720 root INFO: Filtering contig blast results: /home/gabhan/Desktop/09_MOBrecon/NR3CA-JPI-2018-265/__tmp/contig_blast_results.txt [in /home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_recon.py:1266] 2023-02-08 14:04:33,214 root INFO: Assigning contigs to plasmid groups [in /home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_recon.py:1281] 2023-02-08 14:04:46,385 root INFO: Writting contig results to /home/gabhan/Desktop/09_MOBrecon/NR3CA-JPI-2018-265/contig_report.txt [in /home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_recon.py:1383] Traceback (most recent call last): File "/home/gabhan/anaconda3/envs/mob_suite/bin/mob_recon", line 10, in sys.exit(main()) File "/home/gabhan/anaconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_recon.py", line 1396, in main build_mobtyper_report(contig_memberships['plasmid'], out_dir, mobtyper_report,contig_seqs, ncbi, lit,ETE3DBTAXAFILE) UnboundLocalError: local variable 'ETE3DBTAXAFILE' referenced before assignment

mob_recon stops running at this point, and leaves a "__tmp" folder with several files in it. I've noticed that there have been other posts about an ETE3 issue, but I'm not sure how to fix it. thanks in advance for any help you can offer!

longg2 commented 1 year ago

Hi @gchalmer,

I was having the same issue as you. Turns out it's a bug in v3.1.2 of the program. There's thankfully an easy fix: go to line 1031 of mob_recon.py and delete one of the tabs. It should look like what I've done in the screenshot below.

image

On the bright side, I only got this error when mob_recon found a plasmid in my samples. Happy hunting!

George

gchalmer commented 1 year ago

Yep, that fixed it. Thank you sir!

kbessonov1984 commented 1 year ago

This bug was also resolved in the most recent version of the tool (v3.1.4) and was also discussed in issue #127. Thank you for your support and feedback.