Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klinische Genetica
capture-lumc
vtools
Commits
3479a77a
Commit
3479a77a
authored
5 years ago
by
van den Berg
Browse files
Options
Downloads
Patches
Plain Diff
Convert single use fixtures to regular tests
parent
9e87861b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!6
Merge testing into master
,
!5
Merge new testing code into devel
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_evaluate.py
+6
-31
6 additions, 31 deletions
tests/test_evaluate.py
with
6 additions
and
31 deletions
tests/test_evaluate.py
+
6
−
31
View file @
3479a77a
...
...
@@ -83,19 +83,7 @@ def test_no_call(BLANK_NA12878):
assert
BLANK_NA12878
[
'
alleles_no_call
'
]
==
8
@pytest.fixture
(
scope
=
'
module
'
)
def
NA12878_BLANK
():
filename
=
'
tests/cases/gatk.vcf.gz
'
call
=
VCF
(
filename
,
gts012
=
True
)
positive
=
VCF
(
filename
,
gts012
=
True
)
d
,
disc
=
site_concordancy
(
call
,
positive
,
call_samples
=
[
'
NA12878
'
],
positive_samples
=
[
'
BLANK
'
],
min_gq
=
30
,
min_dp
=
20
)
return
d
@pytest.fixture
(
scope
=
'
module
'
)
def
NA12878_call_truncated
():
def
test_truncated_call_file
():
"""
When the call set is truncated, i.e. is missing variants which are
present in the positive vcf file
"""
...
...
@@ -106,17 +94,10 @@ def NA12878_call_truncated():
d
,
disc
=
site_concordancy
(
call
,
positive
,
call_samples
=
[
'
NA12878
'
],
positive_samples
=
[
'
BLANK
'
],
min_gq
=
30
,
min_dp
=
20
)
return
d
def
test_truncated_called_no_call
(
NA12878_call_truncated
):
"""
Variants which are missing from the call vcf count towards
alleles_no_call
"""
assert
NA12878_call_truncated
[
'
alleles_no_call
'
]
==
12
assert
d
[
'
alleles_no_call
'
]
==
12
@pytest.fixture
(
scope
=
'
module
'
)
def
NA12878_positive_truncated
():
def
test_truncated_positive_file
():
"""
When the positive set is truncated, i.e. the called vcf file contains
variants which are absent from the positive vcf file
"""
filename
=
'
tests/cases/gatk.vcf.gz
'
...
...
@@ -126,16 +107,10 @@ def NA12878_positive_truncated():
d
,
disc
=
site_concordancy
(
call
,
positive
,
call_samples
=
[
'
NA12878
'
],
positive_samples
=
[
'
BLANK
'
],
min_gq
=
30
,
min_dp
=
20
)
return
d
def
test_truncated_positive_no_call
(
NA12878_positive_truncated
):
"""
Variants which are missing from the positive vcf do not count towards
alleles_no_call
"""
assert
NA12878_positive_truncated
[
'
alleles_no_call
'
]
==
0
assert
d
[
'
alleles_no_call
'
]
==
0
def
test_phased_positive
():
def
test_phased_positive
_file
():
"""
Test error message when the positive vcf contains phased variants
"""
filename
=
'
tests/cases/gatk.vcf.gz
'
phased
=
'
tests/cases/dummy_phased_blank.vcf.gz
'
...
...
@@ -147,7 +122,7 @@ def test_phased_positive():
positive_samples
=
[
'
BLANK
'
])
def
test_phased_call
():
def
test_phased_call
_file
():
"""
Test error message when the call vcf contains phased variants
"""
filename
=
'
tests/cases/gatk.vcf.gz
'
phased
=
'
tests/cases/dummy_phased_blank.vcf.gz
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment