Skip to content

Commit ad46178

Browse files
Will-Tylerjeromekelleher
authored andcommitted
Simplify can_localize logic
1 parent 2dc4f7b commit ad46178

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

bio2zarr/vcf2zarr/icf.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ def scan_vcf(path, target_num_partitions, *, local_alleles):
239239
# Indicates whether vcf2zarr can introduce local alleles
240240
can_localize = False
241241
should_add_laa_field = True
242-
has_PL = False
243242
fields = fixed_vcf_field_definitions()
244243
for h in vcf.header_iter():
245244
if h["HeaderType"] in ["INFO", "FORMAT"]:
@@ -249,14 +248,12 @@ def scan_vcf(path, target_num_partitions, *, local_alleles):
249248
field.vcf_number = "."
250249
fields.append(field)
251250
if field.category == "FORMAT":
252-
if field.name in {"GT", "AD", "PL"}:
253-
can_localize = True
254251
if field.name == "PL":
255-
has_PL = True
252+
can_localize = True
256253
if field.name == "LAA":
257254
should_add_laa_field = False
258255

259-
if local_alleles and can_localize and should_add_laa_field and has_PL:
256+
if local_alleles and can_localize and should_add_laa_field:
260257
laa_field = VcfField(
261258
category="FORMAT",
262259
name="LAA",

0 commit comments

Comments
 (0)