Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
8829cb1b
Commit
8829cb1b
authored
Aug 12, 2015
by
Sander Bollen
Browse files
Added unit test for #186. Unit test passes.
parent
1bbf15aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfFilterTest.scala
View file @
8829cb1b
...
...
@@ -15,8 +15,10 @@
*/
package
nl.lumc.sasc.biopet.tools
import
java.io.File
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 {
main
(
arguments
)
}
@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
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment