Commit 2465f250 authored by Peter van 't Hof's avatar Peter van 't Hof

Passing gender information to shivavariantcalling

parent 811fe4c2
......@@ -60,11 +60,13 @@ class Shiva(val parent: Configurable) extends QScript with MultisampleMappingTra
override def namePrefix = "multisample"
override def configNamespace: String = "shivavariantcalling"
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
genders = samples.map { case (sampleName, sample) => sampleName -> sample.gender }
}
else new ShivaVariantcalling(qscript) {
override def configNamespace = "shivavariantcalling"
sampleId = sample
libId = library
genders = sample.map(x => x -> samples(x).gender).toMap
}
}
......
......@@ -14,15 +14,16 @@
*/
package nl.lumc.sasc.biopet.pipelines.shiva
import nl.lumc.sasc.biopet.core.{ PipelineCommand, Reference, SampleLibraryTag }
import nl.lumc.sasc.biopet.core.{ MultiSampleQScript, PipelineCommand, Reference, SampleLibraryTag }
import MultiSampleQScript.Gender
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.Tabix
import nl.lumc.sasc.biopet.extensions.gatk.{ CombineVariants, GenotypeConcordance }
import nl.lumc.sasc.biopet.extensions.tools.VcfStats
import nl.lumc.sasc.biopet.extensions.vt.{ VtDecompose, VtNormalize }
import nl.lumc.sasc.biopet.extensions.vt.{VtDecompose, VtNormalize}
import nl.lumc.sasc.biopet.pipelines.bammetrics.TargetRegions
import nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.{ VarscanCnsSingleSample, _ }
import nl.lumc.sasc.biopet.utils.{ BamUtils, Logging }
import nl.lumc.sasc.biopet.utils.{BamUtils, Logging}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
......@@ -48,9 +49,21 @@ class ShivaVariantcalling(val parent: Configurable) extends QScript
var inputBqsrFiles: Map[String, File] = Map()
var genders: Map[String, Gender.Value] = _
/** Executed before script */
def init(): Unit = {
if (inputBamsArg.nonEmpty) inputBams = BamUtils.sampleBamMap(inputBamsArg)
if (genders == null) genders = {
val samples: Map[String, Any] = config("genders")
samples.map { case (sampleName, gender) =>
sampleName -> (gender.toString.toLowerCase match {
case "male" => Gender.Male
case "female" => Gender.Female
case _ => Gender.Unknown
})
}
}
}
var referenceVcf: Option[File] = config("reference_vcf")
......@@ -100,6 +113,7 @@ class ShivaVariantcalling(val parent: Configurable) extends QScript
caller.inputBqsrFiles = inputBqsrFiles
caller.namePrefix = namePrefix
caller.outputDir = new File(outputDir, caller.name)
caller.genders = genders
add(caller)
addStats(caller.outputFile, caller.name)
val normalize: Boolean = config("execute_vt_normalize", default = false, namespace = caller.configNamespace)
......
......@@ -14,6 +14,7 @@
*/
package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers
import nl.lumc.sasc.biopet.core.MultiSampleQScript.Gender
import nl.lumc.sasc.biopet.core.{ BiopetQScript, Reference }
import org.broadinstitute.gatk.queue.QScript
......@@ -27,6 +28,8 @@ trait Variantcaller extends QScript with BiopetQScript with Reference {
var namePrefix: String = _
var genders: Map[String, Gender.Value] = _
val mergeVcfResults: Boolean = config("merge_vcf_results", default = 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