Commit 9f572fe3 authored by Wai Yi Leung's avatar Wai Yi Leung

NO more reflective issues, simplify some refs.

parent 24837f5b
......@@ -31,7 +31,7 @@ import nl.lumc.sasc.biopet.tools.FastqSync
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.function.QFunction
import scala.collection.JavaConversions._
//import scala.language.reflectiveCalls
/**
* This is a trait for the Gears pipeline
* The ShivaTrait is used as template for this pipeline
......@@ -236,39 +236,41 @@ trait GearsTrait extends MultiSampleQScript with SummaryQScript { qscript =>
case _ => None
}
}).flatten.toList)
lazy val alnFileDirty: File = sampleAlnJob.output
lazy val alnFile: File = sampleAlnJob.output
def alnFile: File = sampleBamLinkJob.output
/** Job for combining all library BAMs */
private def sampleAlnJob: CombineFileFunction =
private def sampleBamLinkJob: Ln =
makeCombineJob(libraries.values.map(_.alnFile).toList, createFile(".bam"))
/** Super type of Ln and MergeSamFiles */
private type CombineFileFunction = QFunction { def output: File }
/** Ln or MergeSamFile job, depending on how many inputs are supplied */
private def makeCombineJob(inFiles: List[File], outFile: File,
mergeSortOrder: String = "coordinate"): CombineFileFunction = {
mergeSortOrder: String = "coordinate"): Ln = {
require(inFiles.nonEmpty, "At least one input files for combine job")
var input: File = new File("")
if (inFiles.size == 1) {
val job = new Ln(qscript)
job.input = inFiles.head
job.output = outFile
job
input = inFiles.head
} else {
val mergedBam = createFile(".merged.bam")
val job = new MergeSamFiles(qscript)
job.input = inFiles
job.output = outFile
job.output = mergedBam
job.sortOrder = mergeSortOrder
job
input = job.output
}
val job = new Ln(qscript)
job.input = input
job.output = outFile
job
}
/** This will add sample jobs */
def addJobs(): Unit = {
addPerLibJobs()
// merge or symlink per-library alignments
add(sampleAlnJob)
add(sampleBamLinkJob)
if (preProcessBam.isDefined) {
val bamMetrics = new BamMetrics(qscript)
......
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