Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit 2b0d7f5

Browse files
authored
Merge pull request #489 from szilvajuhos/master
Adding exception handling to ASCAT when it is not able to find optimum
2 parents 0d7fc10 + e3d7141 commit 2b0d7f5

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

bin/run_ascat.r

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ cnvs=ascat.output$segments[ascat.output$segments[,"nMajor"]!=1 | ascat.output$se
4343
write.table(cnvs, file=paste(tumorname,".cnvs.txt",sep=""), sep="\t", quote=F, row.names=F, col.names=T)
4444

4545
#Write out purity and ploidy info
46-
summary <- matrix(c(ascat.output$aberrantcellfraction, ascat.output$ploidy), ncol=2, byrow=TRUE)
46+
summary <- tryCatch({
47+
matrix(c(ascat.output$aberrantcellfraction, ascat.output$ploidy), ncol=2, byrow=TRUE)}, error = function(err) {
48+
# error handler picks up where error was generated
49+
print(paste("Could not find optimal solution: ",err))
50+
return(matrix(c(0,0),nrow=1,ncol=2,byrow = TRUE))
51+
}
52+
)
4753
colnames(summary) <- c("AberrantCellFraction","Ploidy")
4854
write.table(summary, file=paste(tumorname,".purityploidy.txt",sep=""), sep="\t", quote=F, row.names=F, col.names=T)

configuration/singularity-path.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ process {
3333
$RealignerTargetCreator.container = "${params.containerPath}/gatk-${params.tag}.img"
3434
$RecalibrateBam.container = "${params.containerPath}/gatk-${params.tag}.img"
3535
$RunAlleleCount.container = "${params.containerPath}/runallelecount-${params.tag}.img"
36-
$RunAscat.container = "${params.containerPath}/r-params.base-${params.tag}.img"
36+
$RunAscat.container = "${params.containerPath}/r-base-${params.tag}.img"
3737
$RunBamQC.container = "${params.containerPath}/qualimap-${params.tag}.img"
3838
$RunBcftoolsStats.container = "${params.containerPath}/caw-${params.tag}.img"
39-
$RunConvertAlleleCounts.container = "${params.containerPath}/r-params.base-${params.tag}.img"
39+
$RunConvertAlleleCounts.container = "${params.containerPath}/r-base-${params.tag}.img"
4040
$RunFastQC.container = "${params.containerPath}/fastqc-${params.tag}.img"
4141
$RunFreeBayes.container = "${params.containerPath}/freebayes-${params.tag}.img"
4242
$RunGenotypeGVCFs.container = "${params.containerPath}/gatk-${params.tag}.img"

0 commit comments

Comments
 (0)