epi2me-labs / wf-somatic-variation

Other
10 stars 5 forks source link

Error while running the wf #8

Closed assafgrw closed 8 months ago

assafgrw commented 10 months ago

Operating System

Ubuntu 22.04

Other Linux

No response

Workflow Version

v.0.4.0

Workflow Execution

EPI2ME Desktop application

EPI2ME Version

No response

CLI command run

No response

Workflow Execution - CLI Execution Profile

None

What happened?

WF stopped with an error after few hours some output files were generated

Relevant log output

I cant locate my logs but I have seen logs of other users with similar error: 
ERROR ~ Error executing process > 'snv:annotate_snv (1)'
Caused by:
  Process `snv:annotate_snv (1)` terminated with an error exit status (247)
Command executed:
  # deal with samples which aren't hg19 or hg38
  if [[ "hg38" != "hg38" ]] && [[ "hg38" != "hg19" ]]; then
      # return the original VCF and index as the outputs
      cp input.vcf.gz 142_6.wf_somatic-snv.vcf.gz
      cp input.vcf.gz.tbi 142_6.wf_somatic-snv.vcf.gz.tbi
      # create an empty snpEff_genes file
      touch 142_6.wf_somatic-snv.snpEff_genes.txt
      # create an empty ClinVar VCF
      touch 142_6.wf_somatic-snv_clinvar.vcf
  else
      # do some annotation
      if [[ "hg38" == "hg38" ]]; then
          snpeff_db="GRCh38.p13"
          clinvar_vcf="${CLINVAR_PATH}/clinvar_GRCh38.vcf.gz"

      elif [[ "hg38" == "hg19" ]]; then
          snpeff_db="GRCh37.p13"
          clinvar_vcf="${CLINVAR_PATH}/clinvar_GRCh37.vcf.gz"
      fi

      # Specify 4G of memory otherwise SnpEff will crash with the default 1G
      snpEff -Xmx4g ann $snpeff_db input.vcf.gz > 142_6.snpeff_annotated.vcf
      # Add ClinVar annotations
      SnpSift annotate $clinvar_vcf 142_6.snpeff_annotated.vcf > 142_6.wf_somatic-snv.vcf
      # Get the ClinVar-annotated variants into a separate VCF
      cat 142_6.wf_somatic-snv.vcf | SnpSift filter "( exists CLNSIG )" > 142_6.wf_somatic-snv_clinvar.vcf

      bgzip -c 142_6.wf_somatic-snv.vcf > 142_6.wf_somatic-snv.vcf.gz
      tabix 142_6.wf_somatic-snv.vcf.gz

      # tidy up
      rm 142_6.snpeff_annotated.vcf
      rm 142_6.wf_somatic-snv.vcf
      mv snpEff_genes.txt 142_6.wf_somatic-snv.snpEff_genes.txt
  fi
Command exit status:
  247
Command output:
  (empty)
Work dir:
  /home/access/epi2melabs/instances/wf-somatic-variation_a2df2c56-cef5-4e46-8c65-40028eec742e/work/f0/3cab426bd62af9f910e2f3d35c86ff
Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`
 -- Check '/home/access/epi2melabs/instances/wf-somatic-variation_a2df2c56-cef5-4e46-8c65-40028eec742e/nextflow.log' file for details

Application activity log entry

No response

RenzoTale88 commented 10 months ago

@assafgrw thank you for using wf-somatic-variation! I think that might be a sporadic out of memory issue. Could you try resuming the workflow and see if it succeed? If not, try as follow:

  1. clone the workflow git clone -b v0.4.0 https://github.com/epi2me-labs/wf-somatic-variation
  2. Change line 130 in modules/local/common.nf to increase the memory
  3. Change line 163 to use the same, or slightly lower, amount of memory

Let me know if any of these solutions fixes the issue.

Andrea

assafgrw commented 10 months ago

Thank you,

Would these changes take effect if ill run the wf from the GUI or do I need to run in via commmand line ?

RenzoTale88 commented 10 months ago

Apologies, you're right. If you are using the EPI2ME app, you can retry to rerun by:

  1. click on analyses
  2. choose the failed run
  3. click on retry analysis

If that fails, then you can apply the fix by editing the installed workflow. You can find the common.nf file in:

  1. In C:\\Users\INSERT USERNAME HERE\epi2melabs\workflow\epi2me-labs\wf-somatic-variation\modules\local\common.nf on windows
  2. In /Users/INSERT USERNAME HERE/epi2melabs/workflows/epi2me-labs/wf-somatic-variation/modules/local/common.nf on mac And edit following the same instructions above.
assafgrw commented 10 months ago

Thanks for the prompt replay again.

just to be sure, you suggest to make the changes you recommended in you first comment ("Change line 130 in modules/local/common.nf to increase the memory Change line 163 to use the same, or slightly lower, amount of memory) in the already installed file at the path you mentioed?

RenzoTale88 commented 10 months ago

Yes. This is line 131 (not 130, my bad) and this is line 163. You can increase the memory to a higher number and try again.

assafgrw commented 10 months ago

Thnanks again for the help.

It was not clear to me what changes to make in line 163: " snpEff -Xmx!{task.memory.giga}g ann $snpeff_db input.vcf.gz > !{params.sample_name}.snpeff_annotated.vcf"

for now I modified only line 131 from 4GB to 8GB and the same error occurred.

RenzoTale88 commented 10 months ago

@assafgrw could you try changing line 163 to:

snpEff -Xmx!{task.memory.giga - 2}g ann $snpeff_db input.vcf.gz > !{params.sample_name}.snpeff_annotated.vcf

and try again?

RenzoTale88 commented 9 months ago

@assafgrw any progress with this?

assafgrw commented 9 months ago

Hi and thatks for checking with me, no for now I am running the pipe-line one step at a time (first only SV flag, after mod flag etc.) and it work for me that way.

RenzoTale88 commented 9 months ago

Thanks for confirming that this seems to fix the issue. A patch will be applied in the next workflow release.

RenzoTale88 commented 9 months ago

@assafgrw this should now be fixed in version 0.5.0. Please let me know if you come across this issue again with the new release