Pathogen-Genomics-Cymru / lodestone

Mycobacterial pipeline
GNU Affero General Public License v3.0
12 stars 3 forks source link

Singularity permissions error #53

Closed annacprice closed 2 months ago

annacprice commented 6 months ago


Caused by:
  Process `vcfpredict:tbprofiler (1)` terminated with an error exit status (1)

Command executed:

  bgzip SAMPLE_ID_allelic_depth.minos.vcf
  tb-profiler profile --vcf SAMPLE_ID_allelic_depth.minos.vcf.gz --threads 1
  mv results/tbprofiler.results.json SAMPLE_ID.tbprofiler-out.json

  cp SAMPLE_ID_report.json SAMPLE_ID_report_previous.json

  echo '{"complete":"workflow complete without error"}' | jq '.' > SAMPLE_ID_err.json

  jq -s ".[0] * .[1] * .[2]" SAMPLE_ID_err.json SAMPLE_ID_report_previous.json  SAMPLE_ID.tbprofiler-out.json > SAMPLE_ID_report.json

Command exit status:
  1

Command output:
  [00:05:44] INFO     Using ref file:                                    db.py:594
                      /opt/conda/share/tbprofiler//tbdb.fasta                     
             INFO     Using gff file:                                    db.py:594
                      /opt/conda/share/tbprofiler//tbdb.gff                       
             INFO     Using bed file:                                    db.py:594
                      /opt/conda/share/tbprofiler//tbdb.bed                       
             INFO     Using json_db file:                                db.py:594
                      /opt/conda/share/tbprofiler//tbdb.dr.json                   
             INFO     Using variables file:                              db.py:594
                      /opt/conda/share/tbprofiler//tbdb.variables.json            
             INFO     Using spoligotype_spacers file:                    db.py:594
                      /opt/conda/share/tbprofiler//tbdb.spoligotype_spac          
                      ers.txt                                                     
             INFO     Using spoligotype_annotations file:                db.py:594
                      /opt/conda/share/tbprofiler//tbdb.spoligotype_list          
                      .csv                                                        
             INFO     Using bedmask file:                                db.py:594
                      /opt/conda/share/tbprofiler//tbdb.mask.bed                  
             INFO     Using barcode file:                                db.py:594
                      /opt/conda/share/tbprofiler//tbdb.barcode.bed               
  [00:05:45] INFO     Running snpEff                                    vcf.py:119
  [00:05:47] ERROR    mkdtemp(/bcftools.p6luoZ) failed: Read-only     utils.py:391
                      file system                                                 

             ERROR                                                  tb-profiler:58

                      ################################# 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                                   
                      (tbprofiler.errlog.txt)                                     

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

Command error:
  Traceback (most recent call last):
    File "/opt/conda/bin/tb-profiler", line 562, in <module>
      args.func(args)
    File "/opt/conda/bin/tb-profiler", line 110, in main_profile
      results.update(pp.run_profiler(args))
    File "/opt/conda/lib/python3.10/site-packages/pathogenprofiler/cli.py", line 74, in run_profiler
      results = vcf_profiler(conf=args.conf,prefix=args.files_prefix,sample_name=args.prefix,vcf_file=args.vcf,delly_vcf_file=args.delly_vcf)
    File "/opt/conda/lib/python3.10/site-packages/pathogenprofiler/profiler.py", line 121, in vcf_profiler
      vcf_obj = vcf_obj.run_snpeff(conf["snpEff_db"],conf["ref"],conf["gff"],rename_chroms= conf.get("chromosome_conversion",None))
    File "/opt/conda/lib/python3.10/site-packages/pathogenprofiler/vcf.py", line 134, in run_snpeff
      run_cmd("bcftools view -c 1 -a %(filename)s | bcftools view -v snps | combine_vcf_variants.py --ref %(ref_file)s --gff %(gff_file)s | %(rename_cmd)s snpEff ann %(snpeff_data_dir_opt)s -noLog -noStats %(db)s - %(re_rename_cmd)s | bcftools sort -Oz -o %(tmp_file1)s && bcftools index %(tmp_file1)s" % vars(self))
    File "/opt/conda/lib/python3.10/site-packages/pathogenprofiler/utils.py", line 392, 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; bcftools view -c 1 -a bec971b8-a6c5-4d7b-8fc0-f4321e950049.targets.vcf.gz | bcftools view -v snps | combine_vcf_variants.py --ref /opt/conda/share/tbprofiler//tbdb.fasta --gff /opt/conda/share/tbprofiler//tbdb.gff | rename_vcf_chrom.py --source NC_000962.3 --target Chromosome | snpEff ann -dataDir /opt/conda/share/snpeff-5.2-0/data -noLog -noStats Mycobacterium_tuberculosis_h37rv - | rename_vcf_chrom.py --source Chromosome --target NC_000962.3 | bcftools sort -Oz -o 2e834baf-bbb5-41be-ba37-b6192ea6df35.vcf.gz && bcftools index 2e834baf-bbb5-41be-ba37-b6192ea6df35.vcf.gz
  stderr:
  mkdtemp(/bcftools.p6luoZ) failed: Read-only file system

  Cleaning up after failed run

Work dir:
  /home/ubuntu/data2/lodestone/work/63/cc1294a65c49c2fb547641964a5c48

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line```

===========================================
Finished with errors
annacprice commented 6 months ago

Seems to be related to running across multiple mounts

WhalleyT commented 2 months ago

It seems to be working now. I've had to re-write the container recipe to use the Ubuntu image with Docker written on top and change the path minimamba is installed to. Also I have modified $TMPDIR to be the current working directory as the container calls bcftools. I can't directly pass where I want the tmpdir to be becasue tb-profiler wraps it. Not sure this is the wisest way of doing it

WhalleyT commented 2 months ago

Added in README that users need to specify $TMPDIR or SINGULARITY_$TMPDIR then it works