48 breaking releases

0.49.0 Feb 6, 2025
0.47.0 Jan 19, 2025
0.46.0 Dec 12, 2024
0.45.0 Oct 22, 2024
0.2.0 Jul 30, 2021

#1051 in Parser implementations

Download history 829/week @ 2024-10-29 853/week @ 2024-11-05 428/week @ 2024-11-12 747/week @ 2024-11-19 877/week @ 2024-11-26 767/week @ 2024-12-03 1176/week @ 2024-12-10 1011/week @ 2024-12-17 334/week @ 2024-12-24 789/week @ 2024-12-31 1384/week @ 2025-01-07 1725/week @ 2025-01-14 1589/week @ 2025-01-21 2286/week @ 2025-01-28 3316/week @ 2025-02-04 2172/week @ 2025-02-11

9,650 downloads per month
Used in 61 crates (6 directly)

MIT license

265KB
6K SLoC

noodles-fasta handles and reading and writing of the FASTA format.

FASTA is a text format with no formal specification and only has de facto rules. It typically consists of a list of records, each with a definition on the first line and a sequence in the following lines.

The definition starts with a > (greater than) character, and directly after it is the reference sequence name. Optionally, whitespace may be used a delimiter for an extra description or metadata of the sequence. For example,

 reference sequence name
 | |
>sq0 LN:13
     |   |
     description

The sequence is effectively a byte array of characters representing a base. It is typically hard wrapped at an arbitrary width. For example, the following makes up the sequence ACGTNACTGG.

ACGT
NACT
GG

Examples

Read all records in a FASTA file

use noodles_fasta as fasta;

let mut reader = File::open("reference.fa")
    .map(BufReader::new)
    .map(fasta::io::Reader::new)?;

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

Dependencies

~1.4–7.5MB
~50K SLoC