19 releases (breaking)

0.16.0 Oct 22, 2024
0.14.0 Aug 4, 2024
0.13.0 Jul 14, 2024
0.10.0 Dec 14, 2023
0.1.1 Jul 21, 2021

#2624 in Parser implementations

Download history 1146/week @ 2024-08-17 497/week @ 2024-08-24 748/week @ 2024-08-31 239/week @ 2024-09-07 392/week @ 2024-09-14 425/week @ 2024-09-21 374/week @ 2024-09-28 808/week @ 2024-10-05 1107/week @ 2024-10-12 578/week @ 2024-10-19 735/week @ 2024-10-26 501/week @ 2024-11-02 527/week @ 2024-11-09 379/week @ 2024-11-16 335/week @ 2024-11-23 423/week @ 2024-11-30

1,715 downloads per month
Used in 38 crates (3 directly)

MIT license

60KB
1K SLoC

noodles-fastq handles the reading and writing of the FASTQ format.

FASTQ is a text format with no formal specification and only has de facto rules. It typically consists of a list of records, each with four lines: a definition (read name and description), a sequence, a plus line, and quality scores.

The read name is prefixed with an @ (at sign) character and includes an optional description, delimited by a space ( ) or horizontal tab (\t). The sequence is a list of bases encoded using IUPAC base symbols. The plus line is effectively a separator, sometimes repeating the read name and optional description, and is commonly discarded. The quality scores is list of Phred quality scores (commonly but not guaranteed to be offset by 33) and is parallel to each base in the sequence. That is, each record can be described like the following:

@<name>[< |\t>description]
<sequence>
+[<name>[< |\t>description]]
<quality scores>

Examples

Read all records from a file

use noodles_fastq as fastq;

let mut reader = File::open("sample.fq")
    .map(BufReader::new)
    .map(fastq::io::Reader::new)?;

for result in reader.records() {
    let record = result?;
    // ...
}

Dependencies

~0.6–6.5MB
~37K SLoC