Commit 8829cb1b authored by Sander Bollen's avatar Sander Bollen
Browse files

Added unit test for #186. Unit test passes.

parent 1bbf15aa
......@@ -15,8 +15,10 @@
import java.nio.file.Paths
import htsjdk.variant.vcf.VCFFileReader
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.testng.TestNGSuite
......@@ -37,6 +39,7 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
val vepped_path = resourcePath("/VEP_oneline.vcf")
val vepped = new File(vepped_path)
val rand = new Random()
@Test def testOutputTypeVcf() = {
......@@ -57,4 +60,24 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
@Test def testHasGenotype() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
hasGenotype(record, List("Child_7006504:HET")) shouldBe true
hasGenotype(record, List("Child_7006504:HOM_VAR")) shouldBe false
hasGenotype(record, List("Child_7006504:HOM_REF")) shouldBe false
hasGenotype(record, List("Child_7006504:NO_CALL")) shouldBe false
hasGenotype(record, List("Child_7006504:MIXED")) shouldBe false
hasGenotype(record, List("Mother_7006508:HET")) shouldBe false
hasGenotype(record, List("Mother_7006508:HOM_VAR")) shouldBe false
hasGenotype(record, List("Mother_7006508:HOM_REF")) shouldBe true
hasGenotype(record, List("Mother_7006508:NO_CALL")) shouldBe false
hasGenotype(record, List("Mother_7006508:MIXED")) shouldBe false
hasGenotype(record, List("Mother_7006508:HOM_REF", "Child_7006504:HET")) shouldBe true
hasGenotype(record, List("Mother_7006508:HET", "Child_7006504:HOM_HET")) shouldBe false
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