Author: Andreas Tille Last-Update: 2026-09-21 Description: Update GT values expected by t/05vcf.t for htslib >= 1.22 htslib >= 1.22 fixed the encoding of the first allele of a phased genotype (the phasing bit of the first allele is now set correctly for VCF < 4.4 input and BCF files). The t/05vcf.t test hard-coded the old, incorrect GT values, so it failed with the latest htslib. This patch updates the expected GT values to match the new, spec conformant encoding. --- a/t/05vcf.t +++ b/t/05vcf.t @@ -138,11 +138,11 @@ is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ; # format related tests - is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); + is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present'); is_deeply($row->get_format($h), { - GT => [2, 3, 2, 3, 2, 4], + GT => [3, 3, 3, 3, 2, 4], HQ => [10, 10, 10, 10, 3, 3] }, "format read"); @@ -164,11 +164,11 @@ is_deeply($info_result, {}, 'info read correctly'); # format related tests - is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); + is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present'); is_deeply($row->get_format($h), { - GT => [2, 3, 2, 3, 2, 4], + GT => [3, 3, 3, 3, 2, 4], HQ => [10, 10, 10, 10, 3, 3] }, "format read"); @@ -176,13 +176,13 @@ ok $row = $v->next(), "Next row"; is $row->chromosome($h), "20", "Chromosome value read" ; is $row->get_format_type($h,"DP"), "Integer", "int format type correct"; - is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], "format int read"); + is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], "format int read"); is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read'); is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read'); note "!!! Not sure this is correct !!!"; is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read'); is_deeply($row->get_format($h), { - GT => [2,3,4,3,4,4], + GT => [3,3,5,3,4,4], GQ => [48,48,43], DP => [1,8,5], HQ => [51,51,51,51,'-2147483648','-2147483648'] @@ -191,7 +191,7 @@ my $fmt_result = $row->get_genotypes($h) ; isa_ok($fmt_result, 'ARRAY'); #TODO resolve how these translate to the strings in htslib - is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ; + is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ; is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found'; is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found'; $info_result = $row->get_info($h); @@ -310,11 +310,11 @@ is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ; # format related tests - is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); + is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present'); is_deeply($row->get_format($h), { - GT => [2, 3, 2, 3, 2, 4], + GT => [3, 3, 3, 3, 2, 4], HQ => [10, 10, 10, 10, 3, 3] }, "format read"); @@ -336,11 +336,11 @@ is_deeply($info_result, {}, 'info read correctly'); # format related tests - is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); + is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present'); is_deeply($row->get_format($h), { - GT => [2, 3, 2, 3, 2, 4], + GT => [3, 3, 3, 3, 2, 4], HQ => [10, 10, 10, 10, 3, 3] }, "format read"); @@ -348,13 +348,13 @@ ok $row = $v->next(), "Next row"; is $row->chromosome($h), "20", "Chromosome value read" ; is $row->get_format_type($h,"DP"), "Integer", "int format type correct" ; - is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], 'format int read'); + is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], 'format int read'); is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read'); is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read'); note "!!! Not sure this is correct !!!"; is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read'); is_deeply($row->get_format($h), { - GT => [2,3,4,3,4,4], + GT => [3,3,5,3,4,4], GQ => [48,48,43], DP => [1,8,5], HQ => [51,51,51,51,'-2147483648','-2147483648'] @@ -363,7 +363,7 @@ my $fmt_result = $row->get_genotypes($h) ; isa_ok($fmt_result, 'ARRAY'); # TODO resolve how these translate to the strings in htslib - is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ; + is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ; is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found'; is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found'; $info_result = $row->get_info($h);