Package hmm

import "github.com/TuftsBCB/io/hmm"
Overview
Index

Overview ▾

Package hhm parses hhm files generated by the HHsuite programs. (i.e., hhmake, hhsearch, hhblits, etc.)

Each HHM file can be thought of as contain four logical sections: 1) The header with meta information about the HMM. 2) Optional secondary structure information from DSSP and/or PSIPED. 3) A multiple sequence alignment in A3M format. 4) The HMM formatted similarly to HMMER's hmm files, but without pseudo counts.

func WriteHHM

func WriteHHM(w io.Writer, hhm *HHM) error

WriteHHM writes an hmm file that can be read by HHsuite programs (i.e., hhblits, hhsearch, etc).

func WriteHMM

func WriteHMM(w io.Writer, hmm *HMM) error

WriteHMM writes an hmm file that can be read by HMMER.

Currently, this function is broken. Do not use.

type HHM

type HHM struct {
    Meta      Meta
    Secondary HHMSecondary
    MSA       seq.MSA
    HMM       *seq.HMM
}

HHM corresponds to an hhm file produce by HHsuite (i.e., hhblits or hhmake).

func ReadHHM

func ReadHHM(r io.Reader) (*HHM, error)

func (*HHM) Slice

func (hhm *HHM) Slice(start, end int) *HHM

Slice dices up an entire HHM file. The slice indices should be in terms of the number of match/delete states in the underlying HMM. All secondary structure annotations are also sliced. The multiple sequence alignment is also sliced. The NEFF for the HHM is also re-computed as the average of all NeffM scores in each HMM column.

type HHMSecondary

type HHMSecondary struct {
    SSdssp    *seq.Sequence
    SAdssp    *seq.Sequence
    SSpred    *seq.Sequence
    SSconf    *seq.Sequence
    Consensus *seq.Sequence
}

An HHMSecondary represents secondary structure information that *may* be in an HHM file. Any or all members of an HHMSecondary may be nil.

func (HHMSecondary) Slice

func (ss HHMSecondary) Slice(start, end int) HHMSecondary

Slice will create a new collection of secondary structure sequences where each sequence has been sliced with the given start/end parameters.

type HMM

type HMM struct {
    Meta Meta
    HMM  *seq.HMM
}

HMM corresponds to an hmm file produced by HMMER.

func ReadHMM

func ReadHMM(r io.Reader) (*HMM, error)

ReadHMM reads an hmm file produced by HMMER.

Currently, this function is broken. Do not use.

type Meta

type Meta struct {
    // Corresponds to the HHsearch version for which this format was
    // first introduced.
    FormatVersion string

    // The name of the HMM and an optional description.
    Name string

    // Family if the sequence is from SCOP or PFAM.
    Fam string

    // Command that was used to generate the file.
    Com string

    // Diversity of the alignment, calculated as the exp of the negative
    // entropy averaged over all columns of the alignment.
    Neff seq.Prob

    // ???
    File string

    // Number of match states and number of columns. Doesn't appear to be
    // in machine readable format.
    Leng string

    // Pre-filter details? Not machine readable.
    Filt string

    // EVD parameters. (Not used in HHsuite 2+, I think.)
    EvdLambda, EvdMu float64

    // Whether the HMM has pseudo count correction.
    Pct bool

    // Date file was generated.
    // e.g., 'Sat Nov 10 21:31:12 2012'
    Date string

    // ???
    Desc string
}