hmm_tblout

Crates.iohmm_tblout
lib.rshmm_tblout
version0.2.1
sourcesrc
created_at2024-05-03 12:53:43.980774
updated_at2024-05-10 07:36:21.974466
descriptionParse nhmmer tblout files.
homepage
repositoryhttps://github.com/ARU-life-sciences/hmm_tblout
max_upload_size
id1228733
size70,779
Max Brown (Euphrasiologist)

documentation

README

hmm_tblout

Simple parsing of tabular output from HMMER::nhmmer --tblout ....

Example

Run this example using cargo run --example print_coordinates ./data/test.tbl.

use hmm_tblout;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // get the command line args, only parse the
    // first one which should be a fasta file
    let args: Vec<String> = std::env::args().collect();
    if args.len() < 2 {
        println!("Usage: print_coordinates <tblout_file>");
        std::process::exit(1);
    }

    let reader = hmm_tblout::Reader::from_path(args[1].clone())?;

    for record in reader.into_records() {
        let r = record?;
        let tname = r.target_name();
        let strand = r.strand().unwrap();
        let alifrom = r.ali_from().unwrap();
        let alito = r.ali_to().unwrap();

        println!("{}\t{}\t{}\t{}", tname, strand, alifrom, alito);
    }

    Ok(())
}

Yet to implement

May handle these in the future. Or feel free to contribute!

  • Does not handle the description column, as this may contain spaces.
Commit count: 11

cargo fmt