13 releases (breaking)

0.10.0 Dec 14, 2023
0.9.0 Oct 12, 2023
0.8.0 May 18, 2023
0.6.0 Feb 3, 2023
0.1.1 Jul 21, 2021

#1491 in Parser implementations

Download history 367/week @ 2023-11-20 475/week @ 2023-11-27 150/week @ 2023-12-04 298/week @ 2023-12-11 262/week @ 2023-12-18 161/week @ 2023-12-25 178/week @ 2024-01-01 430/week @ 2024-01-08 97/week @ 2024-01-15 464/week @ 2024-01-22 343/week @ 2024-01-29 574/week @ 2024-02-05 330/week @ 2024-02-12 257/week @ 2024-02-19 582/week @ 2024-02-26 510/week @ 2024-03-04

1,688 downloads per month
Used in 26 crates (2 directly)

MIT license

51KB
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. 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 offset by 33 and is parallel to each base in the sequence. That is, each record can be described like the following:

@<name>[ description]
<sequence>
+[<name>[ 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::Reader::new)?;

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

Dependencies

~0.2–1.6MB
~26K SLoC