Module needletail::fastx [] [src]

This module contains functions for reading FASTA data from either within memory or from files.

Design Note

These functions are designed to take callbacks to process the FASTX records they read. It would be nice to present a FASTX Iterator that downstream users can use at some point, but this is only possible for in-memory data (using MemProducer from nom) because otherwise the lifetime of each record is linked to what part of the file we're reading and Rust doesn't support "streaming iterators" otherwise. Maybe some day.

See: https://github.com/emk/rust-streaming

Functions

fastx_bytes

Parse a array of bytes into FASTX records and calls callback on each.

fastx_cli

Opens files (or stdin, if a dash is provided instead) and reads FASTX records out. Also takes a "type_callback" that gets called as soon as we determine if the records are FASTA or FASTQ. If a file starts with a gzip header, transparently decompress it.

fastx_file

Parse a file (given its name) into FASTX records and calls callback on each.

fastx_stdin

Parse stdin into FASTX records and call callback on each.