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
02e5f5ec
Commit
02e5f5ec
authored
Aug 12, 2015
by
Sander Bollen
Browse files
Partial VcfFilter tests. See #180
parent
0ae99234
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
View file @
02e5f5ec
...
...
@@ -278,7 +278,7 @@ object VcfFilter extends ToolCommand {
}
/**
* Checks if AD genotype field have a minimal value
* Checks if
non-ref
AD genotype field have a minimal value
* @param record VCF record
* @param minAlternateDepth minimal depth
* @param minSamplesPass Minimal number of samples to pass filter
...
...
public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfFilterTest.scala
View file @
02e5f5ec
...
...
@@ -81,4 +81,70 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
hasGenotype
(
record
,
List
((
"Mother_7006508"
,
GenotypeType
.
HET
),
(
"Child_7006504"
,
GenotypeType
.
HOM_REF
)))
shouldBe
false
}
@Test
def
testMinQualScore
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
minQualscore
(
record
,
2000
)
shouldBe
false
minQualscore
(
record
,
1000
)
shouldBe
true
}
@Test
def
testHasNonRefCalls
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
hasNonRefCalls
(
record
)
shouldBe
true
}
@Test
def
testHasCalls
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
hasCalls
(
record
)
shouldBe
true
}
@Test
def
testHasMinDP
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
hasMinTotalDepth
(
record
,
100
)
shouldBe
true
hasMinTotalDepth
(
record
,
200
)
shouldBe
false
}
@Test
def
testHasMinSampleDP
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
hasMinSampleDepth
(
record
,
30
,
1
)
shouldBe
true
hasMinSampleDepth
(
record
,
30
,
2
)
shouldBe
true
hasMinSampleDepth
(
record
,
30
,
3
)
shouldBe
true
hasMinSampleDepth
(
record
,
40
,
1
)
shouldBe
true
hasMinSampleDepth
(
record
,
40
,
2
)
shouldBe
true
hasMinSampleDepth
(
record
,
40
,
3
)
shouldBe
false
hasMinSampleDepth
(
record
,
50
,
1
)
shouldBe
false
hasMinSampleDepth
(
record
,
50
,
2
)
shouldBe
false
hasMinSampleDepth
(
record
,
50
,
3
)
shouldBe
false
}
@Test
def
testHasMinSampleAD
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
minAlternateDepth
(
record
,
0
,
3
)
shouldBe
true
minAlternateDepth
(
record
,
10
,
2
)
shouldBe
true
minAlternateDepth
(
record
,
10
,
3
)
shouldBe
false
minAlternateDepth
(
record
,
20
,
1
)
shouldBe
true
minAlternateDepth
(
record
,
20
,
2
)
shouldBe
false
}
@Test
def
testMustHaveVariant
()
=
{
val
reader
=
new
VCFFileReader
(
vepped
,
false
)
val
record
=
reader
.
iterator
().
next
()
mustHaveVariant
(
record
,
List
(
"Child_7006504"
))
shouldBe
true
mustHaveVariant
(
record
,
List
(
"Child_7006504"
,
"Father_7006506"
))
shouldBe
true
mustHaveVariant
(
record
,
List
(
"Child_7006504"
,
"Father_7006506"
,
"Mother_7006508"
))
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