Commit 78a3291b authored by Peter van 't Hof's avatar Peter van 't Hof

Adding genral config for MultiSampleMapping

parent 78669bf0
......@@ -37,7 +37,7 @@ trait TemplateTool extends ToolCommand {
def pipelineMap(map: Map[String, Any], expert: Boolean): Map[String, Any]
val sampleConfigs: List[File] = Nil
lazy val sampleConfigs: List[File] = Nil
}
......
......@@ -15,7 +15,7 @@
package nl.lumc.sasc.biopet
import nl.lumc.sasc.biopet.core.PipelineStatus
import nl.lumc.sasc.biopet.utils.{ BiopetExecutable, MainCommand }
import nl.lumc.sasc.biopet.utils.{BiopetExecutable, MainCommand}
object BiopetExecutableMain extends BiopetExecutable {
def pipelines: List[MainCommand] = List(
......@@ -44,5 +44,8 @@ object BiopetExecutableMain extends BiopetExecutable {
def tools: List[MainCommand] = PipelineStatus :: BiopetToolsExecutable.tools
def templates: List[MainCommand] = List()
def templates: List[MainCommand] = List(
nl.lumc.sasc.biopet.pipelines.mapping.template.MultiSampleMapping,
nl.lumc.sasc.biopet.pipelines.shiva.template.Shiva
)
}
package nl.lumc.sasc.biopet.pipelines.mapping.template
import java.io.File
import nl.lumc.sasc.biopet.core.{Reference, TemplateTool}
import nl.lumc.sasc.biopet.utils.Question
/**
* Created by pjvanthof on 17/12/2016.
*/
object MultiSampleMapping extends TemplateTool {
override lazy val sampleConfigs: List[File] = TemplateTool.askSampleConfigs()
def possibleAligners = List("bwa-mem", "bwa-aln", "bowtie", "bowtie2", "gsnap", "hisat2",
"tophat", "stampy", "star", "star-2pass")
def pipelineMap(map: Map[String, Any], expert: Boolean): Map[String, Any] = {
val referenceConfig = map ++ Reference.askReference
val aligner = if (map.contains("aligner")) map("aligner").toString
else Question.string("Aligner", posibleValues = possibleAligners, default = Some("bwa-mem"))
referenceConfig ++ Map(
"aligner" -> aligner
)
}
}
......@@ -2,7 +2,8 @@ package nl.lumc.sasc.biopet.pipelines.shiva.template
import java.io.File
import nl.lumc.sasc.biopet.core.{Reference, TemplateTool}
import nl.lumc.sasc.biopet.core.TemplateTool
import nl.lumc.sasc.biopet.pipelines.mapping.template.MultiSampleMapping
import nl.lumc.sasc.biopet.pipelines.shiva.ShivaVariantcalling
import nl.lumc.sasc.biopet.utils.Question
......@@ -11,19 +12,24 @@ import nl.lumc.sasc.biopet.utils.Question
*/
object Shiva extends TemplateTool {
override val sampleConfigs: List[File] = TemplateTool.askSampleConfigs()
override lazy val sampleConfigs: List[File] = TemplateTool.askSampleConfigs()
def possibleVariantcallers: List[String] = {
ShivaVariantcalling.callersList(null).map(_.name)
}
def pipelineMap(map: Map[String, Any], expert: Boolean): Map[String, Any] = {
map ++ Reference.askReference ++
Map(
"variantcallers" -> Question.list("Variantcallers", posibleValues = possibleVariantcallers,
default = Some(List("haplotypecaller_gvcf", "haplotypecaller"))),
"use_indel_realigner" -> Question.boolean("use_indel_realigner", default = Some(true)),
"use_base_recalibration" -> Question.boolean("use_base_recalibration", default = Some(true))
val mappingConfig = MultiSampleMapping.pipelineMap(map, expert)
val variantCallers = Question.list("Variantcallers", posibleValues = possibleVariantcallers,
default = Some(List("haplotypecaller_gvcf", "haplotypecaller")))
val useIndelRealigner = Question.boolean("Use indel realigner", default = Some(true))
val useBaseRecalibration = Question.boolean("Use base recalibration", default = Some(true))
mappingConfig ++ Map(
"variantcallers" -> variantCallers,
"use_indel_realigner" -> useIndelRealigner,
"use_base_recalibration" -> useBaseRecalibration
)
}
}
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