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

Merge branch 'fix-toucan_sampleinfo' into 'develop'

Fix improper list type check in Toucan

This is a fix for #341 

Perhaps also for @a.h.b.bollen to take a look :).

See merge request !398
parents 5ca76501 d0b7d22d
......@@ -30,6 +30,7 @@ import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.intervals.BedRecordList
import org.broadinstitute.gatk.queue.QScript
import scalaz._, Scalaz._
* Pipeline to annotate a vcf file with VEP
......@@ -263,11 +264,16 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
val activates = sampleInfo map { x =>
val sampleGroup = x._2.getOrElse("varda_group", Nil) match {
case x: List[String] => x
case Nil => Nil
case _ => throw new IllegalArgumentException("Sample tag 'varda_group' is not a list of strings")
val maybeSampleGroup = x._2.get("varda_group") match {
case None => Some(Nil)
case Some(vals) => vals match {
case xs: List[_] => xs
.traverse[Option, String] { x => Option(x.toString).filter(_ == x) }
case otherwise => None
val sampleGroup = maybeSampleGroup
.getOrElse(throw new IllegalArgumentException("Sample tag 'varda_group' is not a list of strings"))
importAndActivateSample(x._1, sampleGroup, vcf, gVcf, annotate)
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