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

Fix format

parent f2c27a88
......@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Gather, Output}
import org.broadinstitute.gatk.utils.commandline.{ Gather, Output }
class GenotypeGVCFs(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.GenotypeGVCFs with GatkGeneral {
......
......@@ -68,7 +68,7 @@ class Shiva(val root: Configurable) extends QScript with ShivaTrait {
val file = addIndelRealign(bamFile.get, libDir, isIntermediate = true)
addBaseRecalibrator(file, libDir, libraries.size > 1)
} else if (useIndelRealigner) {
addIndelRealign(bamFile.get, libDir, libraries.size > 1)
addIndelRealign(bamFile.get, libDir, libraries.size > 1)
} else if (useBaseRecalibration) {
addBaseRecalibrator(bamFile.get, libDir, libraries.size > 1)
}
......@@ -87,7 +87,7 @@ class Shiva(val root: Configurable) extends QScript with ShivaTrait {
super.addJobs()
if (useIndelRealigner && libraries.values.flatMap(_.preProcessBam).size > 1) {
addIndelRealign(bamFile.get, sampleDir, libraries.size > 1)
addIndelRealign(bamFile.get, sampleDir, libraries.size > 1)
}
}
}
......
......@@ -3,9 +3,9 @@ package nl.lumc.sasc.biopet.pipelines.mapping
import java.io.File
import htsjdk.samtools.SamReaderFactory
import nl.lumc.sasc.biopet.core.{PipelineCommand, Reference, MultiSampleQScript}
import nl.lumc.sasc.biopet.core.{ PipelineCommand, Reference, MultiSampleQScript }
import nl.lumc.sasc.biopet.extensions.Ln
import nl.lumc.sasc.biopet.extensions.picard.{MarkDuplicates, MergeSamFiles, AddOrReplaceReadGroups, SamToFastq}
import nl.lumc.sasc.biopet.extensions.picard.{ MarkDuplicates, MergeSamFiles, AddOrReplaceReadGroups, SamToFastq }
import nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
import nl.lumc.sasc.biopet.utils.Logging
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -16,8 +16,8 @@ import MultisampleMapping.MergeStrategy
import scala.collection.JavaConversions._
/**
* Created by pjvanthof on 18/12/15.
*/
* Created by pjvanthof on 18/12/15.
*/
trait MultisampleMappingTrait extends MultiSampleQScript
with Reference { qscript: QScript =>
......@@ -25,7 +25,7 @@ trait MultisampleMappingTrait extends MultiSampleQScript
val value: String = config("merge_strategy", default = "preprocessmarkduplicates")
MergeStrategy.values.find(_.toString.toLowerCase == value) match {
case Some(v) => v
case _ => throw new IllegalArgumentException(s"merge_strategy '$value' does not exist")
case _ => throw new IllegalArgumentException(s"merge_strategy '$value' does not exist")
}
}
......@@ -55,8 +55,8 @@ trait MultisampleMappingTrait extends MultiSampleQScript
def makeLibrary(id: String) = new Library(id)
class Library(libId: String) extends AbstractLibrary(libId) {
def summaryFiles: Map[String, File] = (inputR1.map("input_R1" -> _) :: inputR2.map("input_R2" -> _) ::
inputBam.map("input_bam" -> _) :: bamFile.map("output_bam" -> _) ::
preProcessBam.map("output_preProcessBam" -> _) :: Nil).flatten.toMap
inputBam.map("input_bam" -> _) :: bamFile.map("output_bam" -> _) ::
preProcessBam.map("output_preProcessBam" -> _) :: Nil).flatten.toMap
def summaryStats: Map[String, Any] = Map()
......@@ -75,9 +75,9 @@ trait MultisampleMappingTrait extends MultiSampleQScript
} else None
def bamFile = mapping match {
case Some(m) => Some(m.finalBamFile)
case Some(m) => Some(m.finalBamFile)
case _ if inputBam.isDefined => Some(new File(libDir, s"$sampleId-$libId.bam"))
case _ => None
case _ => None
}
def preProcessBam = bamFile
......@@ -166,9 +166,9 @@ trait MultisampleMappingTrait extends MultiSampleQScript
mergeStrategy match {
case MergeStrategy.None =>
case (MergeStrategy.MergeSam | MergeStrategy.MarkDuplicates) if libraries.flatMap(_._2.bamFile).size == 1 =>
add(Ln.linkBamFile(qscript, libraries.flatMap(_._2.bamFile).head, bamFile.get):_*)
add(Ln.linkBamFile(qscript, libraries.flatMap(_._2.bamFile).head, bamFile.get): _*)
case (MergeStrategy.PreProcessMergeSam | MergeStrategy.PreProcessMarkDuplicates) if libraries.flatMap(_._2.preProcessBam).size == 1 =>
add(Ln.linkBamFile(qscript, libraries.flatMap(_._2.preProcessBam).head, bamFile.get):_*)
add(Ln.linkBamFile(qscript, libraries.flatMap(_._2.preProcessBam).head, bamFile.get): _*)
case MergeStrategy.MergeSam =>
add(MergeSamFiles(qscript, libraries.flatMap(_._2.bamFile).toList, bamFile.get))
case MergeStrategy.PreProcessMergeSam =>
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva
import nl.lumc.sasc.biopet.core.Reference
import nl.lumc.sasc.biopet.pipelines.bammetrics.TargetRegions
import nl.lumc.sasc.biopet.pipelines.mapping.{MultisampleMappingTrait}
import nl.lumc.sasc.biopet.pipelines.mapping.{ MultisampleMappingTrait }
import nl.lumc.sasc.biopet.pipelines.toucan.Toucan
import org.broadinstitute.gatk.queue.QScript
......@@ -86,7 +86,6 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
}
}
lazy val variantcalling = if (config("single_sample_variantcalling", default = false).asBoolean) {
Some(makeVariantcalling(multisample = false))
} else None
......
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