Skip to content

Commit

Permalink
Release 1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
daviesrob committed Apr 7, 2022
2 parents 580b52c + c2c26c9 commit c28190b
Show file tree
Hide file tree
Showing 30 changed files with 650 additions and 263 deletions.
2 changes: 1 addition & 1 deletion .ci_helpers/clone
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ branch=$3

ref=''
[ -n "$branch" ] && ref=$(git ls-remote --heads "$repository" "$branch" 2>/dev/null)
[ -z "$ref" ] && repository='git://github.com/samtools/htslib.git'
[ -z "$ref" ] && repository='https://github.com/samtools/htslib.git'

set -x
git clone --recurse-submodules --shallow-submodules --depth=1 ${ref:+--branch="$branch"} "$repository" "$localdir"
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ timeout_in: 10m
# clone with our own commands too.
clone_template: &HTSLIB_CLONE
htslib_clone_script: |
.ci_helpers/clone "git://github.com/${CIRRUS_REPO_OWNER}/htslib" "${HTSDIR}" "${CIRRUS_BRANCH}"
.ci_helpers/clone "https://github.com/${CIRRUS_REPO_OWNER}/htslib" "${HTSDIR}" "${CIRRUS_BRANCH}"
#--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ For the impatient

The latest source code can be downloaded from github and compiled using:

git clone --recurse-submodules git://github.com/samtools/htslib.git
git clone git://github.com/samtools/bcftools.git
git clone --recurse-submodules https://github.com/samtools/htslib.git
git clone https://github.com/samtools/bcftools.git
cd bcftools
# The following is optional:
# autoheader && autoconf && ./configure --enable-libgsl --enable-perl-filters
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ endif

include config.mk

PACKAGE_VERSION = 1.15
PACKAGE_VERSION = 1.15.1

# If building from a Git repository, replace $(PACKAGE_VERSION) with the Git
# description of the working tree: either a release tag with the same value
Expand Down Expand Up @@ -230,12 +230,13 @@ prob1_h = prob1.h $(htslib_vcf_h) $(call_h)
smpl_ilist_h = smpl_ilist.h $(htslib_vcf_h)
vcfbuf_h = vcfbuf.h $(htslib_vcf_h)
abuf_h = abuf.h $(htslib_vcf_h)
dbuf_h = dbuf.h $(htslib_vcf_h)
bam2bcf_h = bam2bcf.h $(htslib_hts_h) $(htslib_vcf_h)
bam_sample_h = bam_sample.h $(htslib_sam_h)

str_finder.o: str_finder.h utlist.h
main.o: main.c $(htslib_hts_h) config.h version.h $(bcftools_h)
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)
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)
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)
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)
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)
Expand Down
44 changes: 44 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
## Release 1.15.1 (7th April 2022)


* bcftools annotate

- New `-H, --header-line` convenience option to pass a header line on command line,
this complements the existing `-h, --header-lines` option which requires a file
with header lines

* bcftools csq

- A list of consequence types supported by `bcftools csq` has been added to
the manual page. (#1671)

* bcftools +fill-tags

- Extend generalized functions so that FORMAT tags can be filled as well, for example:

bcftools +fill-tags in.bcf -o out.bcf -- -t 'FORMAT/DP:1=int(smpl_sum(FORMAT/AD))'

- Allow multiple custom functions in a single run. Previously the program would silently
go with the last one, assigning the same values to all (#1684)

* bcftools norm

- Fix an assertion failure triggered when a faulty VCF file with a '-'
character in the REF allele was used with `bcftools norm --atomize`. This
option now checks that the REF allele only includes the allowed characters
A, C, G, T and N. (#1668)

- Fix the loss of phasing in half-missing genotypes in variant atomization (#1689)

* bcftools roh

- Fix a bug that could result in an endless loop or incorrect AF estimate when
missing genotypes are present and the `--estimate-AF -` option was used (#1687)

* bcftools +split-vep

- VEP fields with characters disallowed in VCF tag names by the specification (such as '-'
in 'M-CAP') couldn't be queried. This has been fixed, the program now sanitizes the field
names, replacing invalid characters with underscore (#1686)


## Release 1.15 (21st February 2022)


Expand Down
21 changes: 12 additions & 9 deletions abuf.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* The MIT License
Copyright (c) 2021 Genome Research Ltd.
Copyright (c) 2021-2022 Genome Research Ltd.
Author: Petr Danecek <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -117,7 +117,7 @@ void abuf_set(abuf_t *buf, abuf_opt_t key, void *value)
if ( key==INFO_TAG )
{
buf->split.info_tag = *((char**)value);
bcf_hdr_printf(buf->out_hdr,"##INFO=<ID=%s,Number=1,Type=String,Description=\"Original variant. Format: CHR|POS|REF|ALT|USED_ALT_IDX\">",buf->split.info_tag);
bcf_hdr_printf(buf->out_hdr,"##INFO=<ID=%s,Number=1,Type=String,Description=\"Original variant. Format: CHR|POS|REF|ALT|USED_ALT_IDX\">",buf->split.info_tag);
return;
}
if ( key==STAR_ALLELE ) { buf->star_allele = *((int*)value); return; }
Expand All @@ -141,7 +141,7 @@ static void _atomize_allele(abuf_t *buf, bcf1_t *rec, int ial)
while ( rlen>1 && alen>1 && ref[rlen-1]==alt[alen-1] ) rlen--, alen--;
int Mlen = rlen > alen ? rlen : alen;

atom_t *atom = NULL;
atom_t *atom = NULL;
int i;
for (i=0; i<Mlen; i++)
{
Expand Down Expand Up @@ -374,7 +374,7 @@ static void _split_table_set_info(abuf_t *buf, bcf_info_t *info, merge_rule_t mo
memcpy(buf->tmp2+num_size,missing_ptr,num_size);
else
memcpy(buf->tmp2+num_size,buf->tmp+num_size*iori,num_size);
if ( type==BCF_HT_INT && mode==M_SUM )
if ( type==BCF_HT_INT && mode==M_SUM )
{
uint8_t *tbl = buf->split.tbl + iout*buf->split.nori;
for (i=iori; i<buf->split.nori; i++)
Expand Down Expand Up @@ -466,7 +466,10 @@ static void _split_table_set_gt(abuf_t *buf)
error("Out-of-bounds genotypes at %s:%"PRIhts_pos"\n",bcf_seqname(buf->hdr,rec),rec->pos+1);
int ial = _split_table_get_ial(buf,iout,iori);
if ( ial==2 && !star_allele )
{
dst[j] = bcf_gt_missing;
if ( bcf_gt_is_phased(src[j]) ) dst[j] |= 1;
}
else
dst[j] = bcf_gt_is_phased(src[j]) ? bcf_gt_phased(ial) : bcf_gt_unphased(ial);
}
Expand Down Expand Up @@ -542,7 +545,7 @@ static void _split_table_set_format(abuf_t *buf, bcf_fmt_t *fmt, merge_rule_t mo
{
int star_allele = _has_star_allele(buf,iout);
bcf1_t *out = buf->vcf[rbuf_kth(&buf->rbuf,iout)];
int ret = 0;
int ret = 0;
if ( len==BCF_VL_FIXED || len==BCF_VL_VAR )
ret = bcf_update_format(buf->out_hdr, out, tag, buf->tmp, nval, type);
else if ( len==BCF_VL_A && type!=BCF_HT_STR )
Expand Down Expand Up @@ -707,7 +710,7 @@ void _abuf_split(abuf_t *buf, bcf1_t *rec)
buf->vcf[j] = bcf_dup(rec);
return;
}
for (i=1; i<rec->n_allele; i++)
for (i=0; i<rec->n_allele; i++)
{
if ( _is_acgtn(rec->d.allele[i]) ) continue;
rbuf_expand0(&buf->rbuf, bcf1_t*, buf->rbuf.n+1, buf->vcf);
Expand Down
71 changes: 71 additions & 0 deletions dbuf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* The MIT License
Copyright (c) 2022 Genome Research Ltd.
Author: Petr Danecek <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/*
Simple data buffer
*/

#ifndef __DBUF_H__
#define __DBUF_H__

#include <htslib/hts.h>

typedef struct
{
size_t n,m;
void **dat;
}
dbuf_t;

static inline dbuf_t *dbuf_push(dbuf_t *buf, void *ptr)
{
if ( !buf ) buf = calloc(1,sizeof(dbuf_t));
buf->n++;
hts_expand(void*,buf->n,buf->m,buf->dat);
buf->dat[buf->n-1] = ptr;
return buf;
}

static inline void *dbuf_ith(dbuf_t *buf, int i)
{
return buf->dat[i];
}

static inline size_t dbuf_n(dbuf_t *buf)
{
return buf->n;
}

static inline void dbuf_destroy_free(dbuf_t *buf)
{
int i;
for (i=0; i<buf->n; i++) free(buf->dat[i]);
free(buf->dat);
free(buf);
}

#endif

39 changes: 36 additions & 3 deletions doc/bcftools.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: bcftools
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.16.dev
.\" Date: 2022-02-21
.\" Date: 2022-04-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "BCFTOOLS" "1" "2022-02-21" "\ \&" "\ \&"
.TH "BCFTOOLS" "1" "2022-04-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -51,7 +51,7 @@ standard input (stdin) and outputs to the standard output (stdout). Several
commands can thus be combined with Unix pipes.
.SS "VERSION"
.sp
This manual page was last updated \fB2022\-02\-21\fP and refers to bcftools git version \fB1.15\fP.
This manual page was last updated \fB2022\-04\-07\fP and refers to bcftools git version \fB1.15.1\fP.
.SS "BCF1"
.sp
The BCF1 format output by versions of samtools <= 0.1.19 is \fBnot\fP
Expand Down Expand Up @@ -2177,6 +2177,39 @@ see \fBCommon Options\fP
.fam
.fi
.if n .RE
.sp
\fBSupported consequence types\fP
.sp
.if n .RS 4
.nf
.fam C
3_prime_utr
5_prime_utr
coding_sequence
feature_elongation
frameshift
inframe_altering
inframe_deletion
inframe_insertion
intergenic
intron
missense
non_coding
splice_acceptor
splice_donor
splice_region
start_lost
start_retained
stop_gained
stop_lost
stop_retained
synonymous
.fam
.fi
.if n .RE
.sp
See also \c
.URL "https://ensembl.org/info/genome/variation/prediction/predicted_data.html" "" ""
.SS "bcftools filter \fI[OPTIONS]\fP \fIFILE\fP"
.sp
Apply fixed\-threshold filters.
Expand Down
35 changes: 33 additions & 2 deletions doc/bcftools.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2 id="_description">DESCRIPTION</h2>
<div class="sect2">
<h3 id="_version">VERSION</h3>
<div class="paragraph">
<p>This manual page was last updated <strong>2022-02-21</strong> and refers to bcftools git version <strong>1.15</strong>.</p>
<p>This manual page was last updated <strong>2022-04-07</strong> and refers to bcftools git version <strong>1.15.1</strong>.</p>
</div>
</div>
<div class="sect2">
Expand Down Expand Up @@ -1911,6 +1911,37 @@ <h3 id="csq">bcftools csq <em>[OPTIONS]</em> <em>FILE</em></h3>
BCSQ=*missense|PER3|ENST00000361923|+|1028M&gt;1028T|7890117T&gt;C</pre>
</div>
</div>
<div class="paragraph">
<p><strong>Supported consequence types</strong></p>
</div>
<div class="listingblock">
<div class="content">
<pre>3_prime_utr
5_prime_utr
coding_sequence
feature_elongation
frameshift
inframe_altering
inframe_deletion
inframe_insertion
intergenic
intron
missense
non_coding
splice_acceptor
splice_donor
splice_region
start_lost
start_retained
stop_gained
stop_lost
stop_retained
synonymous</pre>
</div>
</div>
<div class="paragraph">
<p>See also <a href="https://ensembl.org/info/genome/variation/prediction/predicted_data.html" class="bare">https://ensembl.org/info/genome/variation/prediction/predicted_data.html</a></p>
</div>
</div>
<div class="sect2">
<h3 id="filter">bcftools filter <em>[OPTIONS]</em> <em>FILE</em></h3>
Expand Down Expand Up @@ -4988,7 +5019,7 @@ <h2 id="_copying">COPYING</h2>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2022-02-21 11:43:27 UTC
Last updated 2022-04-07 16:32:56 +0100
</div>
</div>
</body>
Expand Down
Loading

0 comments on commit c28190b

Please sign in to comment.