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
71ee4cab
Commit
71ee4cab
authored
Oct 04, 2016
by
Sander Bollen
Browse files
extra safeguards. potential genotype 1/. is still a call.
Tests in VcfUtils
parent
90ad4035
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/VcfUtils.scala
View file @
71ee4cab
...
...
@@ -142,11 +142,11 @@ object VcfUtils {
}
/**
* Check whether genotype is of the f
r
om 0/.
* Check whether genotype is of the fo
r
m 0/.
* @param genotype genotype
* @return boolean
*/
def
isCompoundNoCall
(
genotype
:
Genotype
)
:
Boolean
=
{
genotype
.
isCalled
&&
genotype
.
getAlleles
.
exists
(
_
.
isNoCall
)
genotype
.
isCalled
&&
genotype
.
getAlleles
.
exists
(
_
.
isNoCall
)
&&
genotype
.
getAlleles
.
exists
(
_
.
isReference
)
}
}
biopet-utils/src/test/scala/VcfUtilsTest.scala
0 → 100644
View file @
71ee4cab
import
htsjdk.variant.variantcontext.
{
Allele
,
Genotype
,
GenotypeBuilder
}
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
import
scala.collection.JavaConversions._
import
nl.lumc.sasc.biopet.utils.VcfUtils
/**
* Created by Sander Bollen on 4-10-16.
*/
class
VcfUtilsTest
extends
TestNGSuite
with
Matchers
{
@Test
def
testCompoundNoCall
()
:
Unit
=
{
val
noAllele
=
Allele
.
NO_CALL
val
refAllele
=
Allele
.
create
(
"A"
,
true
)
val
compoundNoCall
=
GenotypeBuilder
.
create
(
"sample_01"
,
List
(
noAllele
,
refAllele
))
VcfUtils
.
isCompoundNoCall
(
compoundNoCall
)
shouldBe
true
val
altAllele
=
Allele
.
create
(
"G"
,
false
)
val
normalGenotype
=
GenotypeBuilder
.
create
(
"sample_01"
,
List
(
refAllele
,
altAllele
))
VcfUtils
.
isCompoundNoCall
(
normalGenotype
)
shouldBe
false
val
completeNoCall
=
GenotypeBuilder
.
create
(
"sample_01"
,
List
(
noAllele
,
noAllele
))
VcfUtils
.
isCompoundNoCall
(
completeNoCall
)
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