Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated but missing FORMAT bug #1761

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/noroundtrip-out.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
##FILTER=<ID=PASS,Description="All filters passed">
##contig=<ID=3>
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=S,Number=1,Type=String,Description="Non-GT string">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA1
3 50 . A T 0 PASS . GT 0/1
3 60 . T C 0 PASS . GT 0/1
3 70 . G A 0 PASS . GT 0/1
3 80 . C G 0 PASS . GT 0/1
3 90 . A G 0 PASS . GT:S 0/1:.
2 changes: 2 additions & 0 deletions test/noroundtrip.vcf
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
##fileformat=VCFv4.3
##contig=<ID=3>
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=S,Number=1,Type=String,Description="Non-GT string">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA1
3 50 . A T 0 PASS . GT:GT 0/1
3 60 . T C 0 PASS . GT 0/1
3 70 . G A 0 PASS . GT:GT 0/1:.
3 80 . C G 0 PASS . GT:GT 0/1:0/1
3 90 . A G 0 PASS . GT:S:S 0/1
4 changes: 4 additions & 0 deletions vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3234,6 +3234,10 @@ static int vcf_parse_format_fill5(kstring_t *s, const bcf_hdr_t *h, bcf1_t *v,
fmt_aux_t *z = &fmt[j];
const int htype = z->y>>4&0xf;
int l;

if (z->size == -1) // this field is to be ignored
continue;

if (htype == BCF_HT_STR) {
if (z->is_gt) {
int32_t *x = (int32_t*)(z->buf + z->size * (size_t)m);
Expand Down