Skip to content

Commit 1832d3a

Browse files
committed
Release 1.9
2 parents be22a2a + 6cd9f24 commit 1832d3a

Some content is hidden

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

71 files changed

+11969
-10057
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ build_script:
3030
- set HOME=.
3131
- set MSYSTEM=MINGW64
3232
- set PATH=C:/msys64/usr/bin;C:/msys64/mingw64/bin;%PATH%
33-
- "sh -lc \"aclocal && autoheader && autoconf && ./configure CFLAGS='-Wno-format -g -O2' && make -j2\""
33+
- "sh -lc \"aclocal && autoheader && autoconf && ./configure && make -j2\""
3434

3535
#build_script:
3636
# - make

INSTALL

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Requirements
55
============
66

77
Building HTSlib requires a few programs and libraries to be present.
8+
See the "System Specific Details" below for guidance on how to install
9+
these.
10+
811
At least the following are required:
912

1013
GNU make
@@ -17,7 +20,7 @@ In addition, building the configure script requires:
1720

1821
Running the configure script uses awk, along with a number of
1922
standard UNIX tools (cat, cp, grep, mv, rm, sed, among others). Almost
20-
all installations will have these already.
23+
all installations will have these already.
2124

2225
Running the test harness (make test) uses:
2326

@@ -29,7 +32,7 @@ library itself, and include files needed to compile code that uses functions
2932
from the library. Note that some Linux distributions put include files in
3033
a development ('-dev' or '-devel') package separate from the main library.
3134

32-
libz (required)
35+
zlib (required)
3336
libbz2 (required, unless configured with --disable-bz2)
3437
liblzma (required, unless configured with --disable-lzma)
3538
libcurl (optional, but strongly recommended)
@@ -200,3 +203,42 @@ For example,
200203
make DESTDIR=/tmp/staging prefix=/opt
201204

202205
would install into bin, lib, etc subdirectories under /tmp/staging/opt.
206+
207+
208+
System Specific Details
209+
=======================
210+
211+
Installing the prerequisites is system dependent and there is more
212+
than one correct way of satisfying these, including downloading them
213+
from source, compiling and installing them yourself.
214+
215+
For people with super-user access, we provide an example set of commands
216+
below for installing the dependencies on a variety of operating system
217+
distributions. Note these are not specific recommendations on distribution,
218+
compiler or SSL implementation. It is assumed you already have the core set
219+
of packages for the given distribution - the lists may be incomplete if
220+
this is not the case.
221+
222+
Debian / Ubuntu
223+
---------------
224+
225+
sudo apt-get update # Ensure the package list is up to date
226+
sudo apt-get install autoconf automake make gcc perl zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev
227+
228+
Note: libcurl4-openssl-dev can be used as an alternative to libcurl4-gnutls-dev.
229+
230+
RedHat / CentOS
231+
---------------
232+
233+
sudo yum install autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel
234+
235+
Alpine Linux
236+
------------
237+
238+
sudo apk update # Ensure the package list is up to date
239+
sudo apk add autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev libressl-dev
240+
241+
OpenSUSE
242+
--------
243+
244+
sudo zypper install autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel

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-2014 Genome Research Ltd.
6+
Copyright (C) 2012-2018 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-2014 Genome Research Ltd.
32+
Copyright (C) 2012-2018 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: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ cram_misc_h = cram/misc.h $(cram_os_h)
174174
cram_os_h = cram/os.h $(htslib_hts_endian_h)
175175
cram_sam_header_h = cram/sam_header.h cram/string_alloc.h cram/pooled_alloc.h $(htslib_khash_h) $(htslib_kstring_h)
176176
cram_samtools_h = cram/cram_samtools.h $(htslib_sam_h) $(cram_sam_header_h)
177-
cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h) cram/string_alloc.h $(htslib_khash_h)
177+
cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h) cram/string_alloc.h cram/mFILE.h $(htslib_khash_h)
178178
cram_open_trace_file_h = cram/open_trace_file.h cram/mFILE.h
179+
bcf_sr_sort_h = bcf_sr_sort.h $(htslib_synced_bcf_reader_h) $(htslib_kbitset_h)
179180
hfile_internal_h = hfile_internal.h $(htslib_hfile_h) $(textutils_internal_h)
180181
hts_internal_h = hts_internal.h $(htslib_hts_h) $(textutils_internal_h)
181182
textutils_internal_h = textutils_internal.h $(htslib_kstring_h)
@@ -288,23 +289,23 @@ hts-$(LIBHTS_SOVERSION).dll: $(LIBHTS_OBJS)
288289
$(CC) -shared $(LDFLAGS) -o $@ $< hts.dll.a $(LIBS)
289290

290291

291-
bgzf.o bgzf.pico: bgzf.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(htslib_hfile_h) $(htslib_thread_pool_h) cram/pooled_alloc.h $(htslib_khash_h)
292-
errmod.o errmod.pico: errmod.c config.h $(htslib_hts_h) $(htslib_ksort_h)
292+
bgzf.o bgzf.pico: bgzf.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(htslib_hfile_h) $(htslib_thread_pool_h) $(htslib_hts_endian_h) cram/pooled_alloc.h $(htslib_khash_h)
293+
errmod.o errmod.pico: errmod.c config.h $(htslib_hts_h) $(htslib_ksort_h) $(htslib_hts_os_h)
293294
kstring.o kstring.pico: kstring.c config.h $(htslib_kstring_h)
294295
knetfile.o knetfile.pico: knetfile.c config.h $(htslib_hts_log_h) $(htslib_knetfile_h)
295296
hfile.o hfile.pico: hfile.c config.h $(htslib_hfile_h) $(hfile_internal_h) $(hts_internal_h) $(htslib_khash_h)
296297
hfile_gcs.o hfile_gcs.pico: hfile_gcs.c config.h $(htslib_hts_h) $(htslib_kstring_h) $(hfile_internal_h)
297-
hfile_libcurl.o hfile_libcurl.pico: hfile_libcurl.c config.h $(hfile_internal_h) $(htslib_hts_h) $(htslib_kstring_h)
298+
hfile_libcurl.o hfile_libcurl.pico: hfile_libcurl.c config.h $(hfile_internal_h) $(htslib_hts_h) $(htslib_kstring_h) $(htslib_khash_h)
298299
hfile_net.o hfile_net.pico: hfile_net.c config.h $(hfile_internal_h) $(htslib_knetfile_h)
299300
hfile_s3.o hfile_s3.pico: hfile_s3.c config.h $(hfile_internal_h) $(htslib_hts_h) $(htslib_kstring_h)
300-
hts.o hts.pico: hts.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(cram_h) $(hfile_internal_h) $(htslib_hfile_h) version.h $(hts_internal_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_ksort_h)
301+
hts.o hts.pico: hts.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(cram_h) $(htslib_hfile_h) $(htslib_hts_endian_h) version.h $(hts_internal_h) $(hfile_internal_h) $(htslib_hts_os_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_ksort_h)
301302
hts_os.o hts_os.pico: hts_os.c config.h os/rand.c
302303
vcf.o vcf.pico: vcf.c config.h $(htslib_vcf_h) $(htslib_bgzf_h) $(htslib_tbx_h) $(htslib_hfile_h) $(hts_internal_h) $(htslib_khash_str2int_h) $(htslib_kstring_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_hts_endian_h)
303304
sam.o sam.pico: sam.c config.h $(htslib_sam_h) $(htslib_bgzf_h) $(cram_h) $(hts_internal_h) $(htslib_hfile_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_kstring_h) $(htslib_hts_endian_h)
304-
tbx.o tbx.pico: tbx.c config.h $(htslib_tbx_h) $(htslib_bgzf_h) $(hts_internal_h) $(htslib_khash_h)
305+
tbx.o tbx.pico: tbx.c config.h $(htslib_tbx_h) $(htslib_bgzf_h) $(htslib_hts_endian_h) $(hts_internal_h) $(htslib_khash_h)
305306
faidx.o faidx.pico: faidx.c config.h $(htslib_bgzf_h) $(htslib_faidx_h) $(htslib_hfile_h) $(htslib_khash_h) $(htslib_kstring_h) $(hts_internal_h)
306-
bcf_sr_sort.o bcf_sr_sort.pico: bcf_sr_sort.c config.h bcf_sr_sort.h $(htslib_kseq_h) $(htslib_khash_str2int_h)
307-
synced_bcf_reader.o synced_bcf_reader.pico: synced_bcf_reader.c config.h bcf_sr_sort.h $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(htslib_bgzf_h) $(htslib_thread_pool_h)
307+
bcf_sr_sort.o bcf_sr_sort.pico: bcf_sr_sort.c config.h $(bcf_sr_sort_h) $(htslib_khash_str2int_h)
308+
synced_bcf_reader.o synced_bcf_reader.pico: synced_bcf_reader.c config.h $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(htslib_bgzf_h) $(htslib_thread_pool_h) $(bcf_sr_sort_h)
308309
vcf_sweep.o vcf_sweep.pico: vcf_sweep.c config.h $(htslib_vcf_sweep_h) $(htslib_bgzf_h)
309310
vcfutils.o vcfutils.pico: vcfutils.c config.h $(htslib_vcfutils_h) $(htslib_kbitset_h)
310311
kfunc.o kfunc.pico: kfunc.c config.h $(htslib_kfunc_h)
@@ -325,11 +326,11 @@ cram/cram_io.o cram/cram_io.pico: cram/cram_io.c config.h os/lzma_stub.h $(cram_
325326
cram/cram_samtools.o cram/cram_samtools.pico: cram/cram_samtools.c config.h $(cram_h) $(htslib_sam_h)
326327
cram/cram_stats.o cram/cram_stats.pico: cram/cram_stats.c config.h $(cram_h) $(cram_os_h)
327328
cram/files.o cram/files.pico: cram/files.c config.h $(cram_misc_h)
328-
cram/mFILE.o cram/mFILE.pico: cram/mFILE.c config.h $(cram_os_h) cram/mFILE.h
329-
cram/open_trace_file.o cram/open_trace_file.pico: cram/open_trace_file.c config.h $(cram_os_h) $(cram_open_trace_file_h) $(cram_misc_h) $(htslib_hfile_h)
329+
cram/mFILE.o cram/mFILE.pico: cram/mFILE.c config.h $(htslib_hts_log_h) $(cram_os_h) cram/mFILE.h
330+
cram/open_trace_file.o cram/open_trace_file.pico: cram/open_trace_file.c config.h $(cram_os_h) $(cram_open_trace_file_h) $(cram_misc_h) $(htslib_hfile_h) $(htslib_hts_log_h)
330331
cram/pooled_alloc.o cram/pooled_alloc.pico: cram/pooled_alloc.c config.h cram/pooled_alloc.h $(cram_misc_h)
331332
cram/rANS_static.o cram/rANS_static.pico: cram/rANS_static.c config.h cram/rANS_static.h cram/rANS_byte.h
332-
cram/sam_header.o cram/sam_header.pico: cram/sam_header.c config.h $(cram_sam_header_h) cram/string_alloc.h
333+
cram/sam_header.o cram/sam_header.pico: cram/sam_header.c config.h $(htslib_hts_log_h) $(cram_sam_header_h) cram/string_alloc.h
333334
cram/string_alloc.o cram/string_alloc.pico: cram/string_alloc.c config.h cram/string_alloc.h
334335
thread_pool.o thread_pool.pico: thread_pool.c config.h $(thread_pool_internal_h)
335336

@@ -359,7 +360,7 @@ check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS)
359360
test/hfile
360361
test/test_bgzf test/bgziptest.txt
361362
cd test/tabix && ./test-tabix.sh tabix.tst
362-
REF_PATH=: test/sam test/ce.fa test/faidx.fa
363+
REF_PATH=: test/sam test/ce.fa test/faidx.fa test/fastqs.fq
363364
test/test-regidx
364365
cd test && REF_PATH=: ./test.pl $${TEST_OPTS:-}
365366

@@ -399,18 +400,18 @@ test/test-bcf-sr: test/test-bcf-sr.o libhts.a
399400
test/test-bcf-translate: test/test-bcf-translate.o libhts.a
400401
$(CC) $(LDFLAGS) -o $@ test/test-bcf-translate.o libhts.a -lz $(LIBS) -lpthread
401402

402-
test/hts_endian.o: test/hts_endian.c $(htslib_hts_endian_h)
403+
test/hts_endian.o: test/hts_endian.c config.h $(htslib_hts_endian_h)
403404
test/fieldarith.o: test/fieldarith.c config.h $(htslib_sam_h)
404405
test/hfile.o: test/hfile.c config.h $(htslib_hfile_h) $(htslib_hts_defs_h)
405406
test/sam.o: test/sam.c config.h $(htslib_hts_defs_h) $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h)
406-
test/test_bgzf.o: test/test_bgzf.c $(htslib_bgzf_h) $(htslib_hfile_h)
407-
test/test-realn.o: test/test_realn.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h)
407+
test/test_bgzf.o: test/test_bgzf.c config.h $(htslib_bgzf_h) $(htslib_hfile_h) $(hfile_internal_h)
408+
test/test-realn.o: test/test_realn.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h)
408409
test/test-regidx.o: test/test-regidx.c config.h $(htslib_regidx_h) $(hts_internal_h)
409410
test/test_view.o: test/test_view.c config.h $(cram_h) $(htslib_sam_h)
410411
test/test-vcf-api.o: test/test-vcf-api.c config.h $(htslib_hts_h) $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_kseq_h)
411412
test/test-vcf-sweep.o: test/test-vcf-sweep.c config.h $(htslib_vcf_sweep_h)
412-
test/test-bcf-sr.o: test/test-bcf-sr.c config.h $(htslib_vcf_sweep_h) bcf_sr_sort.h
413-
test/test-bcf-translate.o: test/test-bcf-translate.c config.h
413+
test/test-bcf-sr.o: test/test-bcf-sr.c config.h $(htslib_synced_bcf_reader_h)
414+
test/test-bcf-translate.o: test/test-bcf-translate.c config.h $(htslib_vcf_h)
414415

415416

416417
test/thrash_threads1: test/thrash_threads1.o libhts.a

NEWS

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,74 @@
1+
Noteworthy changes in release 1.9 (18th July 2018)
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
* If `./configure` fails, `make` will stop working until either configure
5+
is re-run successfully, or `make distclean` is used. This makes
6+
configuration failures more obvious. (#711, thanks to John Marshall)
7+
8+
* The default SAM version has been changed to 1.6. This is in line with the
9+
latest version specification and indicates that HTSlib supports the
10+
CG tag used to store long CIGAR data in BAM format.
11+
12+
* bgzip integrity check option '--test' (#682, thanks to @sd4B75bJ, @jrayner)
13+
14+
* Faidx can now index fastq files as well as fasta. The fastq index adds
15+
an extra column to the `.fai` index which gives the offset to the quality
16+
values. New interfaces have been added to `htslib/faidx.h` to read the
17+
fastq index and retrieve the quality values. It is possible to open
18+
a fastq index as if fasta (only sequences will be returned), but not
19+
the other way round. (#701)
20+
21+
* New API interfaces to add or update integer, float and array aux tags. (#694)
22+
23+
* Add `level=<number>` option to `hts_set_opt()` to allow the compression
24+
level to be set. Setting `level=0` enables uncompressed output. (#715)
25+
26+
* Improved bgzip error reporting.
27+
28+
* Better error reporting when CRAM reference files can't be opened. (#706)
29+
30+
* Fixes to make tests work properly on Windows/MinGW - mainly to handle
31+
line ending differences. (#716)
32+
33+
* Efficiency improvements:
34+
35+
- Small speed-up for CRAM indexing.
36+
37+
- Reduce the number of unnecessary wake-ups in the thread pool. (#703)
38+
39+
- Avoid some memory copies when writing data, notably for uncompressed
40+
BGZF output. (#703)
41+
42+
* Bug fixes:
43+
44+
- Fix multi-region iterator bugs on CRAM files. (#684)
45+
46+
- Fixed multi-region iterator bug that caused some reads to be skipped
47+
incorrectly when reading BAM files. (#687)
48+
49+
- Fixed synced_bcf_reader() bug when reading contigs multiple times. (#691,
50+
reported by @freeseek)
51+
52+
- Fixed bug where bcf_hdr_set_samples() did not update the sample dictionary
53+
when removing samples. (#692, reported by @freeseek)
54+
55+
- Fixed bug where the VCF record ref length was calculated incorrectly
56+
if an INFO END tag was present. (71b00a)
57+
58+
- Fixed warnings found when compiling with gcc 8.1.0. (#700)
59+
60+
- sam_hdr_read() and sam_hdr_write() will now return an error code
61+
if passed a NULL file pointer, instead of crashing.
62+
63+
- Fixed possible negative array look-up in sam_parse1() that somehow
64+
escaped previous fuzz testing. (#731, reported by @fCorleone)
65+
66+
- Fixed bug where cram range queries could incorrectly report an error
67+
when using multiple threads. (#734, reported by Brent Pedersen)
68+
69+
- Fixed very rare rANS normalisation bug that could cause an assertion
70+
failure when writing CRAM files. (#739, reported by @carsonhh)
71+
172
Noteworthy changes in release 1.8 (3rd April 2018)
273
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
374

bcf_sr_sort.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
THE SOFTWARE.
2323
*/
2424

25+
#include <config.h>
26+
2527
#include <strings.h>
2628

2729
#include "bcf_sr_sort.h"
@@ -645,6 +647,10 @@ sr_sort_t *bcf_sr_sort_init(sr_sort_t *srt)
645647
memset(srt,0,sizeof(sr_sort_t));
646648
return srt;
647649
}
650+
void bcf_sr_sort_reset(sr_sort_t *srt)
651+
{
652+
srt->chr = NULL;
653+
}
648654
void bcf_sr_sort_destroy(sr_sort_t *srt)
649655
{
650656
free(srt->active);

bcf_sr_sort.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ typedef struct
9797
sr_sort_t;
9898

9999
sr_sort_t *bcf_sr_sort_init(sr_sort_t *srt);
100+
void bcf_sr_sort_reset(sr_sort_t *srt);
100101
int bcf_sr_sort_next(bcf_srs_t *readers, sr_sort_t *srt, const char *chr, int pos);
101102
int bcf_sr_sort_set_active(sr_sort_t *srt, int i);
102103
int bcf_sr_sort_add_active(sr_sort_t *srt, int i);

0 commit comments

Comments
 (0)