4 releases
0.1.12 | Oct 4, 2024 |
---|---|
0.1.11 | Sep 29, 2024 |
0.1.1 | Sep 29, 2024 |
0.1.0 | Sep 28, 2024 |
#1353 in Parser implementations
450 downloads per month
2.5MB
513 lines
A PAF file parser
Simple iterator API for PAF files.
Example
Run this example with cargo run --release --examples ./data/5_GD_domestica.paf
. The data is in this repository.
use paf::Reader;
use std::env;
fn main() {
let data = env::args().skip(1).next();
if let Some(filename) = data {
let mut reader = Reader::from_path(&filename).unwrap();
for record in reader.records() {
let record = record.unwrap();
println!("{:?}", record);
}
} else {
eprintln!("Usage: cargo run --release --examples print_paf <filename>");
std::process::exit(1);
}
}
lib.rs
:
The paf
crate parses PAF files. PAF is a Pairwise mApping Format which is
commonly used to represent the mapping between two sets of sequences. This
crate is based on output produced from minimap2, so please see the documentation
of minimap2 to see the full set of fields that can be present in a PAF file.
Example
use paf::Reader;
use std::env;
fn main() {
let data = env::args().skip(1).next();
if let Some(filename) = data {
let mut reader = Reader::from_path(&filename).unwrap();
for record in reader.records() {
let record = record.unwrap();
println!("{:?}", record);
}
} else {
eprintln!("Usage: print_paf <filename>");
std::process::exit(1);
}
}