Skip to content

Commit 762d1b1

Browse files
committed
Release 1.15
2 parents c37e041 + dde5d45 commit 762d1b1

35 files changed

+632
-105
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install:
2727
- set MSYSTEM=MINGW64
2828
- set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%PATH%
2929
- set MINGWPREFIX=x86_64-w64-mingw32
30-
- "sh -lc \"pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2 mingw-w64-x86_64-xz mingw-w64-x86_64-curl\""
30+
- "sh -lc \"pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2 mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-tools-git\""
3131

3232
build_script:
3333
- set HOME=.

.cirrus.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ ubuntu_task:
117117
<< : *TEST
118118

119119

120-
# CentOS
121-
centos_task:
122-
name: centos-gcc
120+
# Rocky Linux
121+
rocky_task:
122+
name: rockylinux-gcc
123123
container:
124-
image: centos:latest
124+
image: rockylinux:latest
125125
cpu: 2
126126
memory: 1G
127127

@@ -146,7 +146,7 @@ centos_task:
146146
macosx_task:
147147
name: macosx + clang
148148
osx_instance:
149-
image: catalina-base
149+
image: monterey-base
150150

151151
environment:
152152
CC: clang

INSTALL

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ library is used. Systems that do not have CCHmac will get this from
5353
libcrypto. libcrypto is part of OpenSSL or one of its derivatives (LibreSSL
5454
or BoringSSL).
5555

56-
On Microsoft Windows we recommend use of Mingw64/Msys2. Note that
57-
currently for the test harness to work you will need to override the
58-
test temporary directory with e.g.: make check TEST_OPTS="-t C:/msys64/tmp/_"
59-
Whilst the code may work on Windows with other environments, these have
60-
not been verified.
56+
On Microsoft Windows we recommend use of Mingw64/Msys2. Whilst the
57+
code may work on Windows with other environments, these have not been
58+
verified. Use of the configure script is a requirement too.
6159

6260
Update htscodecs submodule
6361
==========================
@@ -259,13 +257,37 @@ RedHat / CentOS
259257

260258
sudo yum install autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel
261259

260+
Note: On some versions perl FindBin will need to be installed to make the tests work.
261+
262+
sudo yum install perl-FindBin
263+
262264
Alpine Linux
263265
------------
264266

265-
sudo apk update # Ensure the package list is up to date
266-
sudo apk add autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev libressl-dev
267+
doas apk update # Ensure the package list is up to date
268+
doas apk add autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev libressl-dev
267269

268270
OpenSUSE
269271
--------
270272

271273
sudo zypper install autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel
274+
275+
Windows MSYS2/MINGW64
276+
---------------------
277+
278+
The configure script must be used as without it the compilation will
279+
likely fail.
280+
281+
Follow MSYS2 installation instructions at
282+
https://www.msys2.org/wiki/MSYS2-installation/
283+
284+
Then relaunch to MSYS2 shell using the "MSYS2 MinGW x64" executable.
285+
Once in that environment (check $MSYSTEM equals "MINGW64") install the
286+
compilers using pacman -S and the following package list:
287+
288+
base-devel mingw-w64-x86_64-toolchain
289+
mingw-w64-x86_64-libdeflate mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2
290+
mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-autotools
291+
mingw-w64-x86_64-tools-git
292+
293+
(The last is only needed for building libraries compatible with MSVC.)

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ according to the terms of the following MIT/Expat license.]
33

44
The MIT/Expat License
55

6-
Copyright (C) 2012-2021 Genome Research Ltd.
6+
Copyright (C) 2012-2022 Genome Research Ltd.
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@ according to the terms of the following Modified 3-Clause BSD license.]
2929

3030
The Modified-BSD License
3131

32-
Copyright (C) 2012-2020 Genome Research Ltd.
32+
Copyright (C) 2012-2022 Genome Research Ltd.
3333

3434
Redistribution and use in source and binary forms, with or without
3535
modification, are permitted provided that the following conditions are met:

Makefile

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for htslib, a C library for high-throughput sequencing data formats.
22
#
3-
# Copyright (C) 2013-2021 Genome Research Ltd.
3+
# Copyright (C) 2013-2022 Genome Research Ltd.
44
#
55
# Author: John Marshall <jm18@sanger.ac.uk>
66
#
@@ -131,8 +131,8 @@ LIBHTS_SOVERSION = 3
131131
# is not strictly necessary and should be removed the next time
132132
# LIBHTS_SOVERSION is bumped (see #1144 and
133133
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23)
134-
MACH_O_COMPATIBILITY_VERSION = 3.1.14
135-
MACH_O_CURRENT_VERSION = 3.1.14
134+
MACH_O_COMPATIBILITY_VERSION = 3.1.15
135+
MACH_O_CURRENT_VERSION = 3.1.15
136136

137137
# $(NUMERIC_VERSION) is for items that must have a numeric X.Y.Z string
138138
# even if this is a dirty or untagged Git working tree.
@@ -282,10 +282,10 @@ SHLIB_FLAVOUR = cygdll
282282
lib-shared: cyghts-$(LIBHTS_SOVERSION).dll
283283
else ifeq "$(findstring MSYS,$(PLATFORM))" "MSYS"
284284
SHLIB_FLAVOUR = dll
285-
lib-shared: hts-$(LIBHTS_SOVERSION).dll
285+
lib-shared: hts-$(LIBHTS_SOVERSION).dll hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib
286286
else ifeq "$(findstring MINGW,$(PLATFORM))" "MINGW"
287287
SHLIB_FLAVOUR = dll
288-
lib-shared: hts-$(LIBHTS_SOVERSION).dll
288+
lib-shared: hts-$(LIBHTS_SOVERSION).dll hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib
289289
else
290290
SHLIB_FLAVOUR = so
291291
lib-shared: libhts.so
@@ -330,6 +330,41 @@ cyghts-$(LIBHTS_SOVERSION).dll libhts.dll.a: $(LIBHTS_OBJS)
330330
hts-$(LIBHTS_SOVERSION).dll hts.dll.a: $(LIBHTS_OBJS)
331331
$(CC) -shared -Wl,--out-implib=hts.dll.a -Wl,--enable-auto-import -Wl,--exclude-all-symbols $(LDFLAGS) -o $@ -Wl,--whole-archive $(LIBHTS_OBJS) -Wl,--no-whole-archive $(LIBS) -lpthread
332332

333+
hts-$(LIBHTS_SOVERSION).def: hts-$(LIBHTS_SOVERSION).dll
334+
gendef hts-$(LIBHTS_SOVERSION).dll
335+
336+
hts-$(LIBHTS_SOVERSION).lib: hts-$(LIBHTS_SOVERSION).def
337+
dlltool -m i386:x86-64 -d hts-$(LIBHTS_SOVERSION).def -l hts-$(LIBHTS_SOVERSION).lib
338+
339+
# Bundling libraries, binaries, dll dependencies, and licenses into a
340+
# single directory. NB: This is not needed for end-users, but a test bed
341+
# for maintainers building binary distributions.
342+
#
343+
# NOTE: only tested on the supported MSYS2/MINGW64 environment.
344+
dist-windows: DESTDIR=
345+
dist-windows: prefix=dist-windows
346+
dist-windows: install
347+
cp hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib dist-windows/lib
348+
cp `ldd hts-$(LIBHTS_SOVERSION).dll| awk '/mingw64/ {print $$3}'` dist-windows/bin
349+
mkdir -p dist-windows/share/licenses/htslib
350+
-cp -r /mingw64/share/licenses/mingw-w64-libraries \
351+
/mingw64/share/licenses/brotli \
352+
/mingw64/share/licenses/bzip2 \
353+
/mingw64/share/licenses/gcc-libs \
354+
/mingw64/share/licenses/libdeflate \
355+
/mingw64/share/licenses/libpsl \
356+
/mingw64/share/licenses/libtre \
357+
/mingw64/share/licenses/libwinpthread \
358+
/mingw64/share/licenses/openssl \
359+
/mingw64/share/licenses/xz \
360+
/mingw64/share/licenses/zlib \
361+
/mingw64/share/licenses/zstd \
362+
dist-windows/share/licenses/
363+
-cp -r /usr/share/licenses/curl \
364+
dist-windows/share/licenses/
365+
cp LICENSE dist-windows/share/licenses/htslib/
366+
367+
333368
# Target to allow htslib.mk to build all the object files before it
334369
# links the shared and static libraries.
335370
hts-object-files: $(LIBHTS_OBJS)

NEWS

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
Noteworthy changes in release 1.15 (21st February 2022)
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Features and Updates
5+
--------------------
6+
7+
* Bgzip now has a --keep option to not remove the input file after
8+
compressing. (PR#1331)
9+
10+
* Improved file format detection so some BED files are no longer
11+
detected as FASTQ or FASTA. (PR#1350, thanks to John Marshall)
12+
13+
* Added xz (lzma), zstd and D4 formats to the file type detection
14+
functions. We don't actively support reading these data types, but
15+
function calls and htsfile can detect them. (PR#1340, thanks to
16+
John Marshall)
17+
18+
* CRAM now also uses libdeflate for read-names if the libdeflate
19+
version is new enough (1.9 onwards). Previously we used zlib for
20+
this due to poor performance of libdeflate. This gives a slight
21+
speed up and reduction in file size. (PR#1383)
22+
23+
* The VCF and BCF readers will now issue a warning if contig, INFO
24+
or FORMAT IDs do not match the formats described in the VCFv4.3
25+
specification. Note that while the invalid names will mostly still
26+
be accepted, future updates will convert the warnings to errors
27+
causing files including invalid names to be rejected. (PR#1389)
28+
29+
Build changes
30+
-------------
31+
32+
These are compiler, configuration and makefile based changes.
33+
34+
* HTSlib now uses libhtscodecs release 1.2.1.
35+
36+
* Improved support for compiling and linking against HTSlib with
37+
Microsoft Visual Studio. (PR#1380, #1377, #1375. Thanks to
38+
Aidan Bickford and John Marshall)
39+
40+
* Various internal CI improvements.
41+
42+
Bug fixes
43+
---------
44+
45+
* Fixed CRAM index queries for HTSJDK output (PR#1388, reported by
46+
Chris Norman). Note this also fixes writing CRAM writing, to match
47+
the specification (and HTSJDK), from version 3.1 onwards.
48+
49+
* Fixed CRAM index queries when required-fields settings are selected
50+
to ignore CIGARs (PR#1372, reported by Giulio Genovese).
51+
52+
* Unmapped but placed (having chr/pos) are now included in the BAM
53+
indices. (PR#1352, thanks to John Marshall)
54+
55+
* CRAM now honours the filename##idx##index nomenclature for
56+
specifying non-standard index locations. (PR#1360, reported by
57+
Michael Cariaso)
58+
59+
* Minor CRAM v1.0 read-group fix (PR#1349, thanks to John Marshall)
60+
61+
* Permit .fa and .fq file type detection as synonyms for FASTA and
62+
FASTQ. (PR#1386).
63+
64+
* Empty VCF format fields are now output ":.:" as instead of "::".
65+
(PR#1370)
66+
67+
* Repeated bcf_sr_seek calls now work. (PR#1363, reported by
68+
Giulio Genovese)
69+
70+
* Bcf_remove_allele_set now works on unpacked BCF records. (PR#1358,
71+
reported by Brent Pedersen).
72+
73+
* The hts_parse_decimal() function used to read numbers in region lists
74+
is now better at rejecting non-numeric values. In particular it
75+
now rejects a lone 'G' instead of interpreting it as '0G', i.e. zero.
76+
(PR#1396, PR#1400, reported by SSSimon Yang; thanks to John Marshall).
77+
78+
* Improve support for GPU issues listed by -Wdouble-promotion.
79+
(PR#1365, reported by David Seisert)
80+
81+
* Fix example code in header file documentation. (PR#1381, Thanks to
82+
Aidan Bickford)
83+
184
Noteworthy changes in release 1.14 (22nd October 2021)
285
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
386

bgzip.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH bgzip 1 "22 October 2021" "htslib-1.14" "Bioinformatics tools"
1+
.TH bgzip 1 "21 February 2022" "htslib-1.15" "Bioinformatics tools"
22
.SH NAME
33
.PP
44
bgzip \- Block compression/decompression utility

bgzip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
173173
case 1:
174174
printf(
175175
"bgzip (htslib) %s\n"
176-
"Copyright (C) 2021 Genome Research Ltd.\n", hts_version());
176+
"Copyright (C) 2022 Genome Research Ltd.\n", hts_version());
177177
return EXIT_SUCCESS;
178178
case 'h': return bgzip_main_usage(stdout, EXIT_SUCCESS);
179179
case '?': return bgzip_main_usage(stderr, EXIT_FAILURE);

cram/cram_decode.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012-2020 Genome Research Ltd.
2+
Copyright (c) 2012-2020, 2022 Genome Research Ltd.
33
Author: James Bonfield <jkb@sanger.ac.uk>
44
55
Redistribution and use in source and binary forms, with or without
@@ -1777,7 +1777,7 @@ static int cram_decode_seq(cram_fd *fd, cram_container *c, cram_slice *s,
17771777
}
17781778

17791779
cr->ncigar = ncigar - cr->cigar;
1780-
cr->aend = ref_pos;
1780+
cr->aend = ref_pos > cr->apos ? ref_pos : cr->apos;
17811781

17821782
//printf("2: %.*s %d .. %d\n", cr->name_len, DSTRING_STR(name_ds) + cr->name, cr->apos, ref_pos);
17831783

@@ -3228,15 +3228,17 @@ static cram_slice *cram_next_slice(cram_fd *fd, cram_container **cp) {
32283228
}
32293229

32303230
// position beyond end of range; bail out
3231-
if (c_next->ref_seq_start > fd->range.end) {
3231+
if (fd->range.refid != -1 &&
3232+
c_next->ref_seq_start > fd->range.end) {
32323233
cram_free_container(c_next);
32333234
fd->ctr_mt = NULL;
32343235
fd->ooc = 1;
32353236
break;
32363237
}
32373238

32383239
// before start of range; skip to next container
3239-
if (c_next->ref_seq_start + c_next->ref_seq_span-1 <
3240+
if (fd->range.refid != -1 &&
3241+
c_next->ref_seq_start + c_next->ref_seq_span-1 <
32403242
fd->range.start) {
32413243
c_next->curr_slice_mt = c_next->max_slice;
32423244
cram_seek(fd, c_next->length, SEEK_CUR);
@@ -3301,15 +3303,17 @@ static cram_slice *cram_next_slice(cram_fd *fd, cram_container **cp) {
33013303
}
33023304

33033305
// position beyond end of range; bail out
3304-
if (s_next->hdr->ref_seq_start > fd->range.end) {
3306+
if (fd->range.refid != -1 &&
3307+
s_next->hdr->ref_seq_start > fd->range.end) {
33053308
fd->ooc = 1;
33063309
cram_free_slice(s_next);
33073310
c_next->slice = s_next = NULL;
33083311
break;
33093312
}
33103313

33113314
// before start of range; skip to next slice
3312-
if (s_next->hdr->ref_seq_start + s_next->hdr->ref_seq_span-1 <
3315+
if (fd->range.refid != -1 &&
3316+
s_next->hdr->ref_seq_start + s_next->hdr->ref_seq_span-1 <
33133317
fd->range.start) {
33143318
cram_free_slice(s_next);
33153319
c_next->slice = s_next = NULL;

0 commit comments

Comments
 (0)