Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControlFREEC: Error in plot.window(...) : need finite 'ylim' values #993

Closed
hyjforesight opened this issue Apr 13, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@hyjforesight
Copy link

Description of the bug

Hello nf-core SAREK team,
I met controlfreec errors when I was running SAREK offline.
Here is the command I run:

nextflow run /home/hyjforesight/nf-core-sarek-3.1.2/workflow sarek --input /home/hyjforesight/Sarek_design_copy.csv --outdir /mnt/d/WES/ --genome GATK.GRCh38 -profile docker --tools freebayes,mutect2,strelka,manta,tiddit,cnvkit,controlfreec,snpeff,vep

Error message:

[nf-core/sarek] Pipeline completed with errors-
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_TUMOR_ONLY_ALL:BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC:MAKEGRAPH (C1033)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_TUMOR_ONLY_ALL:BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC:MAKEGRAPH (C1033)` terminated with an error exit status (1)

Command executed:

  cat $(which makeGraph.R) | R --slave --args 2 C1033.tumor.mpileup.gz_ratio.txt C1033.tumor.mpileup.gz_BAF.txt
  
  mv *_BAF.txt.png C1033_BAF.png
  mv *_ratio.txt.log2.png C1033_ratio.log2.png
  mv *_ratio.txt.png C1033_ratio.png
  
  cat <<-END_VERSIONS > versions.yml
  "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_TUMOR_ONLY_ALL:BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC:MAKEGRAPH":
      controlfreec: $(echo $(freec -version 2>&1) | sed 's/^.*Control-FREEC  //; s/:.*$//' | sed -e "s/Control-FREEC v//g" )
  END_VERSIONS

Command exit status:
  1

Command output:
  (empty)

Command error:
  Error in plot.window(...) : need finite 'ylim' values
  Calls: plot -> plot.default -> localWindow -> plot.window
  In addition: There were 17 warnings (use warnings() to see them)
  Execution halted

Work dir:
  /home/hyjforesight/work/73/248c092693a8d9612f76e8fb25e3d7

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

Could you please help me with this issue? Thank you in advance!

Command used and terminal output

$ nextflow run /home/hyjforesight/nf-core-sarek-3.1.2/workflow sarek --input /home/hyjforesight/Sarek_design_copy.csv --outdir /mnt/d/WES/ --genome GATK.GRCh38 -profile docker --tools freebayes,mutect2,strelka,manta,tiddit,cnvkit,controlfreec,snpeff,vep

Relevant files


nextflow (1).log

System information

Nextflow version: 22.10.6.5843
Hardware: Desktop
Executor: local
Container engine: Docker
OS: Win11 22H2, WSL2, Ubuntu 22.04
Version of nf-core/sarek: 3.1.2

@hyjforesight hyjforesight added the bug Something isn't working label Apr 13, 2023
@hyjforesight
Copy link
Author

hyjforesight commented Apr 13, 2023

Here are the responses from Thomas Danhorn and Friederike Hanssen
image
image

@FriederikeHanssen FriederikeHanssen changed the title Error in plot.window(...) : need finite 'ylim' values ControlFREEC: Error in plot.window(...) : need finite 'ylim' values Apr 13, 2023
@nschcolnicov
Copy link
Contributor

nschcolnicov commented Sep 12, 2023

Hi @hyjforesight , I encountered the same issue as you, in my case, the reason for it was that the ratio table being used by the makeGraph.R script contained values that, after applying the log2, would become NaN values. Neither the makeGraph.R nor the makeGraph2.0.R script are prepared to handle these values, so this triggers the "need finite 'ylim' values" when attempting to plot them. So I made some modifications to the makeGraph2.0.R script in order to address this.

To fix it you can do the following:

  1. Clone the sarek repo, checkout into master, and create a bin folder. Or checkout into dev that already has a bin folder. It works on both branches.
  2. Download the makeGraph2.0.R script from my branch: https://raw.githubusercontent.com/nschcolnicov/FREEC/Need_finite_ylim_values_fix/scripts/makeGraph2.0.R and place it in the bin folder.
  3. Update the makegraph main file so that it uses the updated script instead of the other one, you can find it in:
    sarek/modules/nf-core/controlfreec/makegraph/main.nf
    You must change the line 28: cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} to makeGraph2.0.R ${args} ${ratio} ${baf}

Let me know if you have any questions or if you fixed the issue some other way!

@FriederikeHanssen
Copy link
Contributor

We just updated the bioconda recipe with the Controlfreec release 11.6b that contains makegraph 2. Once it is available on biocontainers you can also use the container directly and in case we'll update the process for the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants