noodles_fastq/lib.rs
1//! **noodles-fastq** handles the reading and writing of the FASTQ format.
2//!
3//! FASTQ is a text format with no formal specification and only has de facto rules. It typically
4//! consists of a list of records, each with four lines: a definition (read name and description),
5//! a sequence, a plus line, and quality scores.
6//!
7//! The read name is prefixed with an `@` (at sign) character and includes an optional description,
8//! delimited by a space (` `) or horizontal tab (`\t`). The sequence is a list of bases encoded
9//! using IUPAC base symbols. The plus line is effectively a separator, sometimes repeating the
10//! read name and optional description, and is commonly discarded. The quality scores is list of
11//! Phred quality scores (commonly but not guaranteed to be offset by 33) and is parallel to each
12//! base in the sequence. That is, each record can be described like the following:
13//!
14//! ```text
15//! @<name>[< |\t>description]
16//! <sequence>
17//! +[<name>[< |\t>description]]
18//! <quality scores>
19//! ```
20//!
21//! # Examples
22//!
23//! ## Read all records from a file
24//!
25//! ```no_run
26//! # use std::{fs::File, io::{self, BufReader}};
27//! use noodles_fastq as fastq;
28//!
29//! let mut reader = File::open("sample.fq")
30//! .map(BufReader::new)
31//! .map(fastq::io::Reader::new)?;
32//!
33//! for result in reader.records() {
34//! let record = result?;
35//! // ...
36//! }
37//! # Ok::<(), io::Error>(())
38//! ```
39
40#[cfg(feature = "async")]
41pub mod r#async;
42
43pub mod fai;
44pub mod fs;
45pub mod io;
46pub mod record;
47
48pub use self::record::Record;