Skip to content
Snippets Groups Projects
Commit c02fcacd authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Remove some test from shiva-gatk

parent f1615a59
No related branches found
No related tags found
No related merge requests found
...@@ -39,31 +39,27 @@ class ShivaTest extends TestNGSuite with Matchers { ...@@ -39,31 +39,27 @@ class ShivaTest extends TestNGSuite with Matchers {
val bool = Array(true, false) val bool = Array(true, false)
for ( for (
s1 <- bool; s2 <- bool; s3 <- bool; multi <- bool; single <- bool; s1 <- bool; s2 <- bool; multi <- bool;
library <- bool; dbsnp <- bool; covariates <- bool; realign <- bool; baseRecalibration <- bool dbsnp <- bool; realign <- bool; baseRecalibration <- bool
) yield Array("", s1, s2, s3, multi, single, library, dbsnp, covariates, realign, baseRecalibration) ) yield Array("", s1, s2, multi, dbsnp, realign, baseRecalibration)
} }
@Test(dataProvider = "shivaOptions") @Test(dataProvider = "shivaOptions")
def testShiva(f: String, sample1: Boolean, sample2: Boolean, sample3: Boolean, def testShiva(f: String, sample1: Boolean, sample2: Boolean,
multi: Boolean, single: Boolean, library: Boolean, dbsnp: Boolean, multi: Boolean, dbsnp: Boolean,
covariates: Boolean, realign: Boolean, baseRecalibration: Boolean): Unit = { realign: Boolean, baseRecalibration: Boolean): Unit = {
val map = { val map = {
var m: Map[String, Any] = ShivaTest.config var m: Map[String, Any] = ShivaTest.config
if (sample1) m = ConfigUtils.mergeMaps(ShivaTest.sample1, m) if (sample1) m = ConfigUtils.mergeMaps(ShivaTest.sample1, m)
if (sample2) m = ConfigUtils.mergeMaps(ShivaTest.sample2, m) if (sample2) m = ConfigUtils.mergeMaps(ShivaTest.sample2, m)
if (sample3) m = ConfigUtils.mergeMaps(ShivaTest.sample3, m)
if (dbsnp) m = ConfigUtils.mergeMaps(Map("dbsnp" -> "test"), m) if (dbsnp) m = ConfigUtils.mergeMaps(Map("dbsnp" -> "test"), m)
ConfigUtils.mergeMaps(Map("multisample_variantcalling" -> multi, ConfigUtils.mergeMaps(Map("multisample_variantcalling" -> multi,
"single_sample_variantcalling" -> single,
"library_variantcalling" -> library,
"use_analyze_covariates" -> covariates,
"use_indel_realigner" -> realign, "use_indel_realigner" -> realign,
"use_base_recalibration" -> baseRecalibration), m) "use_base_recalibration" -> baseRecalibration), m)
} }
if (!sample1 && !sample2 && !sample3) { // When no samples if (!sample1 && !sample2) { // When no samples
intercept[IllegalArgumentException] { intercept[IllegalArgumentException] {
initPipeline(map).script() initPipeline(map).script()
} }
...@@ -71,22 +67,20 @@ class ShivaTest extends TestNGSuite with Matchers { ...@@ -71,22 +67,20 @@ class ShivaTest extends TestNGSuite with Matchers {
val pipeline = initPipeline(map) val pipeline = initPipeline(map)
pipeline.script() pipeline.script()
val numberLibs = (if (sample1) 1 else 0) + (if (sample2) 1 else 0) + (if (sample3) 2 else 0) val numberLibs = (if (sample1) 1 else 0) + (if (sample2) 2 else 0)
val numberSamples = (if (sample1) 1 else 0) + (if (sample2) 1 else 0) + (if (sample3) 1 else 0) val numberSamples = (if (sample1) 1 else 0) + (if (sample2) 1 else 0)
pipeline.functions.count(_.isInstanceOf[BwaMem]) shouldBe numberLibs pipeline.functions.count(_.isInstanceOf[BwaMem]) shouldBe numberLibs
pipeline.functions.count(_.isInstanceOf[SortSam]) shouldBe numberLibs pipeline.functions.count(_.isInstanceOf[SortSam]) shouldBe numberLibs
pipeline.functions.count(_.isInstanceOf[MarkDuplicates]) shouldBe (numberLibs + (if (sample3) 1 else 0)) pipeline.functions.count(_.isInstanceOf[MarkDuplicates]) shouldBe (numberLibs + (if (sample2) 1 else 0))
// Gatk preprocess // Gatk preprocess
pipeline.functions.count(_.isInstanceOf[IndelRealigner]) shouldBe (numberLibs + (if (sample3) 1 else 0)) * (if (realign) 1 else 0) pipeline.functions.count(_.isInstanceOf[IndelRealigner]) shouldBe (numberLibs * (if (realign) 1 else 0) + (if (sample2 && realign) 1 else 0))
pipeline.functions.count(_.isInstanceOf[RealignerTargetCreator]) shouldBe (numberLibs + (if (sample3) 1 else 0)) * (if (realign) 1 else 0) pipeline.functions.count(_.isInstanceOf[RealignerTargetCreator]) shouldBe (numberLibs * (if (realign) 1 else 0) + (if (sample2 && realign) 1 else 0))
pipeline.functions.count(_.isInstanceOf[BaseRecalibrator]) shouldBe (if (dbsnp && baseRecalibration) numberLibs else 0) * (if (covariates) 2 else 1) pipeline.functions.count(_.isInstanceOf[BaseRecalibrator]) shouldBe (if (dbsnp && baseRecalibration) numberLibs else 0)
pipeline.functions.count(_.isInstanceOf[AnalyzeCovariates]) shouldBe (if (dbsnp && covariates && baseRecalibration) numberLibs else 0)
pipeline.functions.count(_.isInstanceOf[PrintReads]) shouldBe (if (dbsnp && baseRecalibration) numberLibs else 0) pipeline.functions.count(_.isInstanceOf[PrintReads]) shouldBe (if (dbsnp && baseRecalibration) numberLibs else 0)
pipeline.functions.count(_.isInstanceOf[VcfStats]) shouldBe (if (multi) 2 else 0) + pipeline.functions.count(_.isInstanceOf[VcfStats]) shouldBe (if (multi) 2 else 0)
(if (single) numberSamples * 2 else 0) + (if (library) numberLibs * 2 else 0)
} }
} }
} }
...@@ -143,15 +137,6 @@ object ShivaTest { ...@@ -143,15 +137,6 @@ object ShivaTest {
))) )))
val sample2 = Map( val sample2 = Map(
"samples" -> Map("sample2" -> Map("libraries" -> Map(
"lib1" -> Map(
"R1" -> "2_1_R1.fq",
"R2" -> "2_1_R2.fq"
)
)
)))
val sample3 = Map(
"samples" -> Map("sample3" -> Map("libraries" -> Map( "samples" -> Map("sample3" -> Map("libraries" -> Map(
"lib1" -> Map( "lib1" -> Map(
"R1" -> "3_1_R1.fq", "R1" -> "3_1_R1.fq",
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scoverage.plugin.version>1.0.4</scoverage.plugin.version> <scoverage.plugin.version>1.1.1</scoverage.plugin.version>
</properties> </properties>
<build> <build>
...@@ -246,6 +246,11 @@ ...@@ -246,6 +246,11 @@
<scalaVersion>2.10.2</scalaVersion> <scalaVersion>2.10.2</scalaVersion>
<!-- other parameters --> <!-- other parameters -->
</configuration> </configuration>
<executions>
<execution>
<phase>test</phase>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment