nf-core / sarek

Analysis pipeline to detect germline or somatic variants (pre-processing, variant calling and annotation) from WGS / targeted sequencing
https://nf-co.re/sarek
MIT License
361 stars 393 forks source link

Pipeline completed with errors : ControlFREEC #970

Closed Nour-EddineS closed 1 year ago

Nour-EddineS commented 1 year ago

Description of the bug

Dear SAREK Team, I want to use Somatic variant calling, but pipeline completed with errors. Thanks in advance for your help.

Best regards,

Command used and terminal output

nextflow run nf-core/sarek  --step variant_calling --input samplesheet.csv --outdir results/ --genome GATK.GRCh37 -profile docker --wes --intervals /home/user1/Target-panel/dataSet/data_run/tar_bla_cancer2.bed --tools cnvkit,controlfreec --only_paired_variant_calling true --max_cpus 7

-[nf-core/sarek] Pipeline completed with errors-
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC:FREEC_SOMATIC (tumor_3468_S15_1_vs_normal_3468_S15_1)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC:FREEC_SOMATIC (tumor_3468_S15_1_vs_normal_3468_S15_1)` terminated with an error exit status (1)

Command executed:

  touch config.txt

  echo "[general]" >> config.txt
  echo BedGraphOutput = TRUE >> config.txt
  echo breakPointThreshold = 1.2 >> config.txt
  echo breakPointType = 4 >> config.txt
  echo chrFiles =${PWD}/Chromosomes >> config.txt
  echo chrLenFile = ${PWD}/human_g1k_v37_decoy.fasta.fai >> config.txt
  echo coefficientOfVariation = 0.05 >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo forceGCcontentNormalization = 1 >> config.txt
  echo  >> config.txt
  echo gemMappabilityFile = ${PWD}/out100m2_hg19.gem >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo minimalSubclonePresence = 30 >> config.txt
  echo "maxThreads = 2" >> config.txt
  echo noisyData = TRUE >> config.txt
  echo  >> config.txt
  echo ploidy = 2 >> config.txt
  echo printNA = FALSE >> config.txt
  echo readCountThreshold = 50 >> config.txt
  echo sex = XY >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt

  echo "[control]" >> config.txt
  echo mateFile = ${PWD}/tumor_3468_S15_1_vs_normal_3468_S15_1.normal.mpileup.gz >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo inputFormat = pileup >> config.txt
  echo mateOrientation = FR >> config.txt

  echo "[sample]" >> config.txt
  echo mateFile = ${PWD}/tumor_3468_S15_1_vs_normal_3468_S15_1.tumor.mpileup.gz >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo inputFormat = pileup >> config.txt
  echo mateOrientation = FR >> config.txt

  echo "[BAF]" >> config.txt
  echo  >> config.txt
  echo fastaFile = ${PWD}/human_g1k_v37_decoy.fasta >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo  >> config.txt
  echo SNPfile = $PWD/dbsnp_138.b37.vcf.gz >> config.txt

  echo "[target]" >> config.txt
  echo captureRegions = tar_bla_cancer2.bed >> config.txt

  freec -conf config.txt

  cat <<-END_VERSIONS > versions.yml
  "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC:FREEC_SOMATIC":
      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:
  Control-FREEC v11.6 : a method for automatic detection of copy number alterations, subclones and for accurate estimation of contamination and main ploidy using deep-sequencing data
  Multi-threading mode using 2 threads
  ..consider the sample being male
  ..Breakpoint threshold for segmentation of copy number profiles is 1.2
  ..telocenromeric set to 50000
  ..FREEC is not going to adjust profiles for a possible contamination by normal cells
  ..Coefficient Of Variation set equal to 0.05
  ..it will be used to evaluate window size
  ..Output directory:   .
  ..Directory with files containing chromosome sequences:   Chromosomes
  ..Sample file:    tumor_3468_S15_1_vs_normal_3468_S15_1.tumor.mpileup.gz
  ..Sample input format:    pileup
  ..Control file:   tumor_3468_S15_1_vs_normal_3468_S15_1.normal.mpileup.gz
  ..Input format for the control file:  pileup
  ..forceGCcontentNormalization was set to 1: will use GC-content to normalize the read count data
  ..minimal expected GC-content (general parameter "minExpectedGC") was set to 0.35
  ..maximal expected GC-content (general parameter "maxExpectedGC") was set to 0.55
  ..Polynomial degree for "ReadCount ~ GC-content" normalization is 3 or 4: will try both
  ..Minimal CNA length (in windows) is 3
  ..File with chromosome lengths:   human_g1k_v37_decoy.fasta.fai
  ..File human_g1k_v37_decoy.fasta.fai was read

Command error:
  For example, you can remove chromosome GL000217.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000216.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000216.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000215.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000215.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000205.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000205.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000219.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000219.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000224.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000224.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000223.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000223.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000195.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000195.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000212.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000212.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000222.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000222.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000200.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000200.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000193.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000193.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000194.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000194.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000225.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000225.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome GL000192.1 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome GL000192.1 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome NC_007605 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome NC_007605 from your human_g1k_v37_decoy.fasta.fai
  Error: chromosome hs37d5 present in your human_g1k_v37_decoy.fasta.fai file was not detected in your file with capture regions tar_bla_cancer2.bed
  Please solve this issue and rerun Control-FREEC
  For example, you can remove chromosome hs37d5 from your human_g1k_v37_decoy.fasta.fai
  Will exit

Work dir:
  /home/user1/nf-core/work/95/aeb42ee48ac9481504cef7bbd311f2

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

Relevant files

nextflow.log samplesheet.csv tar_bla_cancer2.bed.tar.gz

System information

CPU: Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz RAM: 32 GB Distribution: Ubuntu 22.04.1 LTS

FriederikeHanssen commented 1 year ago

Hey! This is unfortunately a known issue, see here: https://github.com/BoevaLab/FREEC/issues/106. the current work around in the pipeline is to provide a len file using this parameter: https://nf-co.re/sarek/3.1.2/parameters#cf_chrom_len

Nour-EddineS commented 1 year ago

Dear @FriederikeHanssen, How can I create a len file please? Best regards,

FriederikeHanssen commented 1 year ago

If you click "Help" a description opens up:

Control-FREEC requires a file containing all chromosome lenghts. By default the fasta.fai is used. If the fasta.fai file contains chromosomes not present in the intervals, it fails (see: https://github.com/BoevaLab/FREEC/issues/106).

In this case, a custom chromosome length can be specified. It must be of the same format as the fai, but only contain the relevant chromosomes.

Example shown here (it is from a different genome build, so don't use this one): http://bioinfo-out.curie.fr/projects/freec/src/hg18.len

You can check your bed file, and then only keep the chromosomes from the fai of the genome build you are using that are also in the bed file. Then name it to something my_len.len and add it with the above parameter. To download the fai, either check your local igenomes installation if you ave it, or you can get from https://ewels.github.io/AWS-iGenomes/ here

FriederikeHanssen commented 1 year ago

Has this worked? If yes, could you close this issue?

Nour-EddineS commented 1 year ago

@FriederikeHanssen Yes it works Thanks :)