Commit 27236df5 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Merge branch 'fix-tophat' into 'develop'

Fix output file for tophat step

Still needs testing

See merge request !300
parents d91e8f6f 203a0c98
......@@ -21,7 +21,7 @@ class Shiva(val root: Configurable) extends QScript with ShivaTrait {
def this() = this(null)
/** Make variantcalling submodule, this with the gatk modes in there */
override def makeVariantcalling(multisample: Boolean = false): ShivaVariantcallingTrait = {
override def makeVariantcalling(multisample: Boolean = false) = {
if (multisample) new ShivaVariantcalling(qscript) {
override def namePrefix = "multisample"
override def configName = "shivavariantcalling"
......
......@@ -2,10 +2,10 @@ package nl.lumc.sasc.biopet.extensions.bowtie
import java.io.File
import nl.lumc.sasc.biopet.core.{BiopetCommandLineFunction, Reference, Version}
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Reference, Version }
import nl.lumc.sasc.biopet.utils.Logging
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Extension for bowtie 2
......
......@@ -20,7 +20,7 @@ import java.util.Date
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.bowtie.{Bowtie2, Bowtie}
import nl.lumc.sasc.biopet.extensions.bowtie.{ Bowtie2, Bowtie }
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaAln, BwaMem, BwaSampe, BwaSamse }
import nl.lumc.sasc.biopet.extensions.gmap.Gsnap
import nl.lumc.sasc.biopet.extensions.picard.{ AddOrReplaceReadGroups, MarkDuplicates, MergeSamFiles, ReorderSam, SortSam }
......@@ -380,7 +380,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
// merge with mapped file
val mergeSamFile = MergeSamFiles(this, List(tophat.outputAcceptedHits, sorter.output),
tophat.output_dir, "coordinate")
new File(tophat.output_dir, "fixed_merged.bam"), sortOrder = "coordinate")
mergeSamFile.createIndex = true
mergeSamFile.isIntermediate = true
add(mergeSamFile)
......@@ -395,6 +395,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
add(ar._1)
ar._2
}
/** Adds stampy jobs */
def addStampy(R1: File, R2: Option[File], output: File): File = {
......
......@@ -36,10 +36,10 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
}
/** Method to make the variantcalling submodule of shiva */
def makeVariantcalling(multisample: Boolean = false): ShivaVariantcallingTrait = {
def makeVariantcalling(multisample: Boolean = false): ShivaVariantcallingTrait with QScript = {
if (multisample) new ShivaVariantcalling(qscript) {
override def namePrefix = "multisample"
override def configName = "shivavariantcalling"
override def configName: String = "shivavariantcalling"
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
}
else new ShivaVariantcalling(qscript) {
......@@ -69,7 +69,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
} else None
/** This will add jobs for this library */
override def addJobs = {
override def addJobs() = {
super.addJobs()
variantcalling.foreach(vc => {
......@@ -78,10 +78,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
vc.outputDir = new File(libDir, "variantcalling")
if (preProcessBam.isDefined) vc.inputBams = Map(sampleId -> preProcessBam.get)
else vc.inputBams = Map(sampleId -> bamFile.get)
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
})
}
}
......@@ -99,10 +96,7 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
vc.sampleId = Some(sampleId)
vc.outputDir = new File(sampleDir, "variantcalling")
vc.inputBams = Map(sampleId -> bam)
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
})
}
}
......@@ -122,34 +116,25 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
} else None
/** This will add the mutisample variantcalling */
override def addMultiSampleJobs = {
override def addMultiSampleJobs() = {
super.addMultiSampleJobs()
multisampleVariantCalling.foreach(vc => {
vc.outputDir = new File(outputDir, "variantcalling")
vc.inputBams = samples.flatMap { case (sampleId, sample) => sample.preProcessBam.map(sampleId -> _) }
vc.init()
vc.biopetScript()
addAll(vc.functions)
addSummaryQScript(vc)
add(vc)
annotation.foreach { toucan =>
toucan.outputDir = new File(outputDir, "annotation")
toucan.inputVCF = vc.finalFile
toucan.init()
toucan.biopetScript()
addAll(toucan.functions)
addSummaryQScript(toucan)
add(toucan)
}
})
svCalling.foreach(sv => {
sv.outputDir = new File(outputDir, "sv_calling")
sv.inputBams = samples.flatMap { case (sampleId, sample) => sample.preProcessBam.map(sampleId -> _) }
sv.init()
sv.biopetScript()
addAll(sv.functions)
addSummaryQScript(sv)
add(sv)
})
}
......
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