Skip to content

sarek v3.1.2 -- error for ascat #977

Open

Description

I have encountered the following error. I have tried both with out without --save_output_as_bam. It didn't help. I also ensured sufficient memory (256G) is available.

Thank you!

_-[nf-core/sarek] Pipeline completed with errors-
[27/e13d07] NOTE: Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (CGMH-FH-RCC1T_vs_CGMH-FH-RCC1N)` terminated with an error exit status (1) -- Execution is retried (7)
Error executing process > 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (CGMH-FH-RCC1T_vs_CGMH-FH-RCC1N)'

Caused by:
  Process `NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (CGMH-FH-RCC1T_vs_CGMH-FH-RCC1N)` 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 = "T.converted.cram",
      normalseqfile = "N.converted.cram",
      tumourname = paste0("T_vs_N", ".tumour"),
      normalname = paste0("T_vs_N", ".normal"),
      allelecounter_exe = "alleleCounter",
      alleles.prefix = allele_prefix,
      loci.prefix = loci_prefix,
      gender = "XY",
      genomeVersion = "hg19",
      nthreads = 16
      ,minCounts = 10
      ,BED_file = 'wgs_calling_regions_Sarek.list'
      ,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("T_vs_N", ".tumour_tumourLogR.txt"),
      Tumor_BAF_file = paste0("T_vs_N", ".tumour_tumourBAF.txt"),
      Germline_LogR_file = paste0("T_vs_N", ".tumour_normalLogR.txt"),
      Germline_BAF_file = paste0("T_vs_N", ".tumour_normalBAF.txt"),
      genomeVersion = "hg19",
      gender = "XY"
  )
  
  #Plot the raw data
  ascat.plotRawData(ascat.bc, img.prefix = paste0("T_vs_N", ".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("T_vs_N", ".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("T_vs_N", ".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("T_vs_N", ".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("T_vs_N",".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("T_vs_N",".purityploidy.txt"), sep=" ", quote=F, row.names=F, col.names=T)
  
  write.table(QC, file=paste0("T_vs_N", ".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:
  Reading locis
  [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.
  Reading locis
  Done reading locis
  Multi pos start:
  munmap_chunk(): invalid pointer
  [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   <<..............>>

Work dir:
  <<..............>>

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`_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions