Skip to content
Snippets Groups Projects
Commit 4b084127 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Change ro preProcessBam

parent 230ce86b
No related branches found
No related tags found
No related merge requests found
...@@ -176,7 +176,7 @@ class Gentrap(val root: Configurable) extends QScript ...@@ -176,7 +176,7 @@ class Gentrap(val root: Configurable) extends QScript
/** Pipeline run for multiple samples */ /** Pipeline run for multiple samples */
override def addMultiSampleJobs(): Unit = { override def addMultiSampleJobs(): Unit = {
super.addMultiSampleJobs super.addMultiSampleJobs()
// merge expression tables // merge expression tables
executedMeasures.foreach(add) executedMeasures.foreach(add)
shivaVariantcalling.foreach(add) shivaVariantcalling.foreach(add)
...@@ -198,22 +198,15 @@ class Gentrap(val root: Configurable) extends QScript ...@@ -198,22 +198,15 @@ class Gentrap(val root: Configurable) extends QScript
"all_single" -> allSingle "all_single" -> allSingle
) )
/** Per-sample alignment file, post rRNA cleanup (if chosen) */ override lazy val preProcessBam = if (removeRibosomalReads) {
lazy val alnFile: File = wipeJob match { val job = new WipeReads(qscript)
case Some(j) => j.outputBam job.inputBam = bamFile.get
case None => preProcessBam.get ribosomalRefFlat.foreach(job.intervalFile = _)
} job.outputBam = createFile(".cleaned.bam")
job.discardedBam = createFile(".rrna.bam")
/** Job for removing ribosomal reads */ add(job)
private def wipeJob: Option[WipeReads] = if (removeRibosomalReads) { Some(job.outputBam)
//require(ribosomalRefFlat.isDefined) } else bamFile
val job = new WipeReads(qscript)
job.inputBam = bamFile.get
ribosomalRefFlat.foreach(job.intervalFile = _)
job.outputBam = createFile(".cleaned.bam")
job.discardedBam = createFile(".rrna.bam")
Some(job)
} else None
/** Whether all libraries are paired or not */ /** Whether all libraries are paired or not */
def allPaired: Boolean = libraries.values.forall(_.mapping.forall(_.input_R2.isDefined)) def allPaired: Boolean = libraries.values.forall(_.mapping.forall(_.input_R2.isDefined))
...@@ -229,8 +222,8 @@ class Gentrap(val root: Configurable) extends QScript ...@@ -229,8 +222,8 @@ class Gentrap(val root: Configurable) extends QScript
// add bigwig output, also per-strand when possible // add bigwig output, also per-strand when possible
//TODO: add Bam2Wig to multisample mapping //TODO: add Bam2Wig to multisample mapping
addAll(Bam2Wig(qscript, alnFile).functions)
preProcessBam.foreach { file => preProcessBam.foreach { file =>
add(Bam2Wig(qscript, file))
executedMeasures.foreach(_.addBamfile(sampleId, file)) executedMeasures.foreach(_.addBamfile(sampleId, file))
shivaVariantcalling.foreach(_.inputBams += sampleId -> file) shivaVariantcalling.foreach(_.inputBams += sampleId -> file)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment