From eb14ff5c1335119519a32a57d3aa84458a7b1d23 Mon Sep 17 00:00:00 2001 From: Jay Carey Date: Tue, 7 Jul 2020 11:03:36 +0000 Subject: [PATCH 1/2] Add flag to allow for the output of all alignments in bwa mem. Additional alignments are output as secondary alignemnts. --- tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala index 49d496ad..4fe42b25 100644 --- a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala +++ b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala @@ -46,8 +46,9 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, basesPerBatch: Option[Int] = None, minThreads: Int = 1, maxThreads: Int = 32, - memory: Memory = Memory("8G") - ) extends ProcessTask with VariableResources with Pipe[Fastq,Sam] { + memory: Memory = Memory("8G"), + outputAllAlignments: Boolean = false + ) extends ProcessTask with VariableResources with Pipe[Fastq,Sam] { name = "BwaMem" override def pickResources(resources: ResourceSet): Option[ResourceSet] = { @@ -58,6 +59,7 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, val buffer = ListBuffer[Any](Bwa.findBwa, "mem", "-t", resources.cores.toInt) if (smartPairing) buffer.append("-p") + if (outputAllAlignments) buffer.append("-a") minSeedLength.foreach(l => buffer.append("-k", l)) matchScore.foreach(s => buffer.append("-A", s)) mismatchPenalty.foreach(p => buffer.append("-B", p)) @@ -72,4 +74,4 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, buffer.toList } -} +} \ No newline at end of file From fb2d5b6c419bac15fc114ee8bba423ef975ad617 Mon Sep 17 00:00:00 2001 From: Jay Carey Date: Tue, 7 Jul 2020 11:19:55 +0000 Subject: [PATCH 2/2] Rearrange output alignment parameter. --- tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala index 4fe42b25..c2f723b8 100644 --- a/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala +++ b/tasks/src/main/scala/dagr/tasks/bwa/BwaMem.scala @@ -44,10 +44,10 @@ class BwaMem(fastq: PathToFastq = Io.StdIn, minScore: Option[Int] = None, smartPairing: Boolean = true, basesPerBatch: Option[Int] = None, + outputAllAlignments: Boolean = false, minThreads: Int = 1, maxThreads: Int = 32, - memory: Memory = Memory("8G"), - outputAllAlignments: Boolean = false + memory: Memory = Memory("8G") ) extends ProcessTask with VariableResources with Pipe[Fastq,Sam] { name = "BwaMem"