Skip to content

Commit bb75b76

Browse files
committed
Release 1.19
2 parents 6c2c1e9 + 37cf779 commit bb75b76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2035
-743
lines changed

Makefile

+16-13
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ endif
104104

105105
include config.mk
106106

107-
PACKAGE_VERSION = 1.18
107+
PACKAGE_VERSION = 1.19
108108

109109
# If building from a Git repository, replace $(PACKAGE_VERSION) with the Git
110110
# description of the working tree: either a release tag with the same value
@@ -233,28 +233,31 @@ abuf_h = abuf.h $(htslib_vcf_h)
233233
dbuf_h = dbuf.h $(htslib_vcf_h)
234234
bam2bcf_h = bam2bcf.h $(htslib_hts_h) $(htslib_vcf_h)
235235
bam_sample_h = bam_sample.h $(htslib_sam_h)
236+
cigar_state_h = cigar_state.h $(htslib_hts_h) $(htslib_sam_h)
237+
read_consensus_h = read_consensus.h $(htslib_hts_h) $(htslib_sam_h)
238+
str_finder_h = str_finder.h utlist.h
236239

237-
str_finder.o: str_finder.h utlist.h
240+
str_finder.o: str_finder.c $(str_finder_h) utlist.h
238241
main.o: main.c $(htslib_hts_h) config.h version.h $(bcftools_h)
239242
vcfannotate.o: vcfannotate.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(bcftools_h) vcmp.h $(filter_h) $(convert_h) $(smpl_ilist_h) regidx.h $(htslib_khash_h) $(dbuf_h)
240243
vcfplugin.o: vcfplugin.c config.h $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(bcftools_h) vcmp.h $(filter_h)
241244
vcfcall.o: vcfcall.c $(htslib_vcf_h) $(htslib_kfunc_h) $(htslib_synced_bcf_reader_h) $(htslib_khash_str2int_h) $(bcftools_h) $(call_h) $(prob1_h) $(ploidy_h) $(gvcf_h) regidx.h $(vcfbuf_h)
242245
vcfconcat.o: vcfconcat.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_tbx_h) $(htslib_thread_pool_h) $(bcftools_h)
243246
vcfconvert.o: vcfconvert.c $(htslib_faidx_h) $(htslib_vcf_h) $(htslib_bgzf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_kseq_h) $(bcftools_h) $(filter_h) $(convert_h) $(tsv2vcf_h)
244247
vcffilter.o: vcffilter.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(bcftools_h) $(filter_h) rbuf.h regidx.h
245-
vcfgtcheck.o: vcfgtcheck.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_kbitset_h) $(htslib_hts_os_h) $(bcftools_h) extsort.h
248+
vcfgtcheck.o: vcfgtcheck.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_kbitset_h) $(htslib_hts_os_h) $(htslib_bgzf_h) $(bcftools_h) extsort.h filter.h
246249
vcfindex.o: vcfindex.c $(htslib_vcf_h) $(htslib_tbx_h) $(htslib_kstring_h) $(htslib_bgzf_h) $(bcftools_h)
247250
vcfisec.o: vcfisec.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_hts_os_h) $(bcftools_h) $(filter_h)
248-
vcfmerge.o: vcfmerge.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_faidx_h) regidx.h $(bcftools_h) vcmp.h $(htslib_khash_h)
249-
vcfnorm.o: vcfnorm.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_faidx_h) $(htslib_khash_str2int_h) $(bcftools_h) rbuf.h abuf.h gff.h
251+
vcfmerge.o: vcfmerge.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_faidx_h) $(htslib_kbitset_h) $(htslib_hts_endian_h) $(bcftools_h) regidx.h vcmp.h $(htslib_khash_h) $(htslib_kbitset_h)
252+
vcfnorm.o: vcfnorm.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_faidx_h) $(htslib_khash_str2int_h) $(bcftools_h) rbuf.h abuf.h gff.h regidx.h
250253
vcfquery.o: vcfquery.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_khash_str2int_h) $(htslib_vcfutils_h) $(bcftools_h) $(filter_h) $(convert_h) $(smpl_ilist_h)
251254
vcfroh.o: vcfroh.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(bcftools_h) HMM.h $(smpl_ilist_h) $(filter_h)
252255
vcfcnv.o: vcfcnv.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_kstring_h) $(htslib_kfunc_h) $(htslib_khash_str2int_h) $(bcftools_h) HMM.h rbuf.h
253256
vcfhead.o: vcfhead.c $(htslib_kstring_h) $(htslib_vcf_h) $(bcftools_h)
254257
vcfsom.o: vcfsom.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_hts_os_h) $(bcftools_h)
255258
vcfsort.o: vcfsort.c $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_hts_os_h) kheap.h $(bcftools_h)
256259
vcfstats.o: vcfstats.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(htslib_faidx_h) $(bcftools_h) $(filter_h) bin.h dist.h
257-
vcfview.o: vcfview.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(bcftools_h) $(filter_h) $(htslib_khash_str2int_h)
260+
vcfview.o: vcfview.c $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_vcfutils_h) $(bcftools_h) $(filter_h) $(htslib_khash_str2int_h) $(htslib_kbitset_h)
258261
reheader.o: reheader.c $(htslib_vcf_h) $(htslib_bgzf_h) $(htslib_tbx_h) $(htslib_kseq_h) $(htslib_thread_pool_h) $(htslib_faidx_h) $(htslib_khash_str2int_h) $(bcftools_h) $(khash_str2str_h)
259262
tabix.o: tabix.c $(htslib_bgzf_h) $(htslib_tbx_h)
260263
ccall.o: ccall.c $(htslib_kfunc_h) $(call_h) kmin.h $(prob1_h)
@@ -275,12 +278,12 @@ bin.o: bin.c $(bcftools_h) bin.h
275278
dist.o: dist.c dist.h
276279
cols.o: cols.c cols.h
277280
regidx.o: regidx.c $(htslib_hts_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) regidx.h
278-
consensus.o: consensus.c $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_bgzf_h) regidx.h $(bcftools_h) rbuf.h $(filter_h)
281+
consensus.o: consensus.c $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_bgzf_h) regidx.h $(bcftools_h) rbuf.h $(filter_h) $(smpl_ilist_h)
279282
mpileup.o: mpileup.c $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h) $(htslib_khash_str2int_h) $(htslib_hts_os_h) regidx.h $(bcftools_h) $(bam2bcf_h) $(bam_sample_h) $(gvcf_h)
280283
bam2bcf.o: bam2bcf.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_kstring_h) $(htslib_kfunc_h) $(bam2bcf_h) mw.h
281-
bam2bcf_indel.o: bam2bcf_indel.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_str2int_h) $(bam2bcf_h) $(htslib_ksort_h) str_finder.h
282-
bam2bcf_iaux.o: bam2bcf_iaux.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_str2int_h) $(bam2bcf_h) $(htslib_ksort_h) str_finder.h read_consensus.h cigar_state.h
283-
read_consensus.o: read_consensus.c read_consensus.h cigar_state.h $(htslib_hts_h) $(htslib_sam_h)
284+
bam2bcf_indel.o: bam2bcf_indel.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_str2int_h) $(bam2bcf_h) $(htslib_ksort_h) $(str_finder_h)
285+
bam2bcf_iaux.o: bam2bcf_iaux.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_str2int_h) $(bcftools_h) $(bam2bcf_h) $(htslib_ksort_h) $(read_consensus_h) $(cigar_state_h)
286+
read_consensus.o: read_consensus.c $(read_consensus_h) $(cigar_state_h) $(bcftools_h) kheap.h
284287
bam_sample.o: bam_sample.c $(htslib_hts_h) $(htslib_kstring_h) $(htslib_khash_str2int_h) $(khash_str2str_h) $(bam_sample_h) $(bcftools_h)
285288
version.o: version.h version.c
286289
hclust.o: hclust.c $(htslib_hts_h) $(htslib_kstring_h) $(bcftools_h) hclust.h
@@ -289,8 +292,8 @@ vcfbuf.o: vcfbuf.c $(htslib_vcf_h) $(htslib_vcfutils_h) $(htslib_hts_os_h) $(bcf
289292
abuf.o: abuf.c $(htslib_vcf_h) $(bcftools_h) rbuf.h abuf.h
290293
extsort.o: extsort.c $(bcftools_h) extsort.h kheap.h
291294
smpl_ilist.o: smpl_ilist.c $(bcftools_h) $(smpl_ilist_h)
292-
gff.o: gff.c gff.h regidx.h
293-
csq.o: csq.c $(htslib_hts_h) $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_khash_h) $(htslib_khash_str2int_h) $(htslib_kseq_h) $(htslib_faidx_h) $(bcftools_h) $(filter_h) regidx.h kheap.h $(smpl_ilist_h) rbuf.h
295+
gff.o: gff.c $(htslib_hts_h) $(htslib_khash_h) $(htslib_khash_str2int_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(bcftools_h) gff.h regidx.h
296+
csq.o: csq.c $(htslib_hts_h) $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(htslib_khash_h) $(htslib_khash_str2int_h) $(htslib_kseq_h) $(htslib_faidx_h) $(htslib_bgzf_h) $(bcftools_h) $(filter_h) regidx.h kheap.h $(smpl_ilist_h) rbuf.h gff.h
294297

295298
# test programs
296299

@@ -300,7 +303,7 @@ csq.o: csq.c $(htslib_hts_h) $(htslib_vcf_h) $(htslib_synced_bcf_reader_h) $(hts
300303
#
301304
# If using MSYS, avoid poor shell expansion via:
302305
# MSYS2_ARG_CONV_EXCL="*" make check
303-
check test-no-plugins: $(PROGRAMS) $(TEST_PROGRAMS) $(BGZIP) $(TABIX)
306+
check-no-plugins test-no-plugins: $(PROGRAMS) $(TEST_PROGRAMS) $(BGZIP) $(TABIX)
304307
./test/test-rbuf
305308
./test/test-regidx
306309
REF_PATH=: ./test/test.pl --exec bgzip=$(BGZIP) --exec tabix=$(TABIX) --htsdir=$(HTSDIR) $${TEST_OPTS:-}

NEWS

+123-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,127 @@
1-
## Release 1.18 (25th July 2023)
1+
## Release 1.19 (12th December 2023)
2+
3+
4+
Changes affecting the whole of bcftools, or multiple commands:
5+
6+
* Filtering expressions can be given a file with list of strings to match, this
7+
was previously possible only for the ID column. For example
8+
9+
ID=@file .. selects lines with ID present in the file
10+
INFO/[email protected] .. selects lines where TAG has a string value listed in the file
11+
INFO/[email protected] .. TAG must not have a string value listed in the file
12+
13+
Allow to query REF,ALT columns directly, for example
14+
15+
-e 'REF="N"'
16+
17+
18+
Changes affecting specific commands:
19+
20+
* bcftools annotate
21+
22+
- Fix `bcftools annotate --mark-sites`, VCF sites overlapping regions in a BED file
23+
were not annotated (#1989)
24+
25+
- Add flexibility to FILTER column transfers and allow transfers within the same file,
26+
across files, and in combination. For examples see
27+
http://samtools.github.io/bcftools/howtos/annotate.html#transfer_filter_to_info
28+
29+
* bcftools call
30+
31+
- Output MIN_DP rather than MinDP in gVCF mode
32+
33+
- New `-*, --keep-unseen-allele` option to output the unobserved allele <*>,
34+
intended for gVCF.
35+
36+
* bcftools head
37+
38+
- New `-s, --samples` option to include the #CHROM header line with samples.
39+
40+
* bcftools gtcheck
41+
42+
- Add output options `-o, --output` and `-O, --output-type`
43+
44+
- Add filtering options `-i, --include` and `-e, --exclude`
45+
46+
- Rename the short option `-e, --error-probability` from lower case to upper
47+
case `-E, --error-probability`
48+
49+
- Changes to the output format, replace the DC section with DCv2:
50+
51+
- adds a new column for the number of matching genotypes
52+
53+
- The --error-probability is newly interpreted as the probability of erroneous
54+
allele rather than genotype. In other words, the calculation of the discordance
55+
score now considers the probability of genotyping error to be different
56+
for HOM and HET genotypes, i.e. P(0/1|dsg=0) > P(1/1|dsg=0).
57+
58+
- fixes in HWE score calculation plus output average HWE score rather
59+
than absolute HWE score
60+
61+
- better description of fields
262

63+
* bcftools merge
64+
65+
- Add `-m` modifiers to suppress the output of the unseen allele <*> or <NON_REF>
66+
at variant sites (e.g. `-m both,*`) or all sites (e.g. `-m both,**`)
67+
68+
* bcftools mpileup
69+
70+
- Output MIN_DP rather than MinDP in gVCF mode
71+
72+
* bcftools norm
73+
74+
- Add the number of joined lines to the summary output, for example
75+
76+
Lines total/split/joined/realigned/skipped: 6/0/3/0/0
77+
78+
- Allow combining -m and -a with --old-rec-tag (#2020)
79+
80+
- Symbolic <DEL> alleles caused norm to expand REF to the full length of the deletion.
81+
This was not intended and problematic for long deletions, the REF allele should list
82+
one base only (#2029)
83+
84+
* bcftools query
85+
86+
- Add new `-N, --disable-automatic-newline` option for pre-1.18 query formatting behavior
87+
when newline would not be added when missing
88+
89+
- Make the automatic addition of the newline character in a more predictable way and,
90+
when missing, always put it at the end of the expression. In version 1.18 it could
91+
be added at the end of the expression (for per-site expressions) or inside the square
92+
brackets (for per-sample expressions). The new behavior is:
93+
94+
- if the formatting expression contains a newline character, do nothing
95+
- if there is no newline character and -N, --disable-automatic-newline is given, do nothing
96+
- if there is no newline character and -N is not given, insert newline at the end of the expression
97+
98+
See #1969 for details
99+
100+
- Add new `-F, --print-filtered` option to output a default string for samples that would otherwise
101+
be filtered by `-i/-e` expressions.
102+
103+
- Include sample name in the output header with `-H` whenever it makes sense (#1992)
104+
105+
* bcftools +spit-vep
106+
107+
- Fix on the fly filtering involving numeric subfields, e.g. `-i 'MAX_AF<0.001'` (#2039)
108+
109+
- Interpret default column type names (--columns-types) as entire strings, rather than
110+
substrings to avoid unexpected spurious matches (i.e. internally add ^ and $ to all
111+
field names)
112+
113+
* bcftools +trio-dnm2
114+
115+
- Do not flag paternal genotyping errors as de novo mutations. Specifically, when father's
116+
chrX genotype is 0/1 and mother's 0/0, 0/1 in the child will not be marked as DNM.
117+
118+
* bcftools view
119+
120+
- Add new `-A, --trim-unseen-allele` option to remove the unseen allele <*> or <NON_REF>
121+
at variant sites (`-A`) or all sites (`-AA`)
122+
123+
124+
## Release 1.18 (25th July 2023)
3125

4126
Changes affecting the whole of bcftools, or multiple commands:
5127

abuf.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ static void _split_table_set_info(abuf_t *buf, bcf_info_t *info, merge_rule_t mo
411411
buf->tmp2 = dst.s;
412412
ret = bcf_update_info(buf->out_hdr, out, tag, buf->tmp2, dst.l, type);
413413
}
414-
if ( ret!=0 ) error("An error occurred while updating INFO/%s\n",tag);
414+
if ( ret!=0 ) error("An error occurred while updating INFO/%s (errcode=%d)\n",tag,ret);
415415
}
416416
}
417417
static void _split_table_set_history(abuf_t *buf)
418418
{
419-
int i,j;
419+
int i,j,ret;
420420
bcf1_t *rec = buf->split.rec;
421421
buf->tmps.l = 0;
422422
ksprintf(&buf->tmps,"%s|%"PRIhts_pos"|%s|",bcf_seqname(buf->hdr,rec),rec->pos+1,rec->d.allele[0]);
@@ -441,8 +441,8 @@ static void _split_table_set_history(abuf_t *buf)
441441
kputc(',',&buf->tmps);
442442
}
443443
buf->tmps.s[--buf->tmps.l] = 0;
444-
if ( (bcf_update_info_string(buf->out_hdr, out, buf->split.info_tag, buf->tmps.s))!=0 )
445-
error("An error occurred while updating INFO/%s\n",buf->split.info_tag);
444+
if ( (ret=bcf_update_info_string(buf->out_hdr, out, buf->split.info_tag, buf->tmps.s))!=0 )
445+
error("An error occurred while updating INFO/%s (errcode=%d)\n",buf->split.info_tag,ret);
446446
}
447447
}
448448
static void _split_table_set_gt(abuf_t *buf)
@@ -668,7 +668,7 @@ static void _split_table_set_format(abuf_t *buf, bcf_fmt_t *fmt, merge_rule_t mo
668668
#undef BRANCH
669669
ret = bcf_update_format(buf->out_hdr, out, tag, buf->tmp2, 3*(1+star_allele)*nsmpl, type);
670670
}
671-
if ( ret!=0 ) error("An error occurred while updating FORMAT/%s\n",tag);
671+
if ( ret!=0 ) error("An error occurred while updating FORMAT/%s (errcode=%d)\n",tag,ret);
672672
}
673673
}
674674
static inline int _is_acgtn(char *seq)

bcftools.h

+12
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,16 @@ static inline int bcf_double_test(double d, uint64_t value)
141141
#define bcf_double_is_missing(x) bcf_double_test((x),bcf_double_missing)
142142
#define bcf_double_is_missing_or_vector_end(x) (bcf_double_test((x),bcf_double_missing) || bcf_double_test((x),bcf_double_vector_end))
143143

144+
static inline int get_unseen_allele(bcf1_t *line)
145+
{
146+
int i;
147+
for (i=1; i<line->n_allele; i++)
148+
{
149+
if ( !strcmp(line->d.allele[i],"<*>") ) return i;
150+
if ( !strcmp(line->d.allele[i],"<NON_REF>") ) return i;
151+
if ( !strcmp(line->d.allele[i],"<X>") ) return i;
152+
}
153+
return 0;
154+
}
155+
144156
#endif

call.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ THE SOFTWARE. */
3333
#define CALL_VARONLY (1<<1)
3434
#define CALL_CONSTR_TRIO (1<<2)
3535
#define CALL_CONSTR_ALLELES (1<<3)
36-
//
36+
#define CALL_KEEP_UNSEEN (1<<4)
3737
#define CALL_FMT_PV4 (1<<5)
3838
#define CALL_FMT_GQ (1<<6)
3939
#define CALL_FMT_GP (1<<7)
@@ -125,8 +125,7 @@ call_t;
125125
void error(const char *format, ...);
126126

127127
/*
128-
* call() - return -1 value on critical error; -2 to skip the site; or the number of non-reference
129-
* alleles on success.
128+
* call() - return -1 value on critical error; -2 to skip the site; or the number of alleles on success
130129
*/
131130
int mcall(call_t *call, bcf1_t *rec); // multiallic and rare-variant calling model
132131
int ccall(call_t *call, bcf1_t *rec); // the default consensus calling model

0 commit comments

Comments
 (0)