Skip to content

Commit

Permalink
Release 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
daviesrob committed Feb 21, 2022
2 parents c37e041 + dde5d45 commit 762d1b1
Show file tree
Hide file tree
Showing 35 changed files with 632 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
- set MSYSTEM=MINGW64
- set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%PATH%
- set MINGWPREFIX=x86_64-w64-mingw32
- "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\""
- "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\""

build_script:
- set HOME=.
Expand Down
10 changes: 5 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ ubuntu_task:
<< : *TEST


# CentOS
centos_task:
name: centos-gcc
# Rocky Linux
rocky_task:
name: rockylinux-gcc
container:
image: centos:latest
image: rockylinux:latest
cpu: 2
memory: 1G

Expand All @@ -146,7 +146,7 @@ centos_task:
macosx_task:
name: macosx + clang
osx_instance:
image: catalina-base
image: monterey-base

environment:
CC: clang
Expand Down
36 changes: 29 additions & 7 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ library is used. Systems that do not have CCHmac will get this from
libcrypto. libcrypto is part of OpenSSL or one of its derivatives (LibreSSL
or BoringSSL).

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

Update htscodecs submodule
==========================
Expand Down Expand Up @@ -259,13 +257,37 @@ RedHat / CentOS

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

Note: On some versions perl FindBin will need to be installed to make the tests work.

sudo yum install perl-FindBin

Alpine Linux
------------

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

OpenSUSE
--------

sudo zypper install autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel

Windows MSYS2/MINGW64
---------------------

The configure script must be used as without it the compilation will
likely fail.

Follow MSYS2 installation instructions at
https://www.msys2.org/wiki/MSYS2-installation/

Then relaunch to MSYS2 shell using the "MSYS2 MinGW x64" executable.
Once in that environment (check $MSYSTEM equals "MINGW64") install the
compilers using pacman -S and the following package list:

base-devel mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libdeflate mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2
mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-autotools
mingw-w64-x86_64-tools-git

(The last is only needed for building libraries compatible with MSVC.)
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ according to the terms of the following MIT/Expat license.]

The MIT/Expat License

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

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

The Modified-BSD License

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

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
45 changes: 40 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for htslib, a C library for high-throughput sequencing data formats.
#
# Copyright (C) 2013-2021 Genome Research Ltd.
# Copyright (C) 2013-2022 Genome Research Ltd.
#
# Author: John Marshall <[email protected]>
#
Expand Down Expand Up @@ -131,8 +131,8 @@ LIBHTS_SOVERSION = 3
# is not strictly necessary and should be removed the next time
# LIBHTS_SOVERSION is bumped (see #1144 and
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23)
MACH_O_COMPATIBILITY_VERSION = 3.1.14
MACH_O_CURRENT_VERSION = 3.1.14
MACH_O_COMPATIBILITY_VERSION = 3.1.15
MACH_O_CURRENT_VERSION = 3.1.15

# $(NUMERIC_VERSION) is for items that must have a numeric X.Y.Z string
# even if this is a dirty or untagged Git working tree.
Expand Down Expand Up @@ -282,10 +282,10 @@ SHLIB_FLAVOUR = cygdll
lib-shared: cyghts-$(LIBHTS_SOVERSION).dll
else ifeq "$(findstring MSYS,$(PLATFORM))" "MSYS"
SHLIB_FLAVOUR = dll
lib-shared: hts-$(LIBHTS_SOVERSION).dll
lib-shared: hts-$(LIBHTS_SOVERSION).dll hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib
else ifeq "$(findstring MINGW,$(PLATFORM))" "MINGW"
SHLIB_FLAVOUR = dll
lib-shared: hts-$(LIBHTS_SOVERSION).dll
lib-shared: hts-$(LIBHTS_SOVERSION).dll hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib
else
SHLIB_FLAVOUR = so
lib-shared: libhts.so
Expand Down Expand Up @@ -330,6 +330,41 @@ cyghts-$(LIBHTS_SOVERSION).dll libhts.dll.a: $(LIBHTS_OBJS)
hts-$(LIBHTS_SOVERSION).dll hts.dll.a: $(LIBHTS_OBJS)
$(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

hts-$(LIBHTS_SOVERSION).def: hts-$(LIBHTS_SOVERSION).dll
gendef hts-$(LIBHTS_SOVERSION).dll

hts-$(LIBHTS_SOVERSION).lib: hts-$(LIBHTS_SOVERSION).def
dlltool -m i386:x86-64 -d hts-$(LIBHTS_SOVERSION).def -l hts-$(LIBHTS_SOVERSION).lib

# Bundling libraries, binaries, dll dependencies, and licenses into a
# single directory. NB: This is not needed for end-users, but a test bed
# for maintainers building binary distributions.
#
# NOTE: only tested on the supported MSYS2/MINGW64 environment.
dist-windows: DESTDIR=
dist-windows: prefix=dist-windows
dist-windows: install
cp hts-$(LIBHTS_SOVERSION).def hts-$(LIBHTS_SOVERSION).lib dist-windows/lib
cp `ldd hts-$(LIBHTS_SOVERSION).dll| awk '/mingw64/ {print $$3}'` dist-windows/bin
mkdir -p dist-windows/share/licenses/htslib
-cp -r /mingw64/share/licenses/mingw-w64-libraries \
/mingw64/share/licenses/brotli \
/mingw64/share/licenses/bzip2 \
/mingw64/share/licenses/gcc-libs \
/mingw64/share/licenses/libdeflate \
/mingw64/share/licenses/libpsl \
/mingw64/share/licenses/libtre \
/mingw64/share/licenses/libwinpthread \
/mingw64/share/licenses/openssl \
/mingw64/share/licenses/xz \
/mingw64/share/licenses/zlib \
/mingw64/share/licenses/zstd \
dist-windows/share/licenses/
-cp -r /usr/share/licenses/curl \
dist-windows/share/licenses/
cp LICENSE dist-windows/share/licenses/htslib/


# Target to allow htslib.mk to build all the object files before it
# links the shared and static libraries.
hts-object-files: $(LIBHTS_OBJS)
Expand Down
83 changes: 83 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
Noteworthy changes in release 1.15 (21st February 2022)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Features and Updates
--------------------

* Bgzip now has a --keep option to not remove the input file after
compressing. (PR#1331)

* Improved file format detection so some BED files are no longer
detected as FASTQ or FASTA. (PR#1350, thanks to John Marshall)

* Added xz (lzma), zstd and D4 formats to the file type detection
functions. We don't actively support reading these data types, but
function calls and htsfile can detect them. (PR#1340, thanks to
John Marshall)

* CRAM now also uses libdeflate for read-names if the libdeflate
version is new enough (1.9 onwards). Previously we used zlib for
this due to poor performance of libdeflate. This gives a slight
speed up and reduction in file size. (PR#1383)

* The VCF and BCF readers will now issue a warning if contig, INFO
or FORMAT IDs do not match the formats described in the VCFv4.3
specification. Note that while the invalid names will mostly still
be accepted, future updates will convert the warnings to errors
causing files including invalid names to be rejected. (PR#1389)

Build changes
-------------

These are compiler, configuration and makefile based changes.

* HTSlib now uses libhtscodecs release 1.2.1.

* Improved support for compiling and linking against HTSlib with
Microsoft Visual Studio. (PR#1380, #1377, #1375. Thanks to
Aidan Bickford and John Marshall)

* Various internal CI improvements.

Bug fixes
---------

* Fixed CRAM index queries for HTSJDK output (PR#1388, reported by
Chris Norman). Note this also fixes writing CRAM writing, to match
the specification (and HTSJDK), from version 3.1 onwards.

* Fixed CRAM index queries when required-fields settings are selected
to ignore CIGARs (PR#1372, reported by Giulio Genovese).

* Unmapped but placed (having chr/pos) are now included in the BAM
indices. (PR#1352, thanks to John Marshall)

* CRAM now honours the filename##idx##index nomenclature for
specifying non-standard index locations. (PR#1360, reported by
Michael Cariaso)

* Minor CRAM v1.0 read-group fix (PR#1349, thanks to John Marshall)

* Permit .fa and .fq file type detection as synonyms for FASTA and
FASTQ. (PR#1386).

* Empty VCF format fields are now output ":.:" as instead of "::".
(PR#1370)

* Repeated bcf_sr_seek calls now work. (PR#1363, reported by
Giulio Genovese)

* Bcf_remove_allele_set now works on unpacked BCF records. (PR#1358,
reported by Brent Pedersen).

* The hts_parse_decimal() function used to read numbers in region lists
is now better at rejecting non-numeric values. In particular it
now rejects a lone 'G' instead of interpreting it as '0G', i.e. zero.
(PR#1396, PR#1400, reported by SSSimon Yang; thanks to John Marshall).

* Improve support for GPU issues listed by -Wdouble-promotion.
(PR#1365, reported by David Seisert)

* Fix example code in header file documentation. (PR#1381, Thanks to
Aidan Bickford)

Noteworthy changes in release 1.14 (22nd October 2021)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion bgzip.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH bgzip 1 "22 October 2021" "htslib-1.14" "Bioinformatics tools"
.TH bgzip 1 "21 February 2022" "htslib-1.15" "Bioinformatics tools"
.SH NAME
.PP
bgzip \- Block compression/decompression utility
Expand Down
2 changes: 1 addition & 1 deletion bgzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main(int argc, char **argv)
case 1:
printf(
"bgzip (htslib) %s\n"
"Copyright (C) 2021 Genome Research Ltd.\n", hts_version());
"Copyright (C) 2022 Genome Research Ltd.\n", hts_version());
return EXIT_SUCCESS;
case 'h': return bgzip_main_usage(stdout, EXIT_SUCCESS);
case '?': return bgzip_main_usage(stderr, EXIT_FAILURE);
Expand Down
16 changes: 10 additions & 6 deletions cram/cram_decode.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2012-2020 Genome Research Ltd.
Copyright (c) 2012-2020, 2022 Genome Research Ltd.
Author: James Bonfield <[email protected]>
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -1777,7 +1777,7 @@ static int cram_decode_seq(cram_fd *fd, cram_container *c, cram_slice *s,
}

cr->ncigar = ncigar - cr->cigar;
cr->aend = ref_pos;
cr->aend = ref_pos > cr->apos ? ref_pos : cr->apos;

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

Expand Down Expand Up @@ -3228,15 +3228,17 @@ static cram_slice *cram_next_slice(cram_fd *fd, cram_container **cp) {
}

// position beyond end of range; bail out
if (c_next->ref_seq_start > fd->range.end) {
if (fd->range.refid != -1 &&
c_next->ref_seq_start > fd->range.end) {
cram_free_container(c_next);
fd->ctr_mt = NULL;
fd->ooc = 1;
break;
}

// before start of range; skip to next container
if (c_next->ref_seq_start + c_next->ref_seq_span-1 <
if (fd->range.refid != -1 &&
c_next->ref_seq_start + c_next->ref_seq_span-1 <
fd->range.start) {
c_next->curr_slice_mt = c_next->max_slice;
cram_seek(fd, c_next->length, SEEK_CUR);
Expand Down Expand Up @@ -3301,15 +3303,17 @@ static cram_slice *cram_next_slice(cram_fd *fd, cram_container **cp) {
}

// position beyond end of range; bail out
if (s_next->hdr->ref_seq_start > fd->range.end) {
if (fd->range.refid != -1 &&
s_next->hdr->ref_seq_start > fd->range.end) {
fd->ooc = 1;
cram_free_slice(s_next);
c_next->slice = s_next = NULL;
break;
}

// before start of range; skip to next slice
if (s_next->hdr->ref_seq_start + s_next->hdr->ref_seq_span-1 <
if (fd->range.refid != -1 &&
s_next->hdr->ref_seq_start + s_next->hdr->ref_seq_span-1 <
fd->range.start) {
cram_free_slice(s_next);
c_next->slice = s_next = NULL;
Expand Down
Loading

0 comments on commit 762d1b1

Please sign in to comment.