jodyphelan/TBProfiler

bcftools fails to find directory in /sctmp

svannib opened this issue · 1 comments

Hi Jody, i am trying to integrate tb-profiler 6.3.0 in our WGS pipeline, but i cannot get it to run as a standalone package. I have pulled the latest singularity image from bioconda and i get the following error message

Thank you very much
Vanni

tb-profiler error report

  • OS: linux
  • Program version: 6.3.0
  • Database version: {'name': 'tbdb', 'commit': '72ef6fa', 'Author': 'Jody Phelan jody.phelan@lshtm.ac.uk', 'Date': 'Tue Jul 16 16:56:19 2024 +0100', 'db-schema-version': '1.0.0'}
  • Program call:
{'logging': 'INFO', 'debug': False, 'read1': '2024187469_R1.fastq.gz', 'read2': '2024187469_R2.fastq.gz', 'bam': '/data/vbenve/playground/f248ea4c-e952-4736-a5f9-2f5537b1deaa.bam', 'fasta': None, 'vcf': None, 'platform': 'illumina', 'db': 'tbdb', 'external_db': None, 'prefix': '2024187469_', 'csv': False, 'txt': False, 'text_template': None, 'docx': False, 'docx_template': None, 'docx_plugin': None, 'add_columns': None, 'add_mutation_metadata': False, 'dir': '/data/vbenve/playground', 'depth': '0,10', 'af': '0,0.1', 'strand': '0,3', 'sv_depth': '0,10', 'sv_af': '0.5,0.9', 'sv_len': '100000,50000', 'mapper': 'bwa', 'caller': 'freebayes', 'calling_params': None, 'kmer_counter': 'kmc', 'coverage_tool': 'samtools', 'suspect': False, 'spoligotype': False, 'update_phylo': False, 'call_whole_genome': False, 'snp_dist': None, 'snp_diff_db': None, 'snp_diff_no_store': False, 'no_trim': False, 'no_coverage_qc': False, 'no_samclip': False, 'no_delly': False, 'no_lineage': False, 'add_variant_annotations': False, 'threads': 1, 'ram': 2, 'delly_vcf': None, 'supplementary_bam': None, 'no_clean': False, 'temp': '.', 'func': <function main_profile at 0x15453781fb00>, 'software_name': 'tbprofiler', 'version': '6.3.0', 'tmp_prefix': 'f248ea4c-e952-4736-a5f9-2f5537b1deaa', 'files_prefix': '/data/vbenve/playground/f248ea4c-e952-4736-a5f9-2f5537b1deaa', 'conf': {'db-schema-version': '1.0.0', 'snpEff_db': 'Mycobacterium_tuberculosis_h37rv', 'drugs': ['rifampicin', 'isoniazid', 'ethambutol', 'pyrazinamide', 'moxifloxacin', 'levofloxacin', 'bedaquiline', 'delamanid', 'pretomanid', 'linezolid', 'streptomycin', 'amikacin', 'kanamycin', 'capreomycin', 'clofazimine', 'ethionamide', 'para-aminosalicylic_acid', 'cycloserine'], 'tb-profiler-version': '>=6.0.0,<7.0.0', 'version': {'name': 'tbdb', 'commit': '72ef6fa', 'Author': 'Jody Phelan <jody.phelan@lshtm.ac.uk>', 'Date': 'Tue Jul 16 16:56:19 2024 +0100', 'db-schema-version': '1.0.0'}, 'amplicon': False, 'files': {'ref': 'tbdb.fasta', 'gff': 'tbdb.gff', 'bed': 'tbdb.bed', 'json_db': 'tbdb.dr.json', 'variables': 'tbdb.variables.json', 'spoligotype_spacers': 'tbdb.spoligotype_spacers.txt', 'spoligotype_annotations': 'tbdb.spoligotype_list.csv', 'bedmask': 'tbdb.mask.bed', 'barcode': 'tbdb.barcode.bed', 'rules': 'tbdb.rules.txt'}, 'ref': '/usr/local/share/tbprofiler//tbdb.fasta', 'gff': '/usr/local/share/tbprofiler//tbdb.gff', 'bed': '/usr/local/share/tbprofiler//tbdb.bed', 'variables': {'db-schema-version': '1.0.0', 'snpEff_db': 'Mycobacterium_tuberculosis_h37rv', 'drugs': ['rifampicin', 'isoniazid', 'ethambutol', 'pyrazinamide', 'moxifloxacin', 'levofloxacin', 'bedaquiline', 'delamanid', 'pretomanid', 'linezolid', 'streptomycin', 'amikacin', 'kanamycin', 'capreomycin', 'clofazimine', 'ethionamide', 'para-aminosalicylic_acid', 'cycloserine'], 'tb-profiler-version': '>=6.0.0,<7.0.0', 'version': {'name': 'tbdb', 'commit': '72ef6fa', 'Author': 'Jody Phelan <jody.phelan@lshtm.ac.uk>', 'Date': 'Tue Jul 16 16:56:19 2024 +0100', 'db-schema-version': '1.0.0'}, 'amplicon': False, 'files': {'ref': 'tbdb.fasta', 'gff': 'tbdb.gff', 'bed': 'tbdb.bed', 'json_db': 'tbdb.dr.json', 'variables': 'tbdb.variables.json', 'spoligotype_spacers': 'tbdb.spoligotype_spacers.txt', 'spoligotype_annotations': 'tbdb.spoligotype_list.csv', 'bedmask': 'tbdb.mask.bed', 'barcode': 'tbdb.barcode.bed', 'rules': 'tbdb.rules.txt'}}, 'spoligotype_spacers': '/usr/local/share/tbprofiler//tbdb.spoligotype_spacers.txt', 'spoligotype_annotations': '/usr/local/share/tbprofiler//tbdb.spoligotype_list.csv', 'bedmask': '/usr/local/share/tbprofiler//tbdb.mask.bed', 'barcode': '/usr/local/share/tbprofiler//tbdb.barcode.bed', 'rules': ['Variant(gene_name=mmpL5,type=lof) inactivates_resistance Variant(gene_name=mmpR5)', 'Variant(gene_name=eis,type=lof) inactivates_resistance Variant(gene_name=eis)'], 'variant_filters': {'depth_hard': 0, 'depth_soft': 10, 'af_hard': 0, 'af_soft': 0.1, 'strand_hard': 0, 'strand_soft': 3, 'sv_depth_hard': 0, 'sv_depth_soft': 10, 'sv_af_hard': 0.5, 'sv_af_soft': 0.9, 'sv_len_hard': 100000, 'sv_len_soft': 50000}}, 'plugins': {}, 'run_delly': True, 'samclip': True, 'coverage_qc': True, 'data_source': 'fastq', 'call_lineage': True}

Traceback:

  File "/usr/local/bin/tb-profiler", line 636, in <module>
    args.func(args)
  File "/usr/local/bin/tb-profiler", line 117, in main_profile
    variants_profile = pp.run_profiler(args)
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pathogenprofiler/cli.py", line 195, in run_profiler
    get_vcf_file(args)
  File "/usr/local/lib/python3.12/site-packages/pathogenprofiler/cli.py", line 177, in get_vcf_file
    args.vcf = get_vcf_from_bam(args)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pathogenprofiler/cli.py", line 160, in get_vcf_from_bam
    run_cmd("bcftools concat %s %s | bcftools sort -Oz -o %s" % (vcf_obj.filename,delly_vcf_obj.filename,final_target_vcf_file))
  File "/usr/local/lib/python3.12/site-packages/pathogenprofiler/utils.py", line 498, in run_cmd
    raise ValueError("Command Failed:\n%s\nstderr:\n%s" % (cmd,result.stderr.decode()))

Value:

Command Failed:
/bin/bash -c set -o pipefail; bcftools concat /data/vbenve/playground/f248ea4c-e952-4736-a5f9-2f5537b1deaa.short_variants.targets.vcf.gz /data/vbenve/playground/f248ea4c-e952-4736-a5f9-2f5537b1deaa.delly.targets.vcf.gz | bcftools sort -Oz -o /data/vbenve/playground/f248ea4c-e952-4736-a5f9-2f5537b1deaa.targets.vcf.gz
stderr:
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Checking the headers and starting positions of 2 files
mkdtemp(/sctmp/vbenve/bcftools.tzrlH5) failed: No such file or directory
[W::bcf_hdr_merge] Trying to combine "GQ" tag definitions of different types

If you change SINGULARITY_TMPDIR e.g. export SINGULARITY_TMPDIR=/path/to/somewhere/writeable does that work? I think I had a similar issue and this sorted it