Low-level bindings

HTSLib.Bindings has a ccall of each C function that HTSLib.jl uses, and the C structs, most of them generated with Clang.jl from the headers of htslib_jll. Each function carries the C declaration it binds in a comment in the source; the structs written by hand, and the module, are documented here.

HTSLib.Bindings — Module
HTSLib.Bindings

Low-level bindings to libhts from htslib_jll.

Each function calls the C function of the same name, whose declaration is in the comment above it, and takes and returns raw pointers; the caller checks errors and manages memory. The structs mirror their C counterparts in htslib 1.10 or later, where hts_pos_t is a 64-bit integer, and keep the C names of their fields. Structs that are only used through pointers are opaque, aliases of Cvoid named after the C type. They cover the parts of the API that HTSLib uses, and others that packages need, such as writing alignments and building their indexes.

source
HTSLib.Bindings.bam1_core_t — Type
bam1_core_t

The fixed-length fields of an alignment, from htslib/sam.h. Positions are 0-based, and tid and mtid are 0-based indexes of reference sequences, or -1.

source
HTSLib.Bindings.bam1_t — Type
bam1_t

An alignment, from htslib/sam.h: its fixed-length fields, and l_data bytes at data that hold its name, CIGAR, sequence, qualities and auxiliary fields, as the bam_get_* macros locate them.

source
HTSLib.Bindings.htsFile — Type
htsFile

The leading fields of an open file, from htslib/hts.h, up to the union of its stream pointers. Only pointers to it are used, and only these fields are read. samFile is the same type.

source
HTSLib.Bindings.htsFormat — Type
htsFormat

The format of a file, from htslib/hts.h. category, format and compression are values of the enums htsFormatCategory, htsExactFormat and htsCompression.

source
HTSLib.Bindings.hts_itr_t — Type
hts_itr_t

The leading fields of an iterator over a region, from htslib/hts.h, up to the interval of the record last read. Only pointers to it are used, and only these fields are read.

source
HTSLib.Bindings.kstring_t — Type
kstring_t

A growable string from htslib/kstring.h: l bytes are used of the m allocated at s, which htslib allocates and the caller frees with Libc.free.

source
HTSLib.Bindings.tbx_conf_t — Type
tbx_conf_t

The columns of a tabix-indexed file, from htslib/tbx.h. Columns are 1-based, and preset is one of TBX_GENERIC, TBX_SAM and TBX_VCF, with TBX_UCSC set for 0-based, half-open positions.

source