Crate hmm_tblout

Source
Expand description

The hmm_tblout crate is purely for parsing the output of certain HMMER3 programs. The output is generated by passing the --tblout flag to the HMMER3 program.

§Example

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(())
}

Structs§

Error
Error when parsing HMMER tblout text.
Meta
Metadata about the search that produced the HMMER tblout file.
Reader
A reader over the records of a HMM tblout file.
Writer
Writer for HMMER-compatible files

Enums§

ErrorKind
Specific errors that can happen.
Program
The program used to generate the output.
Record
A record in a HMMER tblout file. Can either be a protein record or a DNA record.
RecordsIntoIter
An owned iterator over the records of a refer file.
RecordsIter
An iterator over the records of a refer file.
Strand
The strandedness of the HMM hit in the genome.

Type Aliases§

Result
A type alias for Result<T, hmm_tblout::Error>.