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

Commit

Permalink
Merge pull request #489 from szilvajuhos/master
Browse files Browse the repository at this point in the history
Adding exception handling to ASCAT when it is not able to find optimum
  • Loading branch information
maxulysse authored Oct 27, 2017
2 parents 0d7fc10 + e3d7141 commit 2b0d7f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion bin/run_ascat.r
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ cnvs=ascat.output$segments[ascat.output$segments[,"nMajor"]!=1 | ascat.output$se
write.table(cnvs, file=paste(tumorname,".cnvs.txt",sep=""), sep="\t", quote=F, row.names=F, col.names=T)

#Write out purity and ploidy info
summary <- matrix(c(ascat.output$aberrantcellfraction, ascat.output$ploidy), ncol=2, byrow=TRUE)
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=paste(tumorname,".purityploidy.txt",sep=""), sep="\t", quote=F, row.names=F, col.names=T)
4 changes: 2 additions & 2 deletions configuration/singularity-path.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ process {
$RealignerTargetCreator.container = "${params.containerPath}/gatk-${params.tag}.img"
$RecalibrateBam.container = "${params.containerPath}/gatk-${params.tag}.img"
$RunAlleleCount.container = "${params.containerPath}/runallelecount-${params.tag}.img"
$RunAscat.container = "${params.containerPath}/r-params.base-${params.tag}.img"
$RunAscat.container = "${params.containerPath}/r-base-${params.tag}.img"
$RunBamQC.container = "${params.containerPath}/qualimap-${params.tag}.img"
$RunBcftoolsStats.container = "${params.containerPath}/caw-${params.tag}.img"
$RunConvertAlleleCounts.container = "${params.containerPath}/r-params.base-${params.tag}.img"
$RunConvertAlleleCounts.container = "${params.containerPath}/r-base-${params.tag}.img"
$RunFastQC.container = "${params.containerPath}/fastqc-${params.tag}.img"
$RunFreeBayes.container = "${params.containerPath}/freebayes-${params.tag}.img"
$RunGenotypeGVCFs.container = "${params.containerPath}/gatk-${params.tag}.img"
Expand Down

0 comments on commit 2b0d7f5

Please sign in to comment.