jodyphelan / TBProfiler

Profiling tool for Mycobacterium tuberculosis to detect ressistance and strain type from WGS data
GNU General Public License v3.0
102 stars 42 forks source link

iTOL files not created #366

Open moks-micro opened 1 month ago

moks-micro commented 1 month ago

Hi Jody,

I've been running tbprofiler v6.2.1, and it doesn't seem to be creating any of the iTOL files when I run the collate command:

tb-profiler collate -p test_name

Am I missing something in the command ?

Thanks Simone

jodyphelan commented 1 month ago

Hey Simone!

You can add in --itol to the command. I thought i was the only one who used it so I took it out of the default settings, but maybe I'll but it back in the next version!

moks-micro commented 1 month ago

Thanks Jody!! We really like to use the itol files here :) The only problem when I use --itol is that it seems to have a problem if La1-3 lineages are present and wont create the itol files. It only works when I have lineages 1-5. Does this ever happen to you ?

(tbprofiler_6.2.1) simone@BioinformaticsWorkstation:~/Documents/tbprofiler6.2.1_validation/TBprofiler_6.2.1$ tb-profiler collate -p tbprofiler6.2.1_validation --itol [09:00:59] INFO Using ref file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.fasta db.py:587 INFO Using gff file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.gff db.py:587 INFO Using bed file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.bed db.py:587 INFO Using json_db file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.dr.json db.py:587 INFO Using variables file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.variables.json db.py:587 INFO Using spoligotype_spacers file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.spoligotype_spacers.txt db.py:587 INFO Using spoligotype_annotations file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.spoligotype_list.csv db.py:587 INFO Using bedmask file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.mask.bed db.py:587 INFO Using barcode file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.barcode.bed db.py:587 INFO Using rules file: /home/simone/miniconda3/envs/tbprofiler_6.2.1/share/tbprofiler//tbdb.rules.txt db.py:587 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 157/157 [00:00<00:00, 448.86it/s] Traceback (most recent call last): File "/home/simone/miniconda3/envs/tbprofiler_6.2.1/bin/tb-profiler", line 587, in args.func(args) File "/home/simone/miniconda3/envs/tbprofiler_6.2.1/bin/tb-profiler", line 273, in main_collate tbp.collate_results(args) File "/home/simone/miniconda3/envs/tbprofiler_6.2.1/lib/python3.10/site-packages/tbprofiler/collate.py", line 149, in collate_results generate_itol_config(rows,drugs,args.prefix) File "/home/simone/miniconda3/envs/tbprofiler_6.2.1/lib/python3.10/site-packages/tbprofiler/collate.py", line 178, in generate_itol_config writer.write(lineage_outfile) File "/home/simone/miniconda3/envs/tbprofiler_6.2.1/lib/python3.10/site-packages/itol_config/interfaces/colour_strip.py", line 33, in write O.write("%s\t%s\n" % (index,self.colour_lookup[value])) KeyError: 'La1' Cleaning up after failed run ERROR tb-profiler:59

                ################################# ERROR #######################################                                                             

                This run has failed. Please check all arguments and make sure all input files                                                               
                exist. If no solution is found, please open up an issue at                                                                                  
                https://github.com/jodyphelan/TBProfiler/issues/new and paste or attach the                                                                 
                contents of the error log (tbprofiler6.2.1_validation.errlog.txt)                                                                           
jodyphelan commented 1 month ago

Oh this looks like a bug. I'll run some tests.

abhi18av commented 3 weeks ago

Hi @jodyphelan ,

Ran across the same behavior, though for a specific sample - we'd like to reenable iTol for v2 of MAGMA and the error highlights Mcanetti for some reason. https://github.com/TORCH-Consortium/MAGMA/pull/197

  Traceback (most recent call last):
    File "/usr/local/bin/tb-profiler", line 583, in <module>
      args.func(args)
    File "/usr/local/bin/tb-profiler", line 269, in main_collate
      tbp.collate_results(args)
    File "/usr/local/lib/python3.10/site-packages/tbprofiler/collate.py", line 149, in collate_results
      generate_itol_config(rows,drugs,args.prefix)
    File "/usr/local/lib/python3.10/site-packages/tbprofiler/collate.py", line 178, in generate_itol_config
      writer.write(lineage_outfile)
    File "/usr/local/lib/python3.10/site-packages/itol_config/interfaces/colour_strip.py", line 33, in write
      O.write("%s\t%s\n" % (index,self.colour_lookup[value]))
  KeyError: 'M.canetti'
  Cleaning up after failed run
             ERROR                                                  tb-profiler:59

                      ################################# ERROR
                      #######################################

                      This run has failed. Please check all
                      arguments and make sure all input files
                      exist. If no solution is found, please open
                      up an issue at
                      https://github.com/jodyphelan/TBProfiler/issu
                      es/new and paste or attach the
                      contents of the error log
                      (joint.major_variants.errlog.txt)

                      #############################################
                      ##################################

CC @vrennie @mdediegofuertes