Skip to content

Commit

Permalink
Make sure VcfHeaderNumber.value is called in VariantBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfenne committed Jan 17, 2025
1 parent b0b4227 commit 063b979
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fgpyo/vcf/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ def add_info_header(
"""
if field_type == VcfFieldType.FLAG:
number = 0 # FLAGs always have number = 0
elif isinstance(number, VcfFieldNumber):
number = number.value

header_line = f"##INFO=<ID={name},Number={number},Type={field_type.value}"
if description is not None:
header_line += f",Description={description}"
Expand All @@ -358,6 +361,9 @@ def add_format_header(
number: the number of the field
description: the description of the field
"""
if isinstance(number, VcfFieldNumber):
number = number.value

header_line = f"##FORMAT=<ID={name},Number={number},Type={field_type.value}"
if description is not None:
header_line += f",Description={description}"
Expand Down

0 comments on commit 063b979

Please sign in to comment.