Skip to content

Commit 549cdb3

Browse files
tomwhitejeromekelleher
authored andcommitted
Interpret U1 dtype as VCF Character
1 parent f3b80e3 commit 549cdb3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vcztools/vcf_writer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,13 @@ def _array_to_vcf_number(category, key, a):
623623

624624

625625
def _array_to_vcf_type(a):
626-
# reverse of _vcf_type_to_numpy
627626
if a.dtype == bool:
628627
return "Flag"
629628
elif np.issubdtype(a.dtype, np.integer):
630629
return "Integer"
631630
elif np.issubdtype(a.dtype, np.float32):
632631
return "Float"
633-
elif a.dtype.str == "|S1":
632+
elif a.dtype.str[1:] in ("S1", "U1"):
634633
return "Character"
635634
elif a.dtype.kind in ("O", "S", "U"):
636635
return "String"

0 commit comments

Comments
 (0)