noodles_sam/lib.rs
1//! **noodles-sam** handles the reading and writing of the SAM (Sequence Alignment/Map) format.
2//!
3//! SAM is a format typically used to store biological sequences, either mapped to a reference
4//! sequence or unmapped. It has two sections: a header and a list of records.
5//!
6//! The header mostly holds meta information about the data: a header describing the file
7//! format version, reference sequences reads map to, read groups reads belong to, programs that
8//! previously manipulated the data, and free-form comments. The header is optional and may be
9//! empty.
10//!
11//! Each record represents a read, a linear alignment of a segment. Records have fields describing
12//! how a read was mapped (or not) to a reference sequence.
13//!
14//! # Examples
15//!
16//! ## Read all records from a file
17//!
18//! ```no_run
19//! use noodles_sam as sam;
20//!
21//! let mut reader = sam::io::reader::Builder::default().build_from_path("sample.sam")?;
22//! let header = reader.read_header()?;
23//!
24//! for result in reader.records() {
25//! let record = result?;
26//! // ...
27//! }
28//! # Ok::<_, std::io::Error>(())
29//! ```
30
31#[cfg(feature = "async")]
32pub mod r#async;
33
34pub mod alignment;
35pub mod fs;
36pub mod header;
37pub mod io;
38pub mod record;
39
40pub use self::{header::Header, record::Record};