From c842b96166201caafc7531325aa97e0b992ec166 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Mon, 10 Feb 2020 10:33:21 -0700 Subject: [PATCH] Add the "-K" option from bwa --- tasks/src/main/scala/dagr/tasks/bwa/Bwa.scala | 5 +++-- tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/src/main/scala/dagr/tasks/bwa/Bwa.scala b/tasks/src/main/scala/dagr/tasks/bwa/Bwa.scala index 9e7e9ac3..8ba11fab 100644 --- a/tasks/src/main/scala/dagr/tasks/bwa/Bwa.scala +++ b/tasks/src/main/scala/dagr/tasks/bwa/Bwa.scala @@ -49,7 +49,8 @@ object Bwa extends Configuration { mergeBamAlignmentMem: String = "2G", fifoBufferMem: String = "512M", processAltMappings: Boolean = false, - orientation: PairOrientation = PairOrientation.FR + orientation: PairOrientation = PairOrientation.FR, + numFixedBases: Option[Int] = None ): Pipe[SamOrBam,SamOrBam] = { val alt = PathUtil.pathTo(s"${ref}.alt") val doAlt = Files.exists(alt) && processAltMappings @@ -57,7 +58,7 @@ object Bwa extends Configuration { val samToFastq = SamToFastq(in=unmappedBam, out=Io.StdOut).requires(Cores(samToFastqCores), Memory(samToFastqMem)) val fqBuffer = new FifoBuffer[Fastq].requires(memory=fifoMem) - val bwaMem = new BwaMem(fastq=Io.StdIn, ref=ref, minThreads=minThreads, maxThreads=maxThreads, memory=Memory(bwaMemMemory)) + val bwaMem = new BwaMem(fastq=Io.StdIn, ref=ref, numFixedBases=numFixedBases, minThreads=minThreads, maxThreads=maxThreads, memory=Memory(bwaMemMemory)) val bwaBuffer = new FifoBuffer[Sam].requires(memory=fifoMem) val altPipe = if (doAlt) new BwaK8AltProcessor(altFile=alt) | new FifoBuffer[Sam].requires(memory=fifoMem) else Pipes.empty[Sam] val mergeBam = new MergeBamAlignment(unmapped=unmappedBam, mapped=Io.StdIn, out=mappedBam, ref=ref, sortOrder=sortOrder, orientation=orientation) diff --git a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala index e6c92c8b..7a6eb55a 100644 --- a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala +++ b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala @@ -43,6 +43,7 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, clippingPenalties: Option[(Int,Int)] = None, minScore: Option[Int] = None, smartPairing: Boolean = true, + numFixedBases: Option[Int] = None, minThreads: Int = 1, maxThreads: Int = 32, memory: Memory = Memory("8G") @@ -64,6 +65,7 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, gapExtensionPenalties.foreach { case (del, ins) => buffer.append("-E", s"$del,$ins") } clippingPenalties.foreach { case (five, three) => buffer.append("-L", s"$five,$three") } minScore.foreach(s => buffer.append("-T", s)) + numFixedBases.foreach(n => buffer.append("-K", n)) buffer.append(ref, fastq) out.foreach(f => buffer.append("> " + f))