Skip to content
C library for high-throughput sequencing data formats
Branch: develop
Clone or download
daviesrob Make sam_hdr_update_line() update hash tables, arrays
Ensure that header state is consistent after sam_hdr_update_line().
This is a bit tricky as it could be used to update a header
record name.  If this is attempted, check that the new name
is not already in use and update everything appropriately.

Attempting to rename a @pg record is refused due to the complexity
involved.

Rename useful K() macro in header.h to TYPEKEY() which is a
bit easier to search for, although regrettable gcc won't
let you use TYPEKEY("SQ") as a case label...
Latest commit 49058f4 Jul 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cram Make header tag string pointers const Jul 16, 2019
htslib Make sam_hdr_update_line() update hash tables, arrays Jul 16, 2019
m4 Fix configure --disable-werror Apr 24, 2019
os Add os/lzma_stub.h header containing basic liblzma declarations Dec 6, 2017
test Make sam_hdr_update_line() update hash tables, arrays Jul 16, 2019
.appveyor.yml Added -Werror to travis and appveyor config. Aug 2, 2018
.gitattributes Prevent export of .appveyor.yml [minor] Mar 29, 2018
.gitignore Fix test/test_realn.o dependency; ignore test/test-parse-reg [minor] Jul 7, 2019
.travis.yml Updated travis config to add address sanitizer. Jun 14, 2019
INSTALL Additional installation hints for dependencies. Jul 13, 2018
LICENSE Happy New Year Jan 1, 2019
Makefile Merge Methods for retrieving reference name and length (PR #892) Jul 16, 2019
NEWS Precompute cigar_tab[] and make it public as bam_cigar_table[] Jul 8, 2019
README Add basic INSTALL and README files Aug 15, 2014
README.md Add the official repo token. Oct 1, 2018
aclocal.m4 Add aclocal.m4 with pkg-config macros. Jul 27, 2018
bcf_sr_sort.c Change return type of functions that can error (and nothing more). Jun 1, 2019
bcf_sr_sort.h Update internal state on synced reader's seek Apr 24, 2018
bgzf.c Change how z_stream is initialized Jul 15, 2019
bgzip.1 Release 1.9 Jul 18, 2018
bgzip.c Stop bgzip from trying to unlink NULL when decompressing stdin Feb 13, 2019
config.mk.in Add S3 v4 signature code for reading and writing. May 21, 2019
configure.ac Remove trailing whitespace Jun 28, 2018
errmod.c Find some more functions that should return int instead of void Jun 3, 2019
faidx.5 FASTQ information added. Jun 20, 2018
faidx.c Fix incorrect test for item not in khash table Jul 2, 2019
header.c Make sam_hdr_update_line() update hash tables, arrays Jul 16, 2019
header.h Make sam_hdr_update_line() update hash tables, arrays Jul 16, 2019
hfile.c Only try to fetch the index from a remote location when the alignment… Jun 27, 2019
hfile_gcs.c Add support for Google Cloud Storage pseudo-URLs Dec 15, 2016
hfile_internal.h Add S3 v4 signature code for reading and writing. May 21, 2019
hfile_libcurl.c Restore fail on error funcionality in hfile_libcurl Jun 5, 2019
hfile_net.c Add hFILE plugin interface and pluginise irods/libcurl backends Oct 28, 2015
hfile_s3.c Query string handling and other additions. Jun 4, 2019
hfile_s3_write.c Query string handling and other additions. Jun 4, 2019
hts.c Rename bam_hdr_init/_destroy/_dup() to sam_hdr_init/_destroy/_dup() Jul 5, 2019
hts_internal.h Do not download the index file unless requested. Jun 28, 2019
hts_os.c Make hts_os.c's HAVE_DRAND48 check actually work Dec 6, 2017
htsfile.1 Add htsfile --copy option that does byte-for-byte file copies Aug 10, 2018
htsfile.c Rename bam_hdr_init/_destroy/_dup() to sam_hdr_init/_destroy/_dup() Jul 5, 2019
htslib-s3-plugin.7 Query string handling and other additions. Jun 4, 2019
htslib.mk Implementation of the new header API in the CRAM code. Jun 18, 2019
htslib.pc.in Deal with bzip2 pkg-config module not being available everywhere Feb 17, 2017
htslib_vars.mk Rename new public header API functions to have a sam_hdr_* prefix Jul 5, 2019
kfunc.c Add AC_SYS_LARGEFILE test so 32-bit systems can access 2GiB+ files Jan 27, 2016
knetfile.c Fix memory leak in knetfile.c Aug 13, 2018
kstring.c Find some more functions that should return int instead of void Jun 3, 2019
md5.c Fix undefined behaviour and improve endian-related behaviour Jan 25, 2017
multipart.c Simplify tracking of where the Authorization header is Oct 11, 2017
plugin.c Allow plugins to select RTLD_LOCAL or RTLD_GLOBAL Jul 28, 2016
probaln.c Stop probaln_glocal from allocating too much memory. Feb 5, 2018
realn.c Ensure all char indexes are within seq_nt16_table[] bounds Dec 30, 2018
regidx.c Mark several private internal functions as static May 8, 2019
region.c Add extra return value for parse failure in bam_hdr_name2ref() Jun 18, 2019
sam.5 Add copyright notices and licensing boilerplate Jul 30, 2014
sam.c BAM header reference dictionary consistency Jul 16, 2019
synced_bcf_reader.c Allow missing indexes to be silently ignored; API consistency Jun 28, 2019
tabix.1 Add option -D to tabix to use the new index streaming method. Jun 28, 2019
tabix.c Allow missing indexes to be silently ignored; API consistency Jun 28, 2019
tbx.c Allow missing indexes to be silently ignored; API consistency Jun 28, 2019
textutils.c Implementation of the new header API in the CRAM code. Jun 18, 2019
textutils_internal.h Implementation of the new header API in the CRAM code. Jun 18, 2019
thread_pool.c Fixed deadlock in thread pool / bgzf error handling. Mar 6, 2019
thread_pool_internal.h Fixed deadlock in thread pool / bgzf error handling. Mar 6, 2019
vcf.5 Add copyright notices and licensing boilerplate Jul 30, 2014
vcf.c Allow missing indexes to be silently ignored; API consistency Jun 28, 2019
vcf_sweep.c Change return type of functions that can error (and nothing more). Jun 1, 2019
vcfutils.c Change return type of functions that can error (and nothing more). Jun 1, 2019
version.sh Remove trailing whitspace and convert tabs to spaces Jan 15, 2019

README.md

Build Status Build status Github All Releases

HTSlib is an implementation of a unified C library for accessing common file formats, such as SAM, CRAM and VCF, used for high-throughput sequencing data, and is the core library used by samtools and bcftools. HTSlib only depends on zlib. It is known to be compatible with gcc, g++ and clang.

HTSlib implements a generalized BAM index, with file extension .csi (coordinate-sorted index). The HTSlib file reader first looks for the new index and then for the old if the new index is absent.

This project also includes the popular tabix indexer, which indexes both .tbi and .csi formats, and the bgzip compression utility.

Building HTSlib

See INSTALL for complete details. Release tarballs contain generated files that have not been committed to this repository, so building the code from a Git repository requires extra steps:

autoheader     # If using configure, generate the header template...
autoconf       # ...and configure script (or use autoreconf to do both)
./configure    # Optional but recommended, for choosing extra functionality
make
make install
You can’t perform that action at this time.