noodles_sam/
lib.rs

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