Alexander Chang
08/27/2024, 11:59 AMAug-26 18:33:45.484 [Task monitor] ERROR nextflow.processor.TaskProcessor - Error executing process > 'NFCORE_SAREK:sarek:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (AUR-AER5-TTM5_vs_AUR-AER5-NT2)'
Caused by:
Process `NFCORE_SAREK:sarek:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_ASCAT:ASCAT (AUR-AER5-TTM5_vs_AUR-AER5-NT2)` 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("battenberg_alleles_on_target_hg38")
allele_prefix = paste0(allele_path, "/", "battenberg_alleles_on_target_hg38", "_chr")
loci_path = normalizePath("battenberg_loci_on_target_hg38")
loci_prefix = paste0(loci_path, "/", "battenberg_loci_on_target_hg38", "_chr")
#prepare from BAM files
ascat.prepareHTS(
tumourseqfile = "AUR-AER5-TTM5.recal.cram",
normalseqfile = "AUR-AER5-NT2.recal.cram",
tumourname = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".tumour"),
normalname = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".normal"),
allelecounter_exe = "alleleCounter",
alleles.prefix = allele_prefix,
loci.prefix = loci_prefix,
gender = "XX",
genomeVersion = "hg38",
nthreads = 16
,minCounts = 10
,BED_file = 'xgen-exome-research-panel-targets-hg38.bed'
,chrom_names = c(1:22, 'X')
,min_base_qual = 20
,min_map_qual = 35
,ref.fasta = 'Homo_sapiens_assembly38.fasta'
,
seed = 42
)
#Load the data
ascat.bc = ascat.loadData(
Tumor_LogR_file = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".tumour_tumourLogR.txt"),
Tumor_BAF_file = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".tumour_tumourBAF.txt"),
Germline_LogR_file = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".tumour_normalLogR.txt"),
Germline_BAF_file = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".tumour_normalBAF.txt"),
genomeVersion = "hg38",
gender = "XX"
)
#Plot the raw data
ascat.plotRawData(ascat.bc, img.prefix = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".before_correction."))
# optional LogRCorrection
if("GC_G1000_on_target_hg38" != "NULL") {
gc_input = paste0(normalizePath("GC_G1000_on_target_hg38"), "/", "GC_G1000_on_target_hg38", ".txt")
if("RT_G1000_on_target_hg38" != "NULL"){
rt_input = paste0(normalizePath("RT_G1000_on_target_hg38"), "/", "RT_G1000_on_target_hg38", ".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("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".after_correction_gc_rt."))
}
else {
ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = gc_input, replictimingfile = RT_G1000_on_target_hg38)
#Plot raw data after correction
ascat.plotRawData(ascat.bc, img.prefix = paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".after_correction_gc."))
}
}
#Segment the data
ascat.bc = ascat.aspcf(ascat.bc, seed=42)
#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("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".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("AUR-AER5-TTM5_vs_AUR-AER5-NT2",".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("AUR-AER5-TTM5_vs_AUR-AER5-NT2",".purityploidy.txt"), sep=" ", quote=F, row.names=F, col.names=T)
write.table(QC, file=paste0("AUR-AER5-TTM5_vs_AUR-AER5-NT2", ".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:
[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
munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
Reading locis
Done reading locis
Multi pos start:
Reading locis
Done reading locis
Multi pos start:
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.
[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
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 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:
Reading locis
Reading locis
Done reading locis
Multi pos start:
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.
[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
[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
munmap_chunk(): invalid pointer
Error in { : task 1 failed - "EXIT_CODE == 0 is not TRUE"
Calls: ascat.prepareHTS -> %dopar% -> <Anonymous>
Execution halted
Work dir:
/ocean/projects/aurora/achang4/sarek/Part2_FASTQ2SAREK/work/37/1a97d124c75fc7fb167135750e01b7Thomas Danhorn
08/27/2024, 3:07 PM.../37/1a97d124c75fc7fb167135750e01b7), is there anything that appears to be missing (given the command; check for dead symlinks)? Is this reproducible, i.e. if you rerun (with -resume), is the outcome the same?Alexander Chang
08/27/2024, 3:08 PMAlexander Chang
08/27/2024, 3:09 PMThomas Danhorn
08/27/2024, 3:11 PMAlexander Chang
08/27/2024, 3:11 PMAlexander Chang
08/27/2024, 6:42 PMAlexander Chang
08/27/2024, 6:47 PMThomas Danhorn
08/27/2024, 7:20 PMNo such file or directory ...
I would try to figure out what's going on by going to the work directory and trying to get the command in .command.sh running on the files there (using the container from the pipeline). Sorry I don't have any better ideas, I don't have any particular expertise with ASCAT. You are saying is works with WGS, maybe you can figure out what the differences are ...Thomas Danhorn
08/27/2024, 8:24 PM.command.sh files are equivalent or different.Alexander Chang
08/27/2024, 8:35 PMAlexander Chang
08/30/2024, 12:23 PM