mafft-io 0.2.0

I/O routines for MAFFT: FASTA, Clustal, PHYLIP, hat2, localhom formats
Documentation

mafft-io

FASTA, Clustal, PHYLIP, hat2, and localhom I/O for rust-MAFFT.

Acknowledgment. rust-MAFFT is a port of MAFFT by Kazutaka Katoh and colleagues (CBRC). The science is theirs. If you use this crate in published work, please cite Katoh & Standley 2013; full guidance at the project citation page.

Reads sequences and their associated constraint / distance data from disk (or any BufRead), and writes alignment results back out. Reuses noodles-fasta under the hood for the FASTA parser. Reproduces C MAFFT's read path so the engine sees byte-for-byte the same input as the C reference: type detection (N counts as nucleotide), the residue filter and case convention (lowercase nucleotide, uppercase protein; --anysymbol keeps the input case), *-, and the seqcheck illegal-residue test (find_illegal_residue, using the alphabets from mafft-scoring). normalize_residues applies the same rules to sequences that never went through a file.

Install

cargo add mafft-io

Most callers want the top-level mafft crate, which re-exports the public surface here.

Examples

use mafft_io::{read_fasta, read_fasta_from_reader};

// From a path
let input = read_fasta("input.fasta")?;

// From any BufRead (stdin, a Vec<u8>, an HTTP body, ...)
let cursor = std::io::Cursor::new(b">a\nACDEF\n>b\nACDF\n");
let input  = read_fasta_from_reader(std::io::BufReader::new(cursor))?;

Documentation

API reference: docs.rs/mafft-io

Project documentation: luksgrin.github.io/rust-MAFFT

License

MIT for the Rust port; the upstream MAFFT I/O conventions this crate mirrors are BSD-3-Clause. See LICENSE-MIT and LICENSE-BSD in the workspace root.