# jellyfish-reader
A pure Rust library for reading [Jellyfish](https://github.com/gmarcais/Jellyfish) k-mer counting output files.
## Quick Start
```sh
cargo add jellyfish-reader
```
```rust
use jellyfish_reader::ReadMerFile;
let reader = ReadMerFile::open("output.jf")?;
for result in reader {
let (mer, count) = result?;
println!("{}: {}", mer, count);
}
```
## Features
- Sequential reading of binary/sorted and text/sorted Jellyfish 2.x files
- Random-access queries via memory-mapped I/O
- K-mer type (`MerDna`) with canonical form, reverse complement, and comparison
- K-mer extraction from DNA strings (`StringMers`)
- Auto-format detection from file headers
- Pure Rust — no C/C++ dependencies
See [docs/usage/](docs/usage/) for detailed usage guides, API examples, and rationale.
## Compatibility
- Jellyfish **2.x** (current: 2.3.1) — `binary/sorted` and `text/sorted` formats
- Jellyfish 1.x is not supported
## License
MIT — see [LICENSE](LICENSE) for details.
## Acknowledgements
This crate reads files produced by [Jellyfish](https://github.com/gmarcais/Jellyfish), developed by Guillaume Marçais et al. The file format and k-mer encoding are based on the Jellyfish 2.x implementation. See the original repository for the k-mer counting tool itself.
## Author
Trent Zeng ([@trentzz](https://crates.io/users/trentzz)) — dev@trentz.me