Skip to content

Commit

Permalink
Fix warning for no AC/AF
Browse files Browse the repository at this point in the history
  • Loading branch information
slulla committed Apr 2, 2024
1 parent 75cb3b8 commit 83850b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions transcriptionary/get_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def get_variants_vcf(vcf_path):
vcf.get_header_type('AF')
variant_params[variant_set]['has_yaxis_info'] = True
except:
print('Variant set \'{}\' does not have all both \'AC\' and \'AF\' fields, so lollipop heights will be set to 0'.format(variant_set))
variant_params[variant_set]['has_yaxis_info'] = False

def get_allele_field(v, allele_field): #if vcf does not have AC/AN/AF field return 0
Expand Down Expand Up @@ -121,7 +120,7 @@ def get_variants_bed(bed_path):

else: raise ValueError('Invalid file format for variant set {}: {}'.format(variant_set, filepath))

if not variant_params[variant_set]['has_yaxis_info']: print('Warning: variant set {} does not have both AC (allele count) and AF (allele frequency) fields; lollipop heights will all be set to 0.')
if not variant_params[variant_set]['has_yaxis_info']: print('Warning: variant set {} does not have both AC (allele count) and AF (allele frequency) fields; all lollipop heights will be set to 0.'.format(variant_set))

return variant_ls

Expand Down

0 comments on commit 83850b3

Please sign in to comment.