1.0.0 |
|
---|
#12 在 #crispr
22KB
435 行
minced
MinCED CRISPR阵列注释工具的Rust解析器。
安装
将以下内容添加到Cargo.toml
minced= 1.0.0
用法
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
:
解析MinCED(https://github.com/ctSkennerton/minced)生成的输出,MinCED是一个CRISPR阵列注释工具。
示例
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());
}
依赖项
~1MB
~20K SLoC