zaeleus / noodles

Bioinformatics I/O libraries in Rust
MIT License
515 stars 53 forks source link

Question about number in META Lines #203

Closed holtgrewe closed 1 year ago

holtgrewe commented 1 year ago

Hello, the code here gives an example on how to create META lines

https://github.com/zaeleus/noodles/blob/de55838e4211227b6e4e7b7fce83bb03b9b79dc8/noodles-vcf/src/header/parser.rs#L274

In my local tests, this generates lines such as

##META=<ID=Sex,Type="String",Number=".",Values="[Male, Female, Other, Unknown]">

rather than

##META=<ID=Sex,Type=String,Number=.,Values=[Male, Female, Other, Unknown]>

as it should by the VCF documentation (note the fewer quotes)

zaeleus commented 1 year ago

Thanks. META header records were removed in noodles-vcf 0.36.0 because they're actually not defined in the spec. To better match the unquoted example, serialization is now specialized for Map<Other> records with the META key in f044c1b3393e18d6097e85ed15c9d94e093e8ee9.

(VCF also doesn't define structured header record quoting rules, so the example with quotes is not considered invalid. See https://github.com/samtools/hts-specs/issues/608#issuecomment-1423181970.)