44 releases (breaking)

0.35.0 Mar 28, 2024
0.33.0 Feb 22, 2024
0.31.0 Dec 14, 2023
0.30.0 Oct 12, 2023
0.2.0 Jul 30, 2021

#1424 in Parser implementations

Download history 215/week @ 2023-12-22 312/week @ 2023-12-29 414/week @ 2024-01-05 332/week @ 2024-01-12 363/week @ 2024-01-19 828/week @ 2024-01-26 783/week @ 2024-02-02 501/week @ 2024-02-09 801/week @ 2024-02-16 888/week @ 2024-02-23 811/week @ 2024-03-01 919/week @ 2024-03-08 676/week @ 2024-03-15 565/week @ 2024-03-22 681/week @ 2024-03-29 446/week @ 2024-04-05

2,460 downloads per month
Used in 46 crates (7 directly)

MIT license

220KB
5K 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::Reader::new)?;

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

Dependencies

~1–2.3MB
~38K SLoC