diff --git a/Makefile b/Makefile index e15f2cf4f..ad87f022b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/NEWS b/NEWS index f2993366b..1d022703b 100644 --- a/NEWS +++ b/NEWS @@ -1,14 +1,24 @@ ## Release a.b + * New plugin `bcftools +variant-distance` to annotate records with distance to the nearest variant (#1690) + +## 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: @@ -20,6 +30,11 @@ * 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 diff --git a/consensus.c b/consensus.c index 8b3831bde..84ae905b7 100644 --- a/consensus.c +++ b/consensus.c @@ -123,9 +123,17 @@ typedef struct } args_t; +static void destroy_chain(chain_t *chain) +{ + if ( !chain ) return; + free(chain->ref_gaps); + free(chain->alt_gaps); + free(chain->block_lengths); + free(chain); +} static chain_t* init_chain(chain_t *chain, int ref_ori_pos) { -// fprintf(stderr, "init_chain(*chain, ref_ori_pos=%d)\n", ref_ori_pos); + if ( chain ) destroy_chain(chain); chain = (chain_t*) calloc(1,sizeof(chain_t)); chain->num = 0; chain->block_lengths = NULL; @@ -137,18 +145,6 @@ static chain_t* init_chain(chain_t *chain, int ref_ori_pos) return chain; } -static void destroy_chain(args_t *args) -{ - chain_t *chain = args->chain; - free(chain->ref_gaps); - free(chain->alt_gaps); - free(chain->block_lengths); - free(chain); - chain = NULL; - free(args->chr); - args->chr = NULL; -} - static void print_chain(args_t *args) { /* @@ -197,7 +193,7 @@ static void print_chain(args_t *args) static void push_chain_gap(chain_t *chain, int ref_start, int ref_len, int alt_start, int alt_len) { -// fprintf(stderr, "push_chain_gap(*chain, ref_start=%d, ref_len=%d, alt_start=%d, alt_len=%d)\n", ref_start, ref_len, alt_start, alt_len); + // fprintf(stderr, "push_chain_gap(chain=%p, ref_start=%d, ref_len=%d, alt_start=%d, alt_len=%d)\n", chain, ref_start, ref_len, alt_start, alt_len); int num = chain->num; if (num && ref_start <= chain->ref_last_block_ori) { @@ -305,6 +301,7 @@ static void destroy_data(args_t *args) if ( args->chain_fname ) if ( fclose(args->fp_chain) ) error("Close failed: %s\n", args->chain_fname); if ( fclose(args->fp_out) ) error("Close failed: %s\n", args->output_fname); + destroy_chain(args->chain); } static void init_region(args_t *args, char *line) @@ -346,12 +343,8 @@ static void init_region(args_t *args, char *line) bcf_sr_seek(args->files,line,args->fa_ori_pos); if ( tmp_ptr ) *tmp_ptr = tmp; fprintf(args->fp_out,">%s%s\n",args->chr_prefix?args->chr_prefix:"",line); - if (args->chain_fname ) - { + if ( args->chain_fname ) args->chain = init_chain(args->chain, args->fa_ori_pos); - } else { - args->chain = NULL; - } } static bcf1_t **next_vcf_line(args_t *args) @@ -949,10 +942,8 @@ static void consensus(args_t *args) if ( str.s[0]=='>' ) { // new sequence encountered - if (args->chain) { - print_chain(args); - destroy_chain(args); - } + if ( args->chain ) print_chain(args); + // apply all cached variants and variants that might have been missed because of short fasta (see test/consensus.9.*) bcf1_t **rec_ptr = NULL; while ( args->rid>=0 && (rec_ptr = next_vcf_line(args)) ) @@ -1026,11 +1017,7 @@ static void consensus(args_t *args) if ( args->fa_ori_pos + args->fa_buf.l - args->fa_mod_off <= rec->pos ) break; apply_variant(args, rec); } - if (args->chain) - { - print_chain(args); - destroy_chain(args); - } + if (args->chain) print_chain(args); if ( args->absent_allele ) apply_absent(args, HTS_POS_MAX); flush_fa_buffer(args, 0); bgzf_close(fasta); diff --git a/doc/bcftools.1 b/doc/bcftools.1 index a90ef17d9..006111fff 100644 --- a/doc/bcftools.1 +++ b/doc/bcftools.1 @@ -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 @@ -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 @@ -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. diff --git a/doc/bcftools.html b/doc/bcftools.html index febeaa9c9..d9afe6803 100644 --- a/doc/bcftools.html +++ b/doc/bcftools.html @@ -50,7 +50,7 @@

DESCRIPTION

VERSION

-

This manual page was last updated 2022-02-21 and refers to bcftools git version 1.15.

+

This manual page was last updated 2022-04-07 and refers to bcftools git version 1.15.1.

@@ -1911,6 +1911,37 @@

bcftools csq [OPTIONS] FILE

BCSQ=*missense|PER3|ENST00000361923|+|1028M>1028T|7890117T>C
+
+

Supported consequence types

+
+
+
+
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
+
+
+
+

See also https://ensembl.org/info/genome/variation/prediction/predicted_data.html

+

bcftools filter [OPTIONS] FILE

@@ -4988,7 +5019,7 @@

COPYING

diff --git a/version.sh b/version.sh index 28dd9e6f8..0e51fdd0a 100755 --- a/version.sh +++ b/version.sh @@ -24,7 +24,7 @@ # DEALINGS IN THE SOFTWARE. # Master version, for use in tarballs or non-git source copies -VERSION=1.15 +VERSION=1.15.1 # If we have a git clone, then check against the current tag if [ -e .git ]