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

Use get_header_type to determine if RGQ is present

parent 257600ce
No related branches found
No related tags found
2 merge requests!6Merge testing into master,!5Merge new testing code into devel
......@@ -48,19 +48,13 @@ def parse_variants(ref: str, call: List[str], pos: List[str],
def RGQ_header_defined(vcf):
""" Determine whether the RGQ annotation is defined in the FORMAT header of
the vcf.
Since the header_iter does not return python dictionaries, we cannot easily
test if a certain key is set, hence the ugly code.
"""
for header in vcf.header_iter():
try:
header['ID']
except KeyError:
continue
else:
if header['ID'] == 'RGQ':
return True
return False
try:
vcf.get_header_type('RGQ')
except KeyError:
return False
else:
return True
def site_concordancy(call_vcf: VCF,
......
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