Commit eb40009e authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fixing stackoverflow

parent c882c5ac
......@@ -101,12 +101,13 @@ trait MultisampleMappingTrait extends MultiSampleQScript
lazy val bamToFastq: Boolean = config("bam_to_fastq", default = false)
lazy val correctReadgroups: Boolean = config("correct_readgroups", default = false)
def keepFinalBamfile = samples(sampleId).libraries.size == 1
lazy val mapping: Option[Mapping] = if (inputR1.isDefined || (inputBam.isDefined && bamToFastq)) {
val m: Mapping = new Mapping(qscript) {
override def configNamespace = "mapping"
override def defaults: Map[String, Any] = super.defaults ++
Map("keep_final_bamfile" -> !(samples(lib.sampleId).libraries.size > 1 ||
preProcessBam.map(_ != bamFile).getOrElse(false)))
Map("keep_final_bamfile" -> keepFinalBamfile)
}
m.sampleId = Some(sampleId)
m.libId = Some(libId)
......
......@@ -86,6 +86,8 @@ class Shiva(val root: Configurable) extends QScript with MultisampleMappingTrait
c && br.knownSites.nonEmpty
}
override def keepFinalBamfile = super.keepFinalBamfile && !useIndelRealigner && !useBaseRecalibration
override def preProcessBam = if (useIndelRealigner && useBaseRecalibration)
bamFile.map(swapExt(libDir, _, ".bam", ".realign.baserecal.bam"))
else if (useIndelRealigner) bamFile.map(swapExt(libDir, _, ".bam", ".realign.bam"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment