Skip to content
Snippets Groups Projects
Commit bbb226bc authored by van den Berg's avatar van den Berg
Browse files

Add test for a rare bug with partial variants

parent b63f7cb0
No related branches found
No related tags found
2 merge requests!6Merge testing into master,!5Merge new testing code into devel
import pytest
from collections import defaultdict
from vtools.evaluate import site_concordancy
from vtools.evaluate import parse_variants
from cyvcf2 import VCF
......@@ -340,3 +342,23 @@ def test_ref_alt_changed_call_concordant(ref_alt_changed_call):
def test_ref_alt_changed_call_no_call(ref_alt_changed_call):
assert ref_alt_changed_call['alleles_no_call'] == 54
def test_parse_variants_no_call():
""" This should be counted as a single no call """
results = defaultdict(int)
call = ['.', 'A']
pos = ['A', 'G']
parse_variants('A', call, pos, results)
assert results['alleles_no_call'] == 1
def test_parse_variants_concordant():
""" This should be counted as a single concordant allele """
results = defaultdict(int)
call = ['.', 'A']
pos = ['A', 'G']
parse_variants('A', call, pos, results)
assert results['alleles_concordant'] == 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment