1.0.0 |
|
---|
#12 in #crispr
22KB
435 lines
minced
A Rust parser for the MinCED CRISPR array annotation tool.
Installation
Add the following to Cargo.toml:
minced = 1.0.0
Usage
use minced::parse;
use std::fs::File;
use std::io::{BufReader, Read};
fn main() {
let file = File::open("minced.txt").unwrap();
let mut reader = BufReader::new(file);
let mut input = String::new();
reader.read_to_string(&mut input).unwrap();
let contigs = parse(&input).unwrap();
for contig in contigs {
println!("{} has {} arrays", contig.accession, contig.arrays.len());
}
}
lib.rs
:
Parses the output produced by MinCED (https://github.com/ctSkennerton/minced), a CRISPR array annotation tool.
Example
use minced::parse;
use std::fs::File;
use std::io::{BufReader, Read};
let file = File::open("examples/minced.txt").unwrap();
let mut reader = BufReader::new(file);
let mut input = String::new();
reader.read_to_string(&mut input).unwrap();
let contigs = parse(&input).unwrap();
for contig in contigs {
println!("{} has {} arrays", contig.accession, contig.arrays.len());
}
Dependencies
~1MB
~19K SLoC