Commit 1aea2582 authored by Peter van 't Hof's avatar Peter van 't Hof

Added more summary testing

parent b4c7ded4
......@@ -33,10 +33,18 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
def this() = this(null)
case class FastaOutput(variants: File, consensus: File, consensusVariants: File)
case class FastaOutput(variants: File, consensus: File, consensusVariants: File) {
def summaryFiles(prefix: Option[String] = None) = Map(
s"${prefix.map(_ + "_").getOrElse("")}variants_fasta" -> variants,
s"${prefix.map(_ + "_").getOrElse("")}consensus_fasta" -> consensus,
s"${prefix.map(_ + "_").getOrElse("")}consensus_variants_fasta" -> consensusVariants
)
}
def variantcallers = List("unifiedgenotyper")
val numBoot = config("boot_runs", default = 100, namespace = "raxml").asInt
override def defaults = Map(
"ploidy" -> 1,
"variantcallers" -> variantcallers
......@@ -46,25 +54,25 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
def summaryFile: File = new File(outputDir, "Basty.summary.json")
def summaryFiles: Map[String, File] = shiva.summaryFiles
def summaryFiles: Map[String, File] = Map()
def summarySettings: Map[String, Any] = shiva.summarySettings
def summarySettings: Map[String, Any] = Map("boot_runs" -> numBoot)
def makeSample(id: String) = new Sample(id)
class Sample(sampleId: String) extends AbstractSample(sampleId) {
def summaryFiles: Map[String, File] = shiva.samples(sampleId).summaryFiles
def summaryFiles: Map[String, File] = output.summaryFiles() ++ outputSnps.summaryFiles(Some("snps_only"))
def summaryStats: Map[String, Any] = shiva.samples(sampleId).summaryStats
def summaryStats: Map[String, Any] = Map()
override def summarySettings: Map[String, Any] = shiva.samples(sampleId).summarySettings
override def summarySettings: Map[String, Any] = Map()
def makeLibrary(id: String) = new Library(id)
class Library(libId: String) extends AbstractLibrary(libId) {
def summaryFiles: Map[String, File] = shiva.samples(sampleId).libraries(libId).summaryFiles
def summaryFiles: Map[String, File] = Map()
def summaryStats: Map[String, Any] = shiva.samples(sampleId).libraries(libId).summaryStats
def summaryStats: Map[String, Any] = Map()
override def summarySettings: Map[String, Any] = shiva.samples(sampleId).libraries(libId).summarySettings
override def summarySettings: Map[String, Any] = Map()
protected def addJobs(): Unit = {}
}
......@@ -134,7 +142,6 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
add(raxmlMl)
val r = new scala.util.Random(seed)
val numBoot = config("boot_runs", default = 100, namespace = "raxml").asInt
val bootList = for (t <- 0 until numBoot) yield {
val raxmlBoot = new Raxml(this)
raxmlBoot.input = variants
......
......@@ -88,19 +88,23 @@ class BastyTest extends TestNGSuite with Matchers {
pipeline.functions.count(_.isInstanceOf[BaseRecalibrator]) shouldBe (if (dbsnp && baseRecalibration) (numberLibs * 2) else 0)
pipeline.functions.count(_.isInstanceOf[PrintReads]) shouldBe (if (dbsnp && baseRecalibration) numberLibs else 0)
pipeline.summarySettings.get("annotation") shouldBe Some(annotation)
pipeline.summarySettings.get("sv_calling") shouldBe Some(svCalling)
pipeline.summarySettings.get("cnv_calling") shouldBe Some(cnvCalling)
pipeline.summarySettings.get("boot_runs") shouldBe Some(bootRuns.getOrElse(100))
pipeline.samples foreach {
case (sampleId, sample) =>
sample.summarySettings.get("single_sample_variantcalling") shouldBe Some(sampleCalling)
sample.summarySettings.get("use_indel_realigner") shouldBe Some(realign)
sample.summarySettings shouldBe Map()
sample.summaryFiles.get("variants_fasta") should not be None
sample.summaryFiles.get("consensus_fasta") should not be None
sample.summaryFiles.get("consensus_variants_fasta") should not be None
sample.summaryFiles.get("snps_only_variants_fasta") should not be None
sample.summaryFiles.get("snps_only_consensus_fasta") should not be None
sample.summaryFiles.get("snps_only_consensus_variants_fasta") should not be None
sample.summaryStats shouldBe Map()
sample.libraries.foreach {
case (libId, lib) =>
lib.summarySettings.get("library_variantcalling") shouldBe Some(libraryCalling)
lib.summarySettings.get("use_indel_realigner") shouldBe Some(realign)
lib.summarySettings.get("use_base_recalibration") shouldBe Some(baseRecalibration && dbsnp)
lib.summarySettings shouldBe Map()
lib.summaryFiles shouldBe Map()
lib.summaryStats shouldBe Map()
}
}
......
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