Commit 8492af35 authored by Peter van 't Hof's avatar Peter van 't Hof

Adding link to ShivaVariantcallers

parent 2c35b3fa
...@@ -61,8 +61,8 @@ object Question { ...@@ -61,8 +61,8 @@ object Question {
default.foreach(x => println(s"Default value: $x")) default.foreach(x => println(s"Default value: $x"))
print(s"$name > ") print(s"$name > ")
(Console.readLine.split(",").toList.map(_.trim), default) match { (Console.readLine.split(",").toList.map(_.trim), default) match {
case (Nil, Some(d)) => d case (List(""), Some(d)) => d
case (Nil, None) => case (List(""), None) =>
println("ERROR: Value is required") println("ERROR: Value is required")
list(name, default, description, posibleValues, validation) list(name, default, description, posibleValues, validation)
case (a, _) => case (a, _) =>
......
...@@ -74,16 +74,16 @@ class ShivaVariantcalling(val root: Configurable) extends QScript ...@@ -74,16 +74,16 @@ class ShivaVariantcalling(val root: Configurable) extends QScript
val callers: List[Variantcaller] = { val callers: List[Variantcaller] = {
(for (name <- configCallers) yield { (for (name <- configCallers) yield {
if (!callersList.exists(_.name == name)) if (!ShivaVariantcalling.callersList(this).exists(_.name == name))
Logging.addError(s"variantcaller '$name' does not exist, possible to use: " + callersList.map(_.name).mkString(", ")) Logging.addError(s"variantcaller '$name' does not exist, possible to use: " + ShivaVariantcalling.callersList(this).map(_.name).mkString(", "))
callersList.find(_.name == name) ShivaVariantcalling.callersList(this).find(_.name == name)
}).flatten.toList.sortBy(_.prio) }).flatten.toList.sortBy(_.prio)
} }
/** This will add jobs for this pipeline */ /** This will add jobs for this pipeline */
def biopetScript(): Unit = { def biopetScript(): Unit = {
require(inputBams.nonEmpty, "No input bams found") require(inputBams.nonEmpty, "No input bams found")
require(callers.nonEmpty, "must select at least 1 variantcaller, choices are: " + callersList.map(_.name).mkString(", ")) require(callers.nonEmpty, "must select at least 1 variantcaller, choices are: " + ShivaVariantcalling.callersList(this).map(_.name).mkString(", "))
val cv = new CombineVariants(qscript) val cv = new CombineVariants(qscript)
cv.out = finalFile cv.out = finalFile
...@@ -159,19 +159,6 @@ class ShivaVariantcalling(val root: Configurable) extends QScript ...@@ -159,19 +159,6 @@ class ShivaVariantcalling(val root: Configurable) extends QScript
} }
} }
/** Will generate all available variantcallers */
protected def callersList: List[Variantcaller] =
new HaplotypeCallerGvcf(this) ::
new HaplotypeCallerAllele(this) ::
new UnifiedGenotyperAllele(this) ::
new UnifiedGenotyper(this) ::
new HaplotypeCaller(this) ::
new Freebayes(this) ::
new RawVcf(this) ::
new Bcftools(this) ::
new BcftoolsSingleSample(this) ::
new VarscanCnsSingleSample(this) :: Nil
/** Location of summary file */ /** Location of summary file */
def summaryFile = new File(outputDir, "ShivaVariantcalling.summary.json") def summaryFile = new File(outputDir, "ShivaVariantcalling.summary.json")
...@@ -188,4 +175,17 @@ class ShivaVariantcalling(val root: Configurable) extends QScript ...@@ -188,4 +175,17 @@ class ShivaVariantcalling(val root: Configurable) extends QScript
} }
} }
object ShivaVariantcalling extends PipelineCommand object ShivaVariantcalling extends PipelineCommand {
\ No newline at end of file /** Will generate all available variantcallers */
protected[shiva] def callersList(root: Configurable): List[Variantcaller] =
new HaplotypeCallerGvcf(root) ::
new HaplotypeCallerAllele(root) ::
new UnifiedGenotyperAllele(root) ::
new UnifiedGenotyper(root) ::
new HaplotypeCaller(root) ::
new Freebayes(root) ::
new RawVcf(root) ::
new Bcftools(root) ::
new BcftoolsSingleSample(root) ::
new VarscanCnsSingleSample(root) :: Nil
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.template ...@@ -3,6 +3,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.template
import java.io.File import java.io.File
import nl.lumc.sasc.biopet.core.{Reference, TemplateTool} import nl.lumc.sasc.biopet.core.{Reference, TemplateTool}
import nl.lumc.sasc.biopet.pipelines.shiva.ShivaVariantcalling
import nl.lumc.sasc.biopet.utils.Question import nl.lumc.sasc.biopet.utils.Question
/** /**
...@@ -12,9 +13,17 @@ object Shiva extends TemplateTool { ...@@ -12,9 +13,17 @@ object Shiva extends TemplateTool {
override val sampleConfigs: List[File] = TemplateTool.askSampleConfigs() override 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] = { def pipelineMap(map: Map[String, Any], expert: Boolean): Map[String, Any] = {
map ++ Reference.askReference ++ map ++ Reference.askReference ++
Map("variantcallers" -> Question.list("Variantcallers", Map(
posibleValues = List("haplotypercaller", "haplotypecaller_gvcf"))) "variantcallers" -> Question.list("Variantcallers", posibleValues = possibleVariantcallers,
default = Some(List("unifiedgenotyper", "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))
)
} }
} }
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