From bb72a1641c4f70e6efc88531efaaecf150be9677 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof
Date: Wed, 17 Aug 2016 16:58:30 +0200
Subject: [PATCH] Adding more testing for vep summary parsing
---
.../src/test/resources/vep.failed.metrics | 36 +++++++++++++++++++
.../VariantEffectPredictorTest.scala | 23 ++++++++++++
2 files changed, 59 insertions(+)
create mode 100644 biopet-extensions/src/test/resources/vep.failed.metrics
diff --git a/biopet-extensions/src/test/resources/vep.failed.metrics b/biopet-extensions/src/test/resources/vep.failed.metrics
new file mode 100644
index 000000000..b722714c7
--- /dev/null
+++ b/biopet-extensions/src/test/resources/vep.failed.metrics
@@ -0,0 +1,36 @@
+[VEP run statistics]
+VEP version (API) 82 (82)
+Cache/Database /usr/local/Genomes/H.Sapiens/GRCh37/annotation/vep/homo_sapiens_merged/81_GRCh37
+Species homo_sapiens
+Command line options -i /exports/sasc/pjvan_thof/toucan_test/output/chunk/chr17_GL000204_random-0-81310/chr17_GL000204_random-0-81310.vcf.gz -o /exports/sasc/pjvan_thof/toucan_test/output/chunk/chr17_GL000204_random-0-81310/chr17_GL000204_random-0-81310.vep.vcf -v --everything --stats_text --cache --vcf --allow_non_variant --merged --species homo_sapiens --assembly GRCh37 --dir /usr/local/Genomes/H.Sapiens/GRCh37/annotation/vep --fasta /usr/local/Genomes/H.Sapiens/GRCh37/annotation/vep/reference.fa --fork 2 --cache_version 81 --port 3337 --db_version 81 --failed 1
+Start time 2016-08-17 13:44:42
+End time 2016-08-17 13:44:42
+Run time 0 seconds
+Input file (format) /exports/sasc/pjvan_thof/toucan_test/output/chunk/chr17_GL000204_random-0-81310/chr17_GL000204_random-0-81310.vcf.gz (VCF)
+Output file /exports/sasc/pjvan_thof/toucan_test/output/chunk/chr17_GL000204_random-0-81310/chr17_GL000204_random-0-81310.vep.vcf [text]
+
+[General statistics]
+Lines of input read 413
+Variants processed
+Variants remaining after filtering
+Lines of output written
+Novel / existing variants -
+Overlapped genes
+Overlapped transcripts
+Overlapped regulatory features -
+
+[Variant classes]
+
+[Consequences (most severe)]
+
+[Consequences (all)]
+
+[Coding consequences]
+
+[SIFT summary]
+
+[PolyPhen summary]
+
+[Variants by chromosome]
+
+[Position in protein]
\ No newline at end of file
diff --git a/biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictorTest.scala b/biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictorTest.scala
index e51103de2..016608275 100644
--- a/biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictorTest.scala
+++ b/biopet-extensions/src/test/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictorTest.scala
@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.extensions
import java.io.File
import java.nio.file.Paths
+import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
@@ -46,4 +47,26 @@ class VariantEffectPredictorTest extends TestNGSuite with Matchers {
}
+ @Test
+ def testFailedSummaryStats = {
+ val file = new File(Paths.get(getClass.getResource("/vep.failed.metrics").toURI).toString)
+
+ val vep = new VariantEffectPredictor(null)
+ val stats = vep.parseStatsFile(file)
+ }
+
+ @Test
+ def testMergeFailSuccess: Unit = {
+ val file1 = new File(Paths.get(getClass.getResource("/vep.metrics").toURI).toString)
+ val vep1 = new VariantEffectPredictor(null)
+ val stats1 = vep1.parseStatsFile(file1)
+
+ val file2 = new File(Paths.get(getClass.getResource("/vep.failed.metrics").toURI).toString)
+ val vep2 = new VariantEffectPredictor(null)
+ val stats2 = vep2.parseStatsFile(file2)
+
+ ConfigUtils.mergeMaps(stats1, stats2, vep1.resolveSummaryConflict)
+ ConfigUtils.mergeMaps(stats2, stats1, vep1.resolveSummaryConflict)
+ }
+
}
--
GitLab