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

Use piping after bwamem

parent 93724710
......@@ -16,9 +16,9 @@ class SamtoolsSort(val root: Configurable) extends Samtools {
@Output
var output: File = _
val compresion: Option[Int] = config("l")
val outputFormat: Option[String] = config("O")
val sortByName: Boolean = config("sort_by_name", default = false)
var compresion: Option[Int] = config("l")
var outputFormat: Option[String] = config("O")
var sortByName: Boolean = config("sort_by_name", default = false)
val prefix: String = config("prefix", default = new File(qSettings.tempDirectory, output.getAbsolutePath))
def cmdLine = optional("-m", (coreMemeory + "G")) +
......
......@@ -19,6 +19,7 @@ import java.io.File
import java.util.Date
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsSort
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaAln, BwaMem, BwaSampe, BwaSamse }
......@@ -331,11 +332,18 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaCommand.R = Some(getReadGroupBwa)
bwaCommand.output = swapExt(output.getParent, output, ".bam", ".sam")
bwaCommand.isIntermediate = true
add(bwaCommand)
val sortSam = SortSam(this, bwaCommand.output, output)
if (chunking || !skipMarkduplicates) sortSam.isIntermediate = true
add(sortSam)
sortSam.output
if (config("use_pipes", default = true).asBoolean) {
val samtoolsSort = new SamtoolsSort(this)
samtoolsSort.outputFormat = Some("bam")
samtoolsSort.output = output
add(bwaCommand | samtoolsSort)
} else {
add(bwaCommand)
val sortSam = SortSam(this, bwaCommand.output, output)
if (chunking || !skipMarkduplicates) sortSam.isIntermediate = true
add(sortSam)
}
output
}
def addGsnap(R1: File, R2: Option[File], output: File, deps: List[File]): File = {
......
Supports Markdown
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