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
400 stars 404 forks source link

Error while running ASCAT #1020

Open Nour-EddineS opened 1 year ago

Nour-EddineS commented 1 year ago

Description of the bug

Dear All,

I launched the variant calling step using the ASCAT tool, but I received an error message that I did not understand. Could you please help me resolve this issue?

I have attached a log file containing the executed command and the encountered error.

Thank you in advance for your help.

Best regards,

Command used and terminal output

nextflow run /home/NGS/nf-core/sarek  --step variant_calling --input /home/NGS/work/data_reel/nfcore2/results/csv/recalibrated.csv --outdir results/ --genome GATK.GRCh37 -profile docker --wes --intervals /home/NGS/work/data_reel/nfcore2/targeted.bed --tools ascat --only_paired_variant_calling true --max_cpus 7 --max_memory '31.GB'

N E X T F L O W  ~  version 22.10.7
Launching `/home/NGS/nf-core/sarek/main.nf` [voluminous_woese] DSL2 - revision: c2275107d1

------------------------------------------------------
                                        ,--./,-.
        ___     __   __   __   ___     /,-._.--~'
  |\ | |__  __ /  ` /  \ |__) |__         }  {
  | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                        `._,._,'
      ____
    .´ _  `.
   /  |\`-_ \      __        __   ___     
  |   | \  `-|    |__`  /\  |__) |__  |__/
   \ |   \  /     .__| /¯¯\ |  \ |___ |  \
    `|____\´

  nf-core/sarek v3.1.2
------------------------------------------------------
Core Nextflow options
  runName                    : voluminous_woese
  containerEngine            : docker
  launchDir                  : /home/NGS/work/data_reel/nfcore2
  workDir                    : /home/NGS/work/data_reel/nfcore2/work
  projectDir                 : /home/NGS/nf-core/sarek
  userName                   : NGS
  profile                    : docker
  configFiles                : /home/NGS/nf-core/sarek/nextflow.config

Input/output options
  step                       : variant_calling
  input                      : /home/NGS/work/data_reel/nfcore2/results/csv/recalibrated.csv
  outdir                     : results/

Main options
  wes                        : true
  intervals                  : /home/NGS/work/data_reel/nfcore2/targeted.bed
  tools                      : ascat

Variant Calling
  only_paired_variant_calling: true

Reference genome options
  genome                     : GATK.GRCh37
  ascat_genome               : hg19
  ascat_alleles              : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/G1000_alleles_hg19.zip
  ascat_loci                 : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/G1000_loci_hg19.zip
  ascat_loci_gc              : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/GC_G1000_hg19.zip
  ascat_loci_rt              : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/RT_G1000_hg19.zip
  bwa                        : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Sequence/BWAIndex/
  chr_dir                    : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Sequence/Chromosomes
  dbsnp                      : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/dbsnp_138.b37.vcf.gz
  dbsnp_tbi                  : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/dbsnp_138.b37.vcf.gz.tbi
  dbsnp_vqsr                 : --resource:dbsnp,known=false,training=true,truth=false,prior=2.0 dbsnp_138.b37.vcf.gz
  dict                       : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Sequence/WholeGenomeFasta/human_g1k_v37_decoy.dict
  fasta                      : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Sequence/WholeGenomeFasta/human_g1k_v37_decoy.fasta
  fasta_fai                  : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Sequence/WholeGenomeFasta/human_g1k_v37_decoy.fasta.fai
  germline_resource          : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/af-only-gnomad.raw.sites.vcf.gz
  germline_resource_tbi      : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/af-only-gnomad.raw.sites.vcf.gz.tbi
  known_indels               : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/{1000G_phase1,Mills_and_1000G_gold_standard}.indels.b37.vcf.gz
  known_indels_tbi           : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/{1000G_phase1,Mills_and_1000G_gold_standard}.indels.b37.vcf.gz.tbi
  known_indels_vqsr          : --resource:1000G,known=false,training=true,truth=true,prior=10.0 1000G_phase1.indels.b37.vcf.gz --resource:mills,known=false,training=true,truth=true,prior=10.0 Mills_and_1000G_gold_standard.indels.b37.vcf.gz
  known_snps                 : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/1000G_phase1.snps.high_confidence.b37.vcf.gz
  known_snps_tbi             : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/1000G_phase1.snps.high_confidence.b37.vcf.gz.tbi
  known_snps_vqsr            : --resource:1000G,known=false,training=true,truth=true,prior=10.0 1000G_phase1.snps.high_confidence.b37.vcf.gz
  mappability                : s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh37/Annotation/Control-FREEC/out100m2_hg19.gem
  snpeff_db                  : GRCh37.87
  snpeff_genome              : GRCh37
  snpeff_version             : 5.1
  vep_genome                 : GRCh37
  vep_species                : homo_sapiens
  vep_cache_version          : 106
  vep_version                : 106.1
  igenomes_base              : s3://ngi-igenomes/igenomes

Max job request options
  max_cpus                   : 7
  max_memory                 : 31.GB

!! Only displaying parameters that differ from the pipeline defaults !!
------------------------------------------------------
If you use nf-core/sarek for your analysis please cite:

* The pipeline
  https://doi.org/10.12688/f1000research.16665.2
  https://doi.org/10.5281/zenodo.4468605

* The nf-core framework
  https://doi.org/10.1038/s41587-020-0439-x

* Software dependencies
  https://github.com/nf-core/sarek/blob/master/CITATIONS.md
------------------------------------------------------
WARN: Default reference files not suited for running ASCAT on WES data. It's recommended to use the reference files provided here: https://github.com/Wedge-lab/battenberg#required-reference-files
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
executor >  local (1)
executor >  local (1)
executor >  local (2)
executor >  local (2)
executor >  local (2)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                            -
executor >  local (2)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                            -
executor >  local (2)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                            -
executor >  local (12)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:DRAGMAP_HASHTABLE                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:GATK4_CREATESEQUENCEDICTIONARY                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:MSISENSORPRO_SCAN                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:SAMTOOLS_FAIDX                                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_DBSNP                                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_GERMLINE_RESOURCE                                      -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_SNPS                                             -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_INDELS                                           -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_PON                                                    -
[ff/11e81c] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_ALLELES (G1000_alleles_hg19.zip)                       [100%] 1 of 1 ✔
[be/66776e] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_LOCI (G1000_loci_hg19.zip)                             [100%] 1 of 1 ✔
[12/9fce90] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_GC (GC_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[4b/1b42c5] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_RT (RT_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[eb/7924d9] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:CREATE_INTERVALS_BED (targeted.bed)                       [100%] 1 of 1 ✔
[e2/18b339] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:TABIX_BGZIPTABIX_INTERVAL_SPLIT (1_27022879-27024037)     [100%] 1 of 1 ✔
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_ANTITARGET                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_REFERENCE                                   -
[87/22306c] process > NFCORE_SAREK:SAREK:BAM_TO_CRAM (normal_HT1376_S5)                                              [100%] 4 of 4 ✔
[11/a4175d] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT ... [  0%] 0 of 2
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:BCFTOOLS_STATS                                     -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_COUNT                                -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_QUAL                                 -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_SUMMARY                                   -
[-        ] process > NFCORE_SAREK:SAREK:CUSTOM_DUMPSOFTWAREVERSIONS                                                 -
[-        ] process > NFCORE_SAREK:SAREK:MULTIQC                                                                     -
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)` terminated with an error exit status (1)

Command executed:

  #!/usr/bin/env Rscript
  library(RColorBrewer)
  library(ASCAT)
  options(bitmapType='cairo')

  #build prefixes: <abspath_to_files/prefix_chr>
  allele_path = normalizePath("G1000_alleles_hg19")
  allele_prefix = paste0(allele_path, "/", "G1000_alleles_hg19", "_chr")

  loci_path = normalizePath("G1000_loci_hg19")
  loci_prefix = paste0(loci_path, "/", "G1000_loci_hg19", "_chr")

  #prepare from BAM files
  ascat.prepareHTS(
      tumourseqfile = "tumor_HT1197_S4.converted.cram",
      normalseqfile = "normal_HT1197_S4.converted.cram",
      tumourname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour"),
      normalname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".normal"),
      allelecounter_exe = "alleleCounter",
      alleles.prefix = allele_prefix,
      loci.prefix = loci_prefix,
      gender = "XY",
      genomeVersion = "hg19",
      nthreads = 6
      ,minCounts = 10
      ,BED_file = 'targeted.bed'
      ,chrom_names = c(1:22, 'X', 'Y')
      ,min_base_qual = 20
      ,min_map_qual = 35
      ,ref.fasta = 'human_g1k_v37_decoy.fasta'

  )

  #Load the data
  ascat.bc = ascat.loadData(
      Tumor_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourLogR.txt"),
      Tumor_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourBAF.txt"),
      Germline_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalLogR.txt"),
      Germline_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalBAF.txt"),
      genomeVersion = "hg19",
      gender = "XY"
  )

  #Plot the raw data
  ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".before_correction."))

  # optional LogRCorrection
  if("GC_G1000_hg19" != "NULL") {
      gc_input = paste0(normalizePath("GC_G1000_hg19"), "/", "GC_G1000_hg19", ".txt")

      if("RT_G1000_hg19" != "NULL"){
          rt_input = paste0(normalizePath("RT_G1000_hg19"), "/", "RT_G1000_hg19", ".txt")
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = rt_input)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc_rt."))
      }
      else {
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = RT_G1000_hg19)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc."))
      }
  }

  #Segment the data
  ascat.bc = ascat.aspcf(ascat.bc)

  #Plot the segmented data
  ascat.plotSegmentedData(ascat.bc)

  #Run ASCAT to fit every tumor to a model, inferring ploidy, normal cell contamination, and discrete copy numbers
  #If psi and rho are manually set:
  if (!is.null(NULL) && !is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL, psi_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=NULL)
  } else {
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1)
  }

  #Extract metrics from ASCAT profiles
  QC = ascat.metrics(ascat.bc,ascat.output)

  #Write out segmented regions (including regions with one copy of each allele)
  write.table(ascat.output[["segments"]], file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".segments.txt"), sep="    ", quote=F, row.names=F)

  #Write out CNVs in bed format
  cnvs=ascat.output[["segments"]][2:6]
  write.table(cnvs, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".cnvs.txt"), sep="   ", quote=F, row.names=F, col.names=T)

  #Write out purity and ploidy info
  summary <- tryCatch({
          matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) {
              # error handler picks up where error was generated
              print(paste("Could not find optimal solution:  ",err))
              return(matrix(c(0,0),nrow=1,ncol=2,byrow = TRUE))
      }
  )
  colnames(summary) <- c("AberrantCellFraction","Ploidy")
  write.table(summary, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".purityploidy.txt"), sep="    ", quote=F, row.names=F, col.names=T)

  write.table(QC, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".metrics.txt"), sep=" ", quote=F, row.names=F)

  # version export
  f <- file("versions.yml","w")
  alleleCounter_version = system(paste("alleleCounter --version"), intern = T)
  ascat_version = sessionInfo()$otherPkgs$ASCAT$Version
  writeLines(paste0('"', "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT", '"', ":"), f)
  writeLines(paste("    alleleCounter:", alleleCounter_version), f)
  writeLines(paste("    ascat:", ascat_version), f)
  close(f)

Command exit status:
  1

Command output:
  (empty)

Command error:
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
executor >  local (12)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:DRAGMAP_HASHTABLE                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:GATK4_CREATESEQUENCEDICTIONARY                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:MSISENSORPRO_SCAN                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:SAMTOOLS_FAIDX                                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_DBSNP                                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_GERMLINE_RESOURCE                                      -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_SNPS                                             -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_INDELS                                           -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_PON                                                    -
[ff/11e81c] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_ALLELES (G1000_alleles_hg19.zip)                       [100%] 1 of 1 ✔
[be/66776e] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_LOCI (G1000_loci_hg19.zip)                             [100%] 1 of 1 ✔
[12/9fce90] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_GC (GC_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[4b/1b42c5] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_RT (RT_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[eb/7924d9] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:CREATE_INTERVALS_BED (targeted.bed)                       [100%] 1 of 1 ✔
[e2/18b339] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:TABIX_BGZIPTABIX_INTERVAL_SPLIT (1_27022879-27024037)     [100%] 1 of 1 ✔
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_ANTITARGET                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_REFERENCE                                   -
[87/22306c] process > NFCORE_SAREK:SAREK:BAM_TO_CRAM (normal_HT1376_S5)                                              [100%] 4 of 4 ✔
[1f/a0ce39] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT ... [ 50%] 1 of 2, failed: 1
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:BCFTOOLS_STATS                                     -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_COUNT                                -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_QUAL                                 -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_SUMMARY                                   -
[-        ] process > NFCORE_SAREK:SAREK:CUSTOM_DUMPSOFTWAREVERSIONS                                                 -
[-        ] process > NFCORE_SAREK:SAREK:MULTIQC                                                                     -
Execution cancelled -- Finishing pending tasks before exit
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)` terminated with an error exit status (1)

Command executed:

  #!/usr/bin/env Rscript
  library(RColorBrewer)
  library(ASCAT)
  options(bitmapType='cairo')

  #build prefixes: <abspath_to_files/prefix_chr>
  allele_path = normalizePath("G1000_alleles_hg19")
  allele_prefix = paste0(allele_path, "/", "G1000_alleles_hg19", "_chr")

  loci_path = normalizePath("G1000_loci_hg19")
  loci_prefix = paste0(loci_path, "/", "G1000_loci_hg19", "_chr")

  #prepare from BAM files
  ascat.prepareHTS(
      tumourseqfile = "tumor_HT1197_S4.converted.cram",
      normalseqfile = "normal_HT1197_S4.converted.cram",
      tumourname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour"),
      normalname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".normal"),
      allelecounter_exe = "alleleCounter",
      alleles.prefix = allele_prefix,
      loci.prefix = loci_prefix,
      gender = "XY",
      genomeVersion = "hg19",
      nthreads = 6
      ,minCounts = 10
      ,BED_file = 'targeted.bed'
      ,chrom_names = c(1:22, 'X', 'Y')
      ,min_base_qual = 20
      ,min_map_qual = 35
      ,ref.fasta = 'human_g1k_v37_decoy.fasta'

  )

  #Load the data
  ascat.bc = ascat.loadData(
      Tumor_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourLogR.txt"),
      Tumor_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourBAF.txt"),
      Germline_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalLogR.txt"),
      Germline_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalBAF.txt"),
      genomeVersion = "hg19",
      gender = "XY"
  )

  #Plot the raw data
  ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".before_correction."))

  # optional LogRCorrection
  if("GC_G1000_hg19" != "NULL") {
      gc_input = paste0(normalizePath("GC_G1000_hg19"), "/", "GC_G1000_hg19", ".txt")

      if("RT_G1000_hg19" != "NULL"){
          rt_input = paste0(normalizePath("RT_G1000_hg19"), "/", "RT_G1000_hg19", ".txt")
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = rt_input)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc_rt."))
      }
      else {
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = RT_G1000_hg19)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc."))
      }
  }

  #Segment the data
  ascat.bc = ascat.aspcf(ascat.bc)

  #Plot the segmented data
  ascat.plotSegmentedData(ascat.bc)

  #Run ASCAT to fit every tumor to a model, inferring ploidy, normal cell contamination, and discrete copy numbers
  #If psi and rho are manually set:
  if (!is.null(NULL) && !is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL, psi_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=NULL)
  } else {
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1)
  }

  #Extract metrics from ASCAT profiles
  QC = ascat.metrics(ascat.bc,ascat.output)

  #Write out segmented regions (including regions with one copy of each allele)
  write.table(ascat.output[["segments"]], file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".segments.txt"), sep="    ", quote=F, row.names=F)

  #Write out CNVs in bed format
  cnvs=ascat.output[["segments"]][2:6]
  write.table(cnvs, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".cnvs.txt"), sep="   ", quote=F, row.names=F, col.names=T)

  #Write out purity and ploidy info
  summary <- tryCatch({
          matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) {
              # error handler picks up where error was generated
              print(paste("Could not find optimal solution:  ",err))
              return(matrix(c(0,0),nrow=1,ncol=2,byrow = TRUE))
      }
  )
  colnames(summary) <- c("AberrantCellFraction","Ploidy")
  write.table(summary, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".purityploidy.txt"), sep="    ", quote=F, row.names=F, col.names=T)

  write.table(QC, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".metrics.txt"), sep=" ", quote=F, row.names=F)

  # version export
  f <- file("versions.yml","w")
  alleleCounter_version = system(paste("alleleCounter --version"), intern = T)
  ascat_version = sessionInfo()$otherPkgs$ASCAT$Version
  writeLines(paste0('"', "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT", '"', ":"), f)
  writeLines(paste("    alleleCounter:", alleleCounter_version), f)
  writeLines(paste("    ascat:", ascat_version), f)
  close(f)

Command exit status:
  1

Command output:
  (empty)

Command error:
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
executor >  local (12)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:DRAGMAP_HASHTABLE                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:GATK4_CREATESEQUENCEDICTIONARY                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:MSISENSORPRO_SCAN                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:SAMTOOLS_FAIDX                                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_DBSNP                                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_GERMLINE_RESOURCE                                      -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_SNPS                                             -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_INDELS                                           -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_PON                                                    -
[ff/11e81c] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_ALLELES (G1000_alleles_hg19.zip)                       [100%] 1 of 1 ✔
[be/66776e] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_LOCI (G1000_loci_hg19.zip)                             [100%] 1 of 1 ✔
[12/9fce90] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_GC (GC_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[4b/1b42c5] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_RT (RT_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[eb/7924d9] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:CREATE_INTERVALS_BED (targeted.bed)                       [100%] 1 of 1 ✔
[e2/18b339] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:TABIX_BGZIPTABIX_INTERVAL_SPLIT (1_27022879-27024037)     [100%] 1 of 1 ✔
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_ANTITARGET                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_REFERENCE                                   -
[87/22306c] process > NFCORE_SAREK:SAREK:BAM_TO_CRAM (normal_HT1376_S5)                                              [100%] 4 of 4 ✔
[11/a4175d] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT ... [100%] 2 of 2, failed: 2 ✘
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:BCFTOOLS_STATS                                     -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_COUNT                                -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_QUAL                                 -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_SUMMARY                                   -
[-        ] process > NFCORE_SAREK:SAREK:CUSTOM_DUMPSOFTWAREVERSIONS                                                 -
[-        ] process > NFCORE_SAREK:SAREK:MULTIQC                                                                     -
Execution cancelled -- Finishing pending tasks before exit
-[nf-core/sarek] Pipeline completed with errors-
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)` terminated with an error exit status (1)

Command executed:

  #!/usr/bin/env Rscript
  library(RColorBrewer)
  library(ASCAT)
  options(bitmapType='cairo')

  #build prefixes: <abspath_to_files/prefix_chr>
  allele_path = normalizePath("G1000_alleles_hg19")
  allele_prefix = paste0(allele_path, "/", "G1000_alleles_hg19", "_chr")

  loci_path = normalizePath("G1000_loci_hg19")
  loci_prefix = paste0(loci_path, "/", "G1000_loci_hg19", "_chr")

  #prepare from BAM files
  ascat.prepareHTS(
      tumourseqfile = "tumor_HT1197_S4.converted.cram",
      normalseqfile = "normal_HT1197_S4.converted.cram",
      tumourname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour"),
      normalname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".normal"),
      allelecounter_exe = "alleleCounter",
      alleles.prefix = allele_prefix,
      loci.prefix = loci_prefix,
      gender = "XY",
      genomeVersion = "hg19",
      nthreads = 6
      ,minCounts = 10
      ,BED_file = 'targeted.bed'
      ,chrom_names = c(1:22, 'X', 'Y')
      ,min_base_qual = 20
      ,min_map_qual = 35
      ,ref.fasta = 'human_g1k_v37_decoy.fasta'

  )

  #Load the data
  ascat.bc = ascat.loadData(
      Tumor_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourLogR.txt"),
      Tumor_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourBAF.txt"),
      Germline_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalLogR.txt"),
      Germline_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalBAF.txt"),
      genomeVersion = "hg19",
      gender = "XY"
  )

  #Plot the raw data
  ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".before_correction."))

  # optional LogRCorrection
  if("GC_G1000_hg19" != "NULL") {
      gc_input = paste0(normalizePath("GC_G1000_hg19"), "/", "GC_G1000_hg19", ".txt")

      if("RT_G1000_hg19" != "NULL"){
          rt_input = paste0(normalizePath("RT_G1000_hg19"), "/", "RT_G1000_hg19", ".txt")
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = rt_input)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc_rt."))
      }
      else {
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = RT_G1000_hg19)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc."))
      }
  }

  #Segment the data
  ascat.bc = ascat.aspcf(ascat.bc)

  #Plot the segmented data
  ascat.plotSegmentedData(ascat.bc)

  #Run ASCAT to fit every tumor to a model, inferring ploidy, normal cell contamination, and discrete copy numbers
  #If psi and rho are manually set:
  if (!is.null(NULL) && !is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL, psi_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=NULL)
  } else {
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1)
  }

  #Extract metrics from ASCAT profiles
  QC = ascat.metrics(ascat.bc,ascat.output)

  #Write out segmented regions (including regions with one copy of each allele)
  write.table(ascat.output[["segments"]], file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".segments.txt"), sep="    ", quote=F, row.names=F)

  #Write out CNVs in bed format
  cnvs=ascat.output[["segments"]][2:6]
  write.table(cnvs, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".cnvs.txt"), sep="   ", quote=F, row.names=F, col.names=T)

  #Write out purity and ploidy info
  summary <- tryCatch({
          matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) {
              # error handler picks up where error was generated
              print(paste("Could not find optimal solution:  ",err))
              return(matrix(c(0,0),nrow=1,ncol=2,byrow = TRUE))
      }
  )
  colnames(summary) <- c("AberrantCellFraction","Ploidy")
  write.table(summary, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".purityploidy.txt"), sep="    ", quote=F, row.names=F, col.names=T)

  write.table(QC, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".metrics.txt"), sep=" ", quote=F, row.names=F)

  # version export
  f <- file("versions.yml","w")
  alleleCounter_version = system(paste("alleleCounter --version"), intern = T)
  ascat_version = sessionInfo()$otherPkgs$ASCAT$Version
  writeLines(paste0('"', "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT", '"', ":"), f)
  writeLines(paste("    alleleCounter:", alleleCounter_version), f)
  writeLines(paste("    ascat:", ascat_version), f)
  close(f)

Command exit status:
  1

Command output:
  (empty)

Command error:
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
executor >  local (12)
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM2_INDEX                                                -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:DRAGMAP_HASHTABLE                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:GATK4_CREATESEQUENCEDICTIONARY                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:MSISENSORPRO_SCAN                                            -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:SAMTOOLS_FAIDX                                               -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_DBSNP                                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_GERMLINE_RESOURCE                                      -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_SNPS                                             -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_KNOWN_INDELS                                           -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:TABIX_PON                                                    -
[ff/11e81c] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_ALLELES (G1000_alleles_hg19.zip)                       [100%] 1 of 1 ✔
[be/66776e] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_LOCI (G1000_loci_hg19.zip)                             [100%] 1 of 1 ✔
[12/9fce90] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_GC (GC_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[4b/1b42c5] process > NFCORE_SAREK:SAREK:PREPARE_GENOME:UNZIP_RT (RT_G1000_hg19.zip)                                 [100%] 1 of 1 ✔
[eb/7924d9] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:CREATE_INTERVALS_BED (targeted.bed)                       [100%] 1 of 1 ✔
[e2/18b339] process > NFCORE_SAREK:SAREK:PREPARE_INTERVALS:TABIX_BGZIPTABIX_INTERVAL_SPLIT (1_27022879-27024037)     [100%] 1 of 1 ✔
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_ANTITARGET                                  -
[-        ] process > NFCORE_SAREK:SAREK:PREPARE_REFERENCE_CNVKIT:CNVKIT_REFERENCE                                   -
[87/22306c] process > NFCORE_SAREK:SAREK:BAM_TO_CRAM (normal_HT1376_S5)                                              [100%] 4 of 4 ✔
[11/a4175d] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT ... [100%] 2 of 2, failed: 2 ✘
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:BCFTOOLS_STATS                                     -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_COUNT                                -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_TSTV_QUAL                                 -
[-        ] process > NFCORE_SAREK:SAREK:VCF_QC_BCFTOOLS_VCFTOOLS:VCFTOOLS_SUMMARY                                   -
[-        ] process > NFCORE_SAREK:SAREK:CUSTOM_DUMPSOFTWAREVERSIONS                                                 -
[-        ] process > NFCORE_SAREK:SAREK:MULTIQC                                                                     -
Execution cancelled -- Finishing pending tasks before exit
-[nf-core/sarek] Pipeline completed with errors-
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (tumor_HT1197_S4_vs_normal_HT1197_S4)` terminated with an error exit status (1)

Command executed:

  #!/usr/bin/env Rscript
  library(RColorBrewer)
  library(ASCAT)
  options(bitmapType='cairo')

  #build prefixes: <abspath_to_files/prefix_chr>
  allele_path = normalizePath("G1000_alleles_hg19")
  allele_prefix = paste0(allele_path, "/", "G1000_alleles_hg19", "_chr")

  loci_path = normalizePath("G1000_loci_hg19")
  loci_prefix = paste0(loci_path, "/", "G1000_loci_hg19", "_chr")

  #prepare from BAM files
  ascat.prepareHTS(
      tumourseqfile = "tumor_HT1197_S4.converted.cram",
      normalseqfile = "normal_HT1197_S4.converted.cram",
      tumourname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour"),
      normalname = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".normal"),
      allelecounter_exe = "alleleCounter",
      alleles.prefix = allele_prefix,
      loci.prefix = loci_prefix,
      gender = "XY",
      genomeVersion = "hg19",
      nthreads = 6
      ,minCounts = 10
      ,BED_file = 'targeted.bed'
      ,chrom_names = c(1:22, 'X', 'Y')
      ,min_base_qual = 20
      ,min_map_qual = 35
      ,ref.fasta = 'human_g1k_v37_decoy.fasta'

  )

  #Load the data
  ascat.bc = ascat.loadData(
      Tumor_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourLogR.txt"),
      Tumor_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_tumourBAF.txt"),
      Germline_LogR_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalLogR.txt"),
      Germline_BAF_file = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".tumour_normalBAF.txt"),
      genomeVersion = "hg19",
      gender = "XY"
  )

  #Plot the raw data
  ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".before_correction."))

  # optional LogRCorrection
  if("GC_G1000_hg19" != "NULL") {
      gc_input = paste0(normalizePath("GC_G1000_hg19"), "/", "GC_G1000_hg19", ".txt")

      if("RT_G1000_hg19" != "NULL"){
          rt_input = paste0(normalizePath("RT_G1000_hg19"), "/", "RT_G1000_hg19", ".txt")
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = rt_input)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc_rt."))
      }
      else {
          ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = RT_G1000_hg19)
          #Plot raw data after correction
          ascat.plotRawData(ascat.bc, img.prefix = paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".after_correction_gc."))
      }
  }

  #Segment the data
  ascat.bc = ascat.aspcf(ascat.bc)

  #Plot the segmented data
  ascat.plotSegmentedData(ascat.bc)

  #Run ASCAT to fit every tumor to a model, inferring ploidy, normal cell contamination, and discrete copy numbers
  #If psi and rho are manually set:
  if (!is.null(NULL) && !is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL, psi_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, rho_manual=NULL)
  } else if(!is.null(NULL) && is.null(NULL)){
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1, psi_manual=NULL)
  } else {
      ascat.output <- ascat.runAscat(ascat.bc, gamma=1)
  }

  #Extract metrics from ASCAT profiles
  QC = ascat.metrics(ascat.bc,ascat.output)

  #Write out segmented regions (including regions with one copy of each allele)
  write.table(ascat.output[["segments"]], file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".segments.txt"), sep="    ", quote=F, row.names=F)

  #Write out CNVs in bed format
  cnvs=ascat.output[["segments"]][2:6]
  write.table(cnvs, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".cnvs.txt"), sep="   ", quote=F, row.names=F, col.names=T)

  #Write out purity and ploidy info
  summary <- tryCatch({
          matrix(c(ascat.output[["aberrantcellfraction"]], ascat.output[["ploidy"]]), ncol=2, byrow=TRUE)}, error = function(err) {
              # error handler picks up where error was generated
              print(paste("Could not find optimal solution:  ",err))
              return(matrix(c(0,0),nrow=1,ncol=2,byrow = TRUE))
      }
  )
  colnames(summary) <- c("AberrantCellFraction","Ploidy")
  write.table(summary, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4",".purityploidy.txt"), sep="    ", quote=F, row.names=F, col.names=T)

  write.table(QC, file=paste0("tumor_HT1197_S4_vs_normal_HT1197_S4", ".metrics.txt"), sep=" ", quote=F, row.names=F)

  # version export
  f <- file("versions.yml","w")
  alleleCounter_version = system(paste("alleleCounter --version"), intern = T)
  ascat_version = sessionInfo()$otherPkgs$ASCAT$Version
  writeLines(paste0('"', "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT", '"', ":"), f)
  writeLines(paste("    alleleCounter:", alleleCounter_version), f)
  writeLines(paste("    ascat:", ascat_version), f)
  close(f)

Command exit status:
  1

Command output:
  (empty)

Command error:
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Reading locis
  Done reading locis
  Multi pos start:
  [E::sam_itr_next] Null iterator
  [ERROR] (src/bam_access.c: bam_access_get_multi_position_base_counts:379 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
  [ERROR] (./src/alleleCounter.c: main:432 errno: None) Error scanning through bam file for loci list with dense snps.
  munmap_chunk(): invalid pointer
  Error in { : task 1 failed - "EXIT_CODE == 0 is not TRUE"
  Calls: ascat.prepareHTS -> %dopar% -> <Anonymous>
  Execution halted

Work dir:
  /home/NGS/work/data_reel/nfcore2/work/1f/a0ce397d8fbaf666756097e1485aa1

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

System information

No response

Nour-EddineS commented 1 year ago

@tucano @ypriverol @alaindomissy @dfornika Any help would be greatly appreciated.

FriederikeHanssen commented 1 year ago

Can you try generating the ascat reference files as descirbed here: https://nf-co.re/sarek/dev/usage#how-to-run-ascat-with-whole-exome-sequencing-data the default ref files for ASCAT are only suitable for WGS data

Nour-EddineS commented 1 year ago

Dear @FriederikeHanssen, I recently attempted to generate the ascat reference files as described. However, I noticed that the demonstration provided was applied to reference genome 38, while I am working with reference genome 19 (hg19). I tried adapting the example to the hg19 reference, but starting from step 3, I couldn't find the "1kg.phase3.v5a_GRCh38nounref_loci_chr${i}.txt" files relevant to my hg19 reference.

I would appreciate your assistance in this matter. Could you please guide me on how to obtain the appropriate files adapted to the hg19 reference?

Thank you in advance for your help.

Best regards,

FriederikeHanssen commented 1 year ago

see here for the battenberg hg19 files: https://ora.ox.ac.uk/objects/uuid:2c1fec09-a504-49ab-9ce9-3f17bac531bc (The link is described in the Battenberg hg38 header)

Nour-EddineS commented 1 year ago

Dear @FriederikeHanssen,

Indeed, this is the website from which I downloaded the hg19-related data, but I realized that I am unable to find the files titled "1kg.phase3.v5a_GRCh38nounref_loci_chr${i}.txt". I have conducted several extensive searches, but unfortunately, I have been unable to locate them.

Could you please indicate where I can find these specific files or provide me with additional information regarding their availability ?

Best regards,

FriederikeHanssen commented 1 year ago

@ameynert did you by chance also ran this already for hg19 and can help?

ameynert commented 1 year ago

Sorry @FriederikeHanssen - I did not.

paolo-kunderfranco commented 1 year ago

Dear all, I am facing a similar error. I am using the sarek dev version, prepared ASCAT reference as mentioned here https://nf-co.re/sarek/dev/usage

I run the command as follow nextflow run nf-core/sarek --input $wd/paired.csv --outdir $wd/paired --step variant_calling \ --genome GATK.GRCh38 --only_paired_variant_calling TRUE \ --wes TRUE \ --tools ascat -profile singularity \ -c $wd/nextflow.config -r dev \ --intervals $wd/ref/targets_with_chr.bed \ --ascat_alleles $wd/ref/battenberg_alleles_on_target_hg38.zip \ --ascat_loci $wd/ref/battenberg_loci_on_target_hg38.zip \ --ascat_loci_gc $wd/ref/GC_G1000_on_target_hg38.zip \ --ascat_loci_rt $wd/ref/RT_G1000_on_target_hg38.zip

Here attached the error:

Could you error.txt please assist me?

Best

asp8200 commented 1 year ago

@Nour-EddineS and @paolo-kunderfranco : Could you try to rerun your tests? This issue may just have been solved by #1093.

FriederikeHanssen commented 1 year ago

We fixed some things around this with the latest release 3.2.2. can you test, if this fixes your issues?

Nour-EddineS commented 1 year ago

Dear @FriederikeHanssen @asp8200,

I hope this message finds you well. I wanted to inform you that I am still encountering the same problem even after applying the latest updates.

Best regards,