jodyphelan / TBProfiler

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

Update tbdb with user-specified reference genome doesn’t work #351

Open ryanjameskennedy opened 5 months ago

ryanjameskennedy commented 5 months ago

I tried running the following given the GCF file provided by NCBI and it didn’t work:

singularity exec --bind /data depot.galaxyproject.org-singularity-tb-profiler-6.2.0--pyhdfd78af_1.img tb-profiler update_tbdb --match_ref /path/to/genomes/GCF_000195955.2.fasta --prefix converged_who_fohm_tbdb -d /path/to/tbdb/

Here is the error command:

                      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 242, in main_create_db                                                                                                                                                                                   
                        pp.create_db(args,extra_files=extra_files)                                                                                                                                                                                                     
                      File "/usr/local/lib/python3.10/site-packages/pathogenprofiler/db.py", line 537, in create_db                                                                                                                                                    
                        load_db(variables_file,args.software_name)                                                                                                                                                                                                     
                      File "/usr/local/lib/python3.10/site-packages/pathogenprofiler/db.py", line 555, in load_db                                                                                                                                                      
                        shutil.copyfile(source,target)                                                                                                                                                                                                                 
                      File "/usr/local/lib/python3.10/shutil.py", line 256, in copyfile                                                                                                                                                                                
                        with open(dst, 'wb') as fdst:                                                                                                                                                                                                                  
                    OSError: [Errno 30] Read-only file system: '/usr/local/share/tbprofiler/converged_who_fohm_tbdb.fasta'                                                                                                                                             
                    Cleaning up after failed run                                                                                                                                                                                                                       

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 211, in main_update_tbdb
    pp.run_cmd(f"tb-profiler create_db --prefix {args.prefix} --csv mutations.csv --watchlist watchlist.csv {extra_args} --load")
  File "/usr/local/lib/python3.10/site-packages/pathogenprofiler/utils.py", line 486, in run_cmd
    raise ValueError("Command Failed:\n%s\nstderr:\n%s" % (cmd,result.stderr.decode()))
ValueError: Command Failed:
/bin/bash -c set -o pipefail; tb-profiler create_db --prefix converged_who_fohm_tbdb --csv mutations.csv --watchlist watchlist.csv --rules rules.txt --match_ref /data/bnf/dev/ryan/jasen/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta --load
stderr:
Parsing mutations: 100%|██████████| 48797/48797 [00:37<00:00, 1289.28it/s]
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 242, in main_create_db
    pp.create_db(args,extra_files=extra_files)
  File "/usr/local/lib/python3.10/site-packages/pathogenprofiler/db.py", line 537, in create_db
    load_db(variables_file,args.software_name)
  File "/usr/local/lib/python3.10/site-packages/pathogenprofiler/db.py", line 555, in load_db
    shutil.copyfile(source,target)
  File "/usr/local/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
OSError: [Errno 30] Read-only file system: '/usr/local/share/tbprofiler/converged_who_fohm_tbdb.fasta'
Cleaning up after failed run
jodyphelan commented 3 months ago

Hi @ryanjameskennedy

Did we manage to fix this? Is this what we talked about on slack?