hts-specs icon indicating copy to clipboard operation
hts-specs copied to clipboard

vcf: Clarify the representation of a Flag INFO field

Open zaeleus opened this issue 3 years ago • 2 comments

My understanding is that a Flag INFO value is based on its presence and does not have an explicit right-hand value. This comes from The Variant Call Format Specification: VCFv4.3 and BCFv2.2 (2022-08-22) § 1.4.2 "Information field format", which states

The 'Flag' type indicates that the INFO field does not contain a Value entry, and hence the Number must be 0 in this case.

However, test/vcf/4.3/passed/passed_body_format.vcf shows Flag INFO fields with explicit values (0 and 1). Is this valid?

For reference,

zaeleus avatar Dec 14 '22 19:12 zaeleus

However, test/vcf/4.3/passed/passed_body_format.vcf shows Flag INFO fields with explicit values (0 and 1). Is this valid?

The example is incorrect and they should fail validation. There's no exception to Number=0 in VCF.

The only time any value for a FLAG field is mentioned is in the BCF specifications (section 6.6.3 Flags values) which recommended encoding a placeholder 1(INT8) to indicate presence. There's nothing to say this value should be included in VCF. This does mean that the VCF value for a FLAG field won't survive a round-trip through VCF but that's not a problem as the actual value isn't meaningful.

d-cameron avatar Dec 15 '22 03:12 d-cameron

See also #384.

jmarshall avatar Dec 15 '22 04:12 jmarshall