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

Fixed bammetrics tests

parent 64134d46
Branches
Tags
No related merge requests found
...@@ -50,22 +50,22 @@ class BamMetricsTest extends TestNGSuite with Matchers { ...@@ -50,22 +50,22 @@ class BamMetricsTest extends TestNGSuite with Matchers {
@DataProvider(name = "bammetricsOptions") @DataProvider(name = "bammetricsOptions")
def bammetricsOptions = { def bammetricsOptions = {
val rois = Array(0, 1, 2, 3) val rois = Array(0, 1, 2, 3)
val amplicon = Array(true, false) val bool = Array(true, false)
val rna = Array(true, false)
for ( for (
rois <- rois; rois <- rois;
amplicon <- amplicon; amplicon <- bool;
rna <- rna rna <- bool;
) yield Array(rois, amplicon, rna) wgs <- bool
) yield Array(rois, amplicon, rna, wgs)
} }
@Test(dataProvider = "bammetricsOptions") @Test(dataProvider = "bammetricsOptions")
def testBamMetrics(rois: Int, amplicon: Boolean, rna: Boolean) = { def testBamMetrics(rois: Int, amplicon: Boolean, rna: Boolean, wgs: Boolean) = {
val map = ConfigUtils.mergeMaps(Map("output_dir" -> BamMetricsTest.outputDir), val map = ConfigUtils.mergeMaps(Map("output_dir" -> BamMetricsTest.outputDir, "rna_metrics" -> rna, "wgs_metrics" -> wgs),
Map(BamMetricsTest.executables.toSeq: _*)) ++ Map(BamMetricsTest.executables.toSeq: _*)) ++
(if (amplicon) Map("amplicon_bed" -> "amplicon.bed") else Map()) ++ (if (amplicon) Map("amplicon_bed" -> "amplicon.bed") else Map()) ++
(if (rna) Map("transcript_refflat" -> "transcripts.refFlat") else Map()) ++ (if (rna) Map("annotation_refflat" -> "transcripts.refFlat") else Map()) ++
Map("regions_of_interest" -> (1 to rois).map("roi_" + _ + ".bed").toList) Map("regions_of_interest" -> (1 to rois).map("roi_" + _ + ".bed").toList)
val bammetrics: BamMetrics = initPipeline(map) val bammetrics: BamMetrics = initPipeline(map)
...@@ -77,7 +77,7 @@ class BamMetricsTest extends TestNGSuite with Matchers { ...@@ -77,7 +77,7 @@ class BamMetricsTest extends TestNGSuite with Matchers {
var regions: Int = rois + (if (amplicon) 1 else 0) var regions: Int = rois + (if (amplicon) 1 else 0)
bammetrics.functions.count(_.isInstanceOf[CollectRnaSeqMetrics]) shouldBe (if (rna) 1 else 0) bammetrics.functions.count(_.isInstanceOf[CollectRnaSeqMetrics]) shouldBe (if (rna) 1 else 0)
bammetrics.functions.count(_.isInstanceOf[CollectWgsMetrics]) shouldBe (if (rna) 0 else 1) bammetrics.functions.count(_.isInstanceOf[CollectWgsMetrics]) shouldBe (if (wgs) 1 else 0)
bammetrics.functions.count(_.isInstanceOf[CollectMultipleMetrics]) shouldBe 1 bammetrics.functions.count(_.isInstanceOf[CollectMultipleMetrics]) shouldBe 1
bammetrics.functions.count(_.isInstanceOf[CalculateHsMetrics]) shouldBe (if (amplicon) 1 else 0) bammetrics.functions.count(_.isInstanceOf[CalculateHsMetrics]) shouldBe (if (amplicon) 1 else 0)
bammetrics.functions.count(_.isInstanceOf[CollectTargetedPcrMetrics]) shouldBe (if (amplicon) 1 else 0) bammetrics.functions.count(_.isInstanceOf[CollectTargetedPcrMetrics]) shouldBe (if (amplicon) 1 else 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment