Crates.io | pilercr-parser |
lib.rs | pilercr-parser |
version | 1.1.0 |
source | src |
created_at | 2023-02-14 21:43:47.561381 |
updated_at | 2023-02-15 20:29:38.268727 |
description | A parser for the output of the PILER-CR CRISPR array annotation tool |
homepage | https://github.com/jimrybarski/pilercr-parser |
repository | https://github.com/jimrybarski/pilercr-parser |
max_upload_size | |
id | 785361 |
size | 66,701 |
A parser for the output of the PILER-CR CRISPR annotation tool.
PILER-CR v1.06 (at least) reports incorrect coordinates if any of the repeat sequences contains gaps. This parser will correct those errors, and also provides the repeat sequence of each repeat-spacer (which is given only as a difference pattern to the consensus in the PILER-CR output).
Add the following to Cargo.toml:
pilercr-parser = 1.0.2
use std::fs::File;
use std::io::{BufReader, Read};
fn main() {
let file = File::open("examples/example.txt").unwrap();
let mut reader = BufReader::new(file);
let mut input = String::new();
reader.read_to_string(&mut input).unwrap();
let arrays = pilercr_parser::parse(&input).unwrap();
for array in arrays {
println!(
"{} has {} arrays",
array.accession,
array.repeat_spacers.len()
);
}
}