TORCH-Consortium / MAGMA

A pipeline for comprehensive genomic analyses of Mycobacterium tuberculosis with a focus on clinical decision making as well as research
https://doi.org/10.1371/journal.pcbi.1011648
GNU General Public License v3.0
13 stars 3 forks source link

Pipeline bug (MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ) #180

Closed vrennie closed 11 months ago

vrennie commented 1 year ago

Hi @abhi18av @TimHHH @mdediegofuertes ,

We seem to have a bug on the conda installation of the pipeline at this step.

Have any of you seen this issue before?

Tower link: https://tower.nf/orgs/TORCH/workspaces/XBS-Nextflow/watch/QF9gdgvapibJD

Thanks,

Vincent

vrennie commented 1 year ago

I discovered this after Simone from TB Public Health Ireland ran into this error running it on her linux machine:

[7d/310903] NOTE: Process MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ (joint) terminated with an error exit status (1) -- Execution is retried (1) ERROR ~ Error executing process > 'MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ (joint)'

Caused by: Process MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ (joint) terminated with an error exit status (1)

Command executed:

tb-profiler profile \ --db resistance_db_who \ --threads 4\ --vcf joint.lofreq.vcf.gz

Command exit status: 1

Command output: (empty)

Command error: Traceback (most recent call last): File "/home/simone/miniconda3/envs/magma-env-1/bin/tb-profiler", line 559, in args.func(args) File "/home/simone/miniconda3/envs/magma-env-1/bin/tb-profiler", line 84, in main_profile args.conf['variant_filters'] = pp.get_variant_filters(args) TypeError: 'NoneType' object does not support item assignment Cleaning up after failed run Exception ignored in atexit callback: <function cleanup at 0x7f9ce24ffc70> Traceback (most recent call last): File "/home/simone/miniconda3/envs/magma-env-1/bin/tb-profiler", line 38, in cleanup del args.conf['json_db'] TypeError: 'NoneType' object does not support item deletion

abhi18av commented 1 year ago

Mmm, it seems to indicate the absence of the custom WHO DB for tb-profiler 🤔

Are you sure that the custom DB was loaded in the relevant environment ? Here's what needs to be done https://github.com/TORCH-Consortium/MAGMA/blob/master/conda_envs/setup_conda_envs.sh

Otherwise, I'd suggest deleting the existing magma-env-1 and then using the setup_conda_envs.sh to create the environments

vrennie commented 1 year ago

Hi @abhi18av,

Issue appears to persists:

https://tower.nf/orgs/TORCH/workspaces/XBS-Nextflow/watch/5AJ7yPGUQOrbER

Error executing process > 'MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ (joint)'

Caused by: Process MINOR_VARIANTS_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ (joint) terminated with an error exit status (2)

Command executed:

tb-profiler profile \ --db resistance_db_who \ --threads 4\ --vcf joint.lofreq.vcf.gz

Command exit status: 2

Command output: (empty)

Command error: egrep: warning: egrep is obsolescent; using grep -E egrep: warning: egrep is obsolescent; using grep -E usage: tb-profiler profile [-h] [--read1 READ1] [--read2 READ2] [--bam BAM] [--platform {illumina,nanopore}] [--db DB] [--external_db EXTERNAL_DB] [--prefix PREFIX] [--dir DIR] [--csv] [--txt] [--pdf] [--add_columns ADD_COLUMNS] [--call_whole_genome] [--mapper {bwa,minimap2,bowtie2,bwa-mem2}] [--caller {bcftools,gatk,freebayes,pilon,lofreq}] [--calling_params CALLING_PARAMS] [--min_depth MIN_DEPTH] [--af AF] [--reporting_af REPORTING_AF] [--coverage_fraction_threshold COVERAGE_FRACTION_THRESHOLD] [--missing_cov_threshold MISSING_COV_THRESHOLD] [--suspect] [--no_trim] [--no_flagstat] [--no_clip] [--no_delly] [--threads THREADS] [--verbose {0,1,2}] [--version] [--no_cleanup] tb-profiler profile: error: one of the arguments --read1/-1 --bam/-a is required

abhi18av commented 12 months ago

Mmm, I think that it's best to start troubleshooting this from within the task's folder.

Could you please

  1. Activate the env manually (conda activate ... )
  2. Check the tb-profiler version

The surface area of investigation is still quite broad since we're not sure about the setup on the machine - is there an associated tower run?

vrennie commented 12 months ago

Hi Abhi,

I posted the tower link above but here it is again for reference:

https://tower.nf/orgs/TORCH/workspaces/XBS-Nextflow/watch/5AJ7yPGUQOrbER

abhi18av commented 12 months ago

Ah, whoops - sorry got lost in the logs above 😓

I see that its on the PBS cluster, so perhaps we can also cover this when we meet on 7th? I'll try to login and take a look before in any case.

vrennie commented 12 months ago

No worries, ok let's set it on the agenda. However, meeting will need to be rescheduled due to holidays in Spain.

TimHHH commented 12 months ago

The error log for this run list a strange error namely: tb-profiler profile: error: one of the arguments --read1/-1 --bam/-a is required I suggest executing the command on biomina directly, initially without PBS. I wonder if this has something to with the version of TBprofiler, it may be that older versions did not take the --vcf instead of the --read1/-1 --bam/-a. Just an idea.

abhi18av commented 11 months ago

Updating this issue after a meeting between @vrennie and @abhi18av today.

  1. The tb-profiler issue is arising on biomina due to failure of tb-profiler to load the resistance_db_who library during the creation of conda environments.
  2. We double checked on a different linux machine and there the resistance db library is successfully loaded 🤔
  3. As a result, we will update the docs to recommend container over conda based setup which is a bit more involved and requires users to setup the environment manually.
  4. On biomina @vrennie will explore the docker node setup that Tycho highlighted in February 2023.

Closing this issue as it'll be addressed via documentation and in the longer term, by transitioning to the nf-core standard.