API Reference

Cython bindings and Python interface to HMMER3.

HMMER is a biological sequence analysis tool that uses profile hidden Markov models to search for sequence homologs. HMMER3 is maintained by members of the the Eddy/Rivas Laboratory at Harvard University.

pyhmmer is a module, implemented using the Cython language, that provides bindings to HMMER3. It directly interacts with the HMMER internals, which has several advantages over CLI wrappers like hmmer-py.

References

Larralde, Martin, and Georg Zeller. “PyHMMER: A Python Library Binding to HMMER for Efficient Sequence Analysis”. Bioinformatics, 19 April 2023, btad214. doi:10.1093/bioinformatics/btad214. PMID:37074928.

HMMER

pyhmmer.hmmer.hmmsearch

Search HMM profiles against a sequence database.

pyhmmer.hmmer.hmmscan

Scan query sequences against a profile database.

pyhmmer.hmmer.phmmer

Search protein sequences against a sequence database.

pyhmmer.hmmer.nhmmer

Search nucleotide sequences against a sequence database.

pyhmmer.hmmer.hmmpress

Press several HMMs into a database.

pyhmmer.hmmer.hmmalign

Align several sequences to a reference HMM, and return the MSA.

Easel

Data Structures

pyhmmer.easel.Bitfield

A statically sized sequence of booleans stored as a packed bitfield.

pyhmmer.easel.KeyHash

A dynamically resized container to store byte keys using a hash table.

Sequences

pyhmmer.easel.Sequence

An abstract biological sequence with some associated metadata.

pyhmmer.easel.TextSequence

A biological sequence stored in text mode.

pyhmmer.easel.DigitalSequence

A biological sequence stored in digital mode.

Sequence Blocks

pyhmmer.easel.SequenceBlock

An abstract container for storing Sequence objects.

pyhmmer.easel.TextSequenceBlock

A container for storing TextSequence objects.

pyhmmer.easel.DigitalSequenceBlock

A container for storing DigitalSequence objects.

Sequence File

pyhmmer.easel.SequenceFile

A wrapper around a sequence file, containing unaligned sequences.

Alignments

pyhmmer.easel.MSA

An abstract alignment of multiple sequences.

pyhmmer.easel.TextMSA

A multiple sequence alignement stored in text mode.

pyhmmer.easel.DigitalMSA

A multiple sequence alignment stored in digital mode.

Alignment File

pyhmmer.easel.MSAFile

A wrapper around a multiple-alignment file.

Linear Algebra

pyhmmer.easel.Vector

An abstract 1D array of fixed size.

pyhmmer.easel.VectorF

A vector storing single-precision floating point numbers.

pyhmmer.easel.VectorU8

A vector storing byte-sized unsigned integers.

pyhmmer.easel.Matrix

An abstract 2D array of fixed size.

pyhmmer.easel.MatrixF

A matrix storing single-precision floating point numbers.

pyhmmer.easel.MatrixU8

A matrix storing byte-sized unsigned integers.

Miscellaneous

pyhmmer.easel.Alphabet

A biological alphabet, including additional marker symbols.

pyhmmer.easel.Randomness

A portable, thread-safe random number generator.

pyhmmer.easel.SSIReader

A read-only handler for sequence/subsequence index file.

pyhmmer.easel.SSIWriter

A writer for sequence/subsequence index files.

Plan7

Profile HMMs

pyhmmer.plan7.HMM

A data structure storing the Plan7 Hidden Markov Model.

pyhmmer.plan7.Profile

A Plan7 search profile.

pyhmmer.plan7.OptimizedProfile

An optimized profile that uses platform-specific instructions.

pyhmmer.plan7.OptimizedProfileBlock

A container for storing OptimizedProfile objects.

HMM Files

pyhmmer.plan7.HMMFile

A wrapper around a file (or database), storing serialized HMMs.

pyhmmer.plan7.HMMPressedFile

An iterator over each OptimizedProfile in a pressed HMM database.

Pipelines

pyhmmer.plan7.Pipeline

An HMMER3 accelerated sequence/profile comparison pipeline.

pyhmmer.plan7.LongTargetsPipeline

An HMMER3 pipeline tuned for long targets.

pyhmmer.plan7.Builder

A factory for constructing new HMMs from raw sequences.

pyhmmer.plan7.Background

The null background model of HMMER.

Results

pyhmmer.plan7.TopHits

An immutable ranked list of top-scoring hits.

pyhmmer.plan7.Hit

A high-scoring database hit found by the comparison pipeline.

pyhmmer.plan7.Domains

A read-only view over the domains of a single Hit.

pyhmmer.plan7.Domain

A single domain in a query Hit.

pyhmmer.plan7.Alignment

An alignment of a sequence to a profile.

Traces

pyhmmer.plan7.TraceAligner

A factory for aligning several sequences to a reference model.

pyhmmer.plan7.Traces

A list of tracebacks obtained by aligning several sequences to a model.

pyhmmer.plan7.Trace

A traceback for the alignment of a model to a sequence.

Iterative Searches

pyhmmer.plan7.IterativeSearch

A helper class for running iterative queries like JackHMMER.

pyhmmer.plan7.IterationResult

The results of a single iteration from an IterativeSearch.

Miscellaneous

pyhmmer.plan7.Cutoffs

A mutable view over the score cutoffs of a HMM or a Profile.

pyhmmer.plan7.EvalueParameters

A mutable view over the e-value parameters of a HMM or a Profile.

pyhmmer.plan7.Offsets

A mutable view over the disk offsets of a profile.

pyhmmer.plan7.Transitions

A helper enum for indices of the HMM transition probability matrix.

Daemon

pyhmmer.daemon.Client

A socket-based client to communicate with a HMMER daemon server.

pyhmmer.daemon.IterativeSearch

A helper class for running iterative queries against a HMMER daemon.

Errors

pyhmmer.errors.AllocationError

A memory error that is caused by an unsuccessful allocation.

pyhmmer.errors.UnexpectedError

An unexpected error that happened in the C code.

pyhmmer.errors.EaselError

An error that was raised from the Easel code.

pyhmmer.errors.AlphabetMismatch

A value error caused by an alphabet mismatch.

pyhmmer.errors.ServerError

A runtime error that happened in a hmmpgmd server.

pyhmmer.errors.MissingCutoffs

The model is missing bitscore cutoffs required by the pipeline.

pyhmmer.errors.InvalidParameter

An invalid parameter value was given.

pyhmmer.errors.InvalidHMM

A value error caused by a HMM that fails validation.