You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing values for Integer INFO/FORMAT fields are represented by the minimum int32 value (-2147483648, or np.iinfo(np.int32).min). It would be nice if a mask array could be retrieved that didn't rely on checking for this value, but that looked for missing values in the original VCF field.
This would be useful for Flag (boolean) fields too.
The text was updated successfully, but these errors were encountered:
The value -2147483648 comes from interpreting the bytes of the reserved 'missing' value b'\x80\x00\x00\x00' as an integer.
Within cyvcf2.pyx it should be able to do this using the bcf_int32_missing constant, this is similar to using bcf_int32_vector_end in #169.
For the Integer type, the values from −2^31 to −2^31 + 7 cannot be stored in the binary version and therefore are disallowed in both VCF and BCF, see 6.3.3.
So there is no danger of confusing missing values with the literal value -2147483648 in the field (since the latter is not allowed). (When I opened this issue I thought there was such a danger.)
It still might be useful to provide a mask in cyvcf2, since getting the logic right is slightly tricky (because of the range of values).
Also, for Flag fields, I don't think there's a problem, since Flag only applies to INFO fields, and they return tuples, not NumPy arrays.
Missing values for Integer INFO/FORMAT fields are represented by the minimum int32 value (-2147483648, or
np.iinfo(np.int32).min
). It would be nice if a mask array could be retrieved that didn't rely on checking for this value, but that looked for missing values in the original VCF field.This would be useful for Flag (boolean) fields too.
The text was updated successfully, but these errors were encountered: