Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
qbix
qbix retrieves BAM records by read name using a .qbi index.
Use it when you need records for one or more read names from a BAM file without scanning the file.
The index stores:
- XXH3-64 hashes of read names
- BGZF virtual offsets
- BAM size, mtime, and header hash for stale-index detection
qbix was inspired by jts/bri. .qbi is not
compatible with .bri. .qbi stores read-name hashes and BGZF virtual offsets
instead of read names. Lookup candidates are checked against BAM QNAME before
output.
Install
Download a prebuilt binary from GitHub Releases.
Build From Source
Requirements:
- Rust and Cargo
- htslib
pkg-configrecommended
Install htslib and pkg-config with your system package manager:
# macOS
# Ubuntu/Debian
The binary is:
If htslib is installed under a custom prefix:
HTSDIR=/path/to/htslib
For static htslib linking:
HTSLIB_STATIC=1
You can also build and install from crates.io:
The crates.io install builds from source and expects htslib headers and libraries to be available on the system.
Basic Use
Create an index:
This writes:
Fetch records by read name. Output is SAM:
Use more htslib threads:
Use an explicit index path:
Output Order
Default output is query order:
For multiple read names, --bam-order reads records in BAM file-offset order.
This can reduce random seeking:
If name-sorted output is needed, sort downstream:
|
Other Commands
Check an index against its BAM:
Show raw index rows:
show prints:
qhash<TAB>voff
Print the version:
Notes
.qbifiles are tied to the BAM size, mtime, and header hash.- Rebuild the index after replacing or rewriting the BAM.
- Read names are not stored in the index. Hash hits are verified against the BAM record QNAME before output.
Rust Library
qbix also exposes a small Rust API:
let index_path = build_index?;
let bam = open?;
let hits = bam.lookup?;
C Library
qbix can be built as a C library from source:
Libraries are written under target/release, for example libqbix.so,
libqbix.a, or libqbix.dylib. The header is include/qbix.h.
For HTSlib-based applications, build qbix against the same HTSlib installation
as the host application. C API errors are stored per calling thread.
qbix_index_t handles are not thread-safe.
Example:
int