Crates.io | hmm_tblout |
lib.rs | hmm_tblout |
version | |
source | src |
created_at | 2024-05-03 12:53:43.980774+00 |
updated_at | 2025-02-12 13:41:20.267247+00 |
description | Parse nhmmer tblout files. |
homepage | |
repository | https://github.com/ARU-life-sciences/hmm_tblout |
max_upload_size | |
id | 1228733 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
hmm_tblout
Simple parsing of tabular output from HMMER::nhmmer --tblout ...
, and also Infernal cmscan/cmsearch
.
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(())
}