| 1 |
Author: Andreas Tille <[email protected]> |
| 2 |
Last-Update: 2026-09-21 |
| 3 |
Description: Update GT values expected by t/05vcf.t for htslib >= 1.22 |
| 4 |
htslib >= 1.22 fixed the encoding of the first allele of a phased |
| 5 |
genotype (the phasing bit of the first allele is now set correctly |
| 6 |
for VCF < 4.4 input and BCF files). The t/05vcf.t test hard-coded |
| 7 |
the old, incorrect GT values, so it failed with the latest htslib. |
| 8 |
This patch updates the expected GT values to match the new, spec |
| 9 |
conformant encoding. |
| 10 |
|
| 11 |
--- a/t/05vcf.t |
| 12 |
+++ b/t/05vcf.t |
| 13 |
@@ -138,11 +138,11 @@ |
| 14 |
is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ; |
| 15 |
|
| 16 |
# format related tests |
| 17 |
- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); |
| 18 |
+ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); |
| 19 |
is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); |
| 20 |
is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present'); |
| 21 |
is_deeply($row->get_format($h), { |
| 22 |
- GT => [2, 3, 2, 3, 2, 4], |
| 23 |
+ GT => [3, 3, 3, 3, 2, 4], |
| 24 |
HQ => [10, 10, 10, 10, 3, 3] |
| 25 |
}, "format read"); |
| 26 |
|
| 27 |
@@ -164,11 +164,11 @@ |
| 28 |
is_deeply($info_result, {}, 'info read correctly'); |
| 29 |
|
| 30 |
# format related tests |
| 31 |
- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); |
| 32 |
+ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); |
| 33 |
is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); |
| 34 |
is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present'); |
| 35 |
is_deeply($row->get_format($h), { |
| 36 |
- GT => [2, 3, 2, 3, 2, 4], |
| 37 |
+ GT => [3, 3, 3, 3, 2, 4], |
| 38 |
HQ => [10, 10, 10, 10, 3, 3] |
| 39 |
}, "format read"); |
| 40 |
|
| 41 |
@@ -176,13 +176,13 @@ |
| 42 |
ok $row = $v->next(), "Next row"; |
| 43 |
is $row->chromosome($h), "20", "Chromosome value read" ; |
| 44 |
is $row->get_format_type($h,"DP"), "Integer", "int format type correct"; |
| 45 |
- is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], "format int read"); |
| 46 |
+ is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], "format int read"); |
| 47 |
is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read'); |
| 48 |
is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read'); |
| 49 |
note "!!! Not sure this is correct !!!"; |
| 50 |
is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read'); |
| 51 |
is_deeply($row->get_format($h), { |
| 52 |
- GT => [2,3,4,3,4,4], |
| 53 |
+ GT => [3,3,5,3,4,4], |
| 54 |
GQ => [48,48,43], |
| 55 |
DP => [1,8,5], |
| 56 |
HQ => [51,51,51,51,'-2147483648','-2147483648'] |
| 57 |
@@ -191,7 +191,7 @@ |
| 58 |
my $fmt_result = $row->get_genotypes($h) ; |
| 59 |
isa_ok($fmt_result, 'ARRAY'); |
| 60 |
#TODO resolve how these translate to the strings in htslib |
| 61 |
- is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ; |
| 62 |
+ is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ; |
| 63 |
is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found'; |
| 64 |
is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found'; |
| 65 |
$info_result = $row->get_info($h); |
| 66 |
@@ -310,11 +310,11 @@ |
| 67 |
is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ; |
| 68 |
|
| 69 |
# format related tests |
| 70 |
- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); |
| 71 |
+ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); |
| 72 |
is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); |
| 73 |
is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present'); |
| 74 |
is_deeply($row->get_format($h), { |
| 75 |
- GT => [2, 3, 2, 3, 2, 4], |
| 76 |
+ GT => [3, 3, 3, 3, 2, 4], |
| 77 |
HQ => [10, 10, 10, 10, 3, 3] |
| 78 |
}, "format read"); |
| 79 |
|
| 80 |
@@ -336,11 +336,11 @@ |
| 81 |
is_deeply($info_result, {}, 'info read correctly'); |
| 82 |
|
| 83 |
# format related tests |
| 84 |
- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read'); |
| 85 |
+ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read'); |
| 86 |
is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read'); |
| 87 |
is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present'); |
| 88 |
is_deeply($row->get_format($h), { |
| 89 |
- GT => [2, 3, 2, 3, 2, 4], |
| 90 |
+ GT => [3, 3, 3, 3, 2, 4], |
| 91 |
HQ => [10, 10, 10, 10, 3, 3] |
| 92 |
}, "format read"); |
| 93 |
|
| 94 |
@@ -348,13 +348,13 @@ |
| 95 |
ok $row = $v->next(), "Next row"; |
| 96 |
is $row->chromosome($h), "20", "Chromosome value read" ; |
| 97 |
is $row->get_format_type($h,"DP"), "Integer", "int format type correct" ; |
| 98 |
- is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], 'format int read'); |
| 99 |
+ is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], 'format int read'); |
| 100 |
is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read'); |
| 101 |
is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read'); |
| 102 |
note "!!! Not sure this is correct !!!"; |
| 103 |
is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read'); |
| 104 |
is_deeply($row->get_format($h), { |
| 105 |
- GT => [2,3,4,3,4,4], |
| 106 |
+ GT => [3,3,5,3,4,4], |
| 107 |
GQ => [48,48,43], |
| 108 |
DP => [1,8,5], |
| 109 |
HQ => [51,51,51,51,'-2147483648','-2147483648'] |
| 110 |
@@ -363,7 +363,7 @@ |
| 111 |
my $fmt_result = $row->get_genotypes($h) ; |
| 112 |
isa_ok($fmt_result, 'ARRAY'); |
| 113 |
# TODO resolve how these translate to the strings in htslib |
| 114 |
- is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ; |
| 115 |
+ is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ; |
| 116 |
is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found'; |
| 117 |
is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found'; |
| 118 |
$info_result = $row->get_info($h); |