noodles_tabix/lib.rs
1//! **noodles-tabix** handles the reading and writing of the [tabix format].
2//!
3//! A tabix (TBI) is an index file typically used to allow random access of an accompanied file
4//! that is
5//!
6//! 1) bgzipped,
7//! 2) tab-delimited,
8//! 3) grouped by reference sequence name, and
9//! 4) coordinate sorted by start position.
10//!
11//! It can be used to find relevant records for a given genomic region.
12//!
13//! [tabix format]: https://samtools.github.io/hts-specs/tabix.pdf
14//!
15//! # Examples
16//!
17//! ## Read a tabix file
18//!
19//! ```no_run
20//! use noodles_tabix as tabix;
21//! let index = tabix::fs::read("sample.vcf.gz.tbi")?;
22//! # Ok::<(), std::io::Error>(())
23//! ```
24
25#[cfg(feature = "async")]
26pub mod r#async;
27
28pub mod fs;
29pub mod index;
30pub mod io;
31
32use noodles_csi::binning_index::{self, index::reference_sequence::index::LinearIndex};
33
34const MAGIC_NUMBER: [u8; 4] = *b"TBI\x01";
35
36/// A tabix index.
37pub type Index = binning_index::Index<LinearIndex>;