#crispr #bioinformatics #annotations #minced

minced-parser

A parser for the output of the MinCED CRISPR array annotation tool

2 stable releases

2.0.0 Feb 15, 2023
1.0.0 Feb 5, 2023

#238 in Biology

MIT license

24KB
477 lines

minced-parser

A Rust parser for the MinCED CRISPR array annotation tool.

Installation

Add the following to Cargo.toml:

minced-parser = 2.0.0

Usage

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 = minced_parser::parse(&input).unwrap();
    for contig in contigs {
        println!("{} has {} arrays", contig.accession, contig.arrays.len());
    }
}

Documentation

Docs are hosted here.


lib.rs:

Parses the output produced by MinCED (https://github.com/ctSkennerton/minced), a CRISPR array annotation tool.

Example

use minced_parser::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
~17K SLoC