C library for high-throughput sequencing data formats
C Makefile Roff C++ Perl M4 Other
Latest commit 8dd26ff Feb 15, 2017 @daviesrob daviesrob Make sam_format1() fail it it finds an invalid aux type
Add a missing catch for invalid aux types.

If hts_verbose is set it will now print a message if it fails due to
invalid aux data.

Also fix a FIXME - check if there is enough aux data left the correct way.

Thanks to Chris Saunders at Illumina for reporting problems with
sam_format1() and skip_aux() on broken records.
Permalink
Failed to load latest commit information.
cram Fix undefined behaviour and improve endian-related behaviour Jan 25, 2017
htslib Remove abort on corrupt aux data, pass errors up instead Feb 15, 2017
test Add tabix functional tests Feb 14, 2017
.gitattributes Set Git attributes for BAM and CRAM files in the repository Mar 21, 2016
.gitignore Add tabix functional tests Feb 14, 2017
.travis.yml Also run our tests Sep 6, 2013
INSTALL Move S3 support from hfile_libcurl.c to hfile_s3.c Jan 13, 2017
LICENSE Files under cram/ are BSD-licensed Jun 27, 2014
Makefile Add tabix functional tests Feb 14, 2017
NEWS Add more error checks when building indexes Feb 14, 2017
README Add basic INSTALL and README files Aug 15, 2014
README.md Generate config.h.in with autoheader Jul 5, 2016
bgzf.c Remove MacOS X dead-lock in bgzf threading. Feb 13, 2017
bgzip.c Happy New Year Jan 3, 2017
config.mk.in Move S3 support from hfile_libcurl.c to hfile_s3.c Jan 13, 2017
configure.ac Merge separate hfile_s3.c code Jan 13, 2017
errmod.c Add errmod declarations to htslib/hts.h and errmod.o to Makefile Apr 25, 2016
faidx.5 Allow initial whitespace in FASTA ">" headers Aug 25, 2015
faidx.c Allow fai index to be in a different location to the indexed file. Feb 8, 2017
hfile.c Move S3 support from hfile_libcurl.c to hfile_s3.c Jan 13, 2017
hfile_gcs.c Add support for Google Cloud Storage pseudo-URLs Dec 15, 2016
hfile_internal.h Move S3 support from hfile_libcurl.c to hfile_s3.c Jan 13, 2017
hfile_libcurl.c Don't FAILONERROR at high verbosity and other minor libcurl changes Jan 13, 2017
hfile_net.c Add hFILE plugin interface and pluginise irods/libcurl backends Oct 28, 2015
hfile_s3.c Move S3 support from hfile_libcurl.c to hfile_s3.c Jan 13, 2017
hts.c Add more error checks when building indexes Feb 14, 2017
hts_internal.h Parse GA4GH Retrieval protocol and handle redirects Dec 2, 2016
htsfile.1 Add `htsfile -cv` raw view mode for unknown file formats Jan 13, 2017
htsfile.c Add `htsfile -cv` raw view mode for unknown file formats Jan 13, 2017
htslib.mk Add hts_endian.h to convert little-endian bytes to/from native integers. Jan 25, 2017
htslib.pc.in Create a pkg-config description for easy linking Aug 8, 2014
htslib_vars.mk Fix undefined behaviour and improve endian-related behaviour Jan 25, 2017
kfunc.c Add AC_SYS_LARGEFILE test so 32-bit systems can access 2GiB+ files Jan 27, 2016
knetfile.c Allow fai index to be in a different location to the indexed file. Feb 8, 2017
kstring.c Adjusted prototype for kputd to be consistent with other kput functions. Jan 30, 2017
md5.c Fix undefined behaviour and improve endian-related behaviour Jan 25, 2017
multipart.c Parse GA4GH Retrieval protocol and handle redirects Dec 2, 2016
plugin.c Allow plugins to select RTLD_LOCAL or RTLD_GLOBAL Jul 28, 2016
probaln.c Merge (ABI-changing!) mpileup callbacks (PR #398) Sep 14, 2016
realn.c Remove probaln_par_def/probaln_par_alt constants Apr 25, 2016
regidx.c Use internal plain char isdigit_c()/etc ctype functions May 18, 2016
sam.5 Add copyright notices and licensing boilerplate Jul 30, 2014
sam.c Make sam_format1() fail it it finds an invalid aux type Feb 15, 2017
synced_bcf_reader.c propagate vcf errors from synced reader Jan 11, 2017
tabix.1 Merge version number bump and NEWS file from master Sep 13, 2016
tabix.c Happy New Year Jan 3, 2017
tbx.c Add bgzf_compression(); reuse check_header() in bgzf_is_bgzf() Jan 13, 2017
textutils.c Add JSON tokeniser / lexer Nov 22, 2016
thread_pool.c Merge "Further thread pool fixes" branch (PR #465) Feb 7, 2017
thread_pool_internal.h Don't redefine thread_pool.h typedefs Oct 11, 2016
vcf.5 Add copyright notices and licensing boilerplate Jul 30, 2014
vcf.c Merge commit PR #459 (Fix undefined behaviour and improve endian-rela… Feb 6, 2017
vcf_sweep.c Remove htsFile's use of kstream Dec 2, 2016
vcfutils.c vcfutils: replace exit() with return -1 in bcf_remove_allele_set Jan 10, 2017

README.md

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, needed for choosing optional functionality
make
make install