Commit 5f0512b5 authored by Sander Bollen's avatar Sander Bollen
Browse files

VcfFilter tests. See #188.

parent 02e5f5ec
......@@ -56,7 +56,7 @@ class VcfFilter(val root: Configurable) extends ToolCommandFuntion {
object VcfFilter extends ToolCommand {
/** Container class for a trio */
protected case class Trio(child: String, father: String, mother: String) {
protected[tools] case class Trio(child: String, father: String, mother: String) {
def this(arg: String) = {
this(arg.split(":")(0), arg.split(":")(1), arg.split(":")(2))
}
......
......@@ -50,7 +50,7 @@ class VepNormalizer(val root: Configurable) extends ToolCommandFuntion {
var mode: String = config("mode", default = "explode")
var doNotRemove: Boolean = config("donotremove", default = false)
override def defaultCoreMemory = 1.0
override def defaultCoreMemory = 4.0
override def commandLine = super.commandLine +
required("-I", inputVCF) +
......
......@@ -147,4 +147,63 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
mustHaveVariant(record, List("Child_7006504", "Father_7006506", "Mother_7006508")) shouldBe false
}
@Test def testSameGenotype() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
notSameGenotype(record, "Child_7006504", "Father_7006506") shouldBe false
notSameGenotype(record, "Child_7006504", "Mother_7006508") shouldBe true
notSameGenotype(record, "Father_7006506", "Mother_7006508") shouldBe true
}
@Test def testfilterHetVarToHomVar() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
filterHetVarToHomVar(record, "Child_7006504", "Father_7006506") shouldBe true
filterHetVarToHomVar(record, "Child_7006504", "Mother_7006508") shouldBe true
filterHetVarToHomVar(record, "Father_7006506", "Mother_7006508") shouldBe true
}
@Test def testDeNovo() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
denovoInSample(record, "Child_7006504") shouldBe false
denovoInSample(record, "Father_7006506") shouldBe false
denovoInSample(record, "Mother_7006508") shouldBe false
}
@Test def testResToDom() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
val trio = new Trio("Child_7006504", "Father_7006506", "Mother_7006508")
resToDom(record, List(trio)) shouldBe false
}
@Test def testTrioCompound = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
val trio = new Trio("Child_7006504", "Father_7006506", "Mother_7006508")
trioCompound(record, List(trio))
}
@Test def testDeNovoTrio = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
val trio = new Trio("Child_7006504", "Father_7006506", "Mother_7006508")
denovoTrio(record, List(trio))
}
@Test def testInIDSet() = {
val reader = new VCFFileReader(vepped, false)
val record = reader.iterator().next()
inIdSet(record, Set("rs199537431")) shouldBe true
inIdSet(record, Set("dummy")) shouldBe false
}
}
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