3 releases

0.1.2 Jan 22, 2024
0.1.1 Jan 22, 2024
0.1.0 Jan 22, 2024

#952 in Parser implementations

Download history 19/week @ 2024-01-18 6/week @ 2024-02-15 26/week @ 2024-02-22 9/week @ 2024-02-29 1/week @ 2024-03-07 28/week @ 2024-03-28 13/week @ 2024-04-04 67/week @ 2024-04-11 2/week @ 2024-04-18

110 downloads per month

MIT license

17KB
325 lines

trfr

The trfr crate is purely for parsing the output of the command line tool Tandem Repeat Finder (or trf).

The output is generated by passing the -d flag to createa parseable table (rather than the standard HTML output). Please see here for the source code and citation for trf.

The API follows that of most mainstream Rust API's (in particular BurntSushi's). It is an iterator API.

Example

use std::{error::Error, io, process};

fn example() -> Result<(), Box<dyn Error>> {
    // Build the trfr reader
    // and assuming you are parsing with `-d` flag only
    let mut rdr = trfr::Reader::from_reader(io::stdin(), trfr::Flag::D);
    for result in rdr.records() {
        let record = result?;
        println!("{:?}", record);
    }
    Ok(())
}

fn main() {
    if let Err(err) = example() {
        println!("error running example: {}", err);
        process::exit(1);
    }
}

lib.rs:

The trfr crate is purely for parsing the output of the command line tool Tandem Repeat Finder (or trf).

The output is generated by passing the -d flag to create a parseable table (rather than the standard HTML output). Please see here for the source code and citation for trf.

The API follows that of most mainstream Rust API's (in particular BurntSushi's). It is an iterator API.

Example

use std::{error::Error, io, process};

fn example() -> Result<(), Box<dyn Error>> {
// Build the trfr reader
// and assuming you are parsing with `-d` flag only
let mut rdr = trfr::Reader::from_reader(io::stdin(), trfr::Flag::D);
for result in rdr.records() {
let record = result?;
println!("{:?}", record);
}
Ok(())
}

fn main() {
if let Err(err) = example() {
println!("error running example: {}", err);
process::exit(1);
}
}

No runtime deps