pyhmmer
Cython bindings and Python interface to HMMER3.
What it is and what it does
PyHMMER wraps HMMER3, a mature bioinformatics tool for finding sequence homologs using profile hidden Markov models. Instead of spawning external binaries and parsing fixed-width text output, it exposes HMMER's C internals directly through Cython, letting you work entirely in memory with Python objects. You load sequences and HMM profiles, run searches like hmmsearch or hmmscan, and get back structured hit objects you can query and filter in Python—no temporary files, no output parsing, no intermediate format conversions.
The package is designed for researchers and pipeline developers who want to embed HMMER searches into Python workflows without managing separate HMMER installations. It supports building HMMs from alignments, scanning sequences against profile databases, and aligning sequences to profiles. Parallelization uses Python threads and can adapt to multi-CPU systems. The single runtime dependency is psutil, and pre-built wheels cover most common platforms, though Unix-only HMMER internals mean Windows is not supported.
Use it for:
- Annotate protein domains in genomic data by searching sequences against Pfam or custom HMM libraries within a Python pipeline.
- Build HMMs from multiple sequence alignments and immediately search them against a sequence database without leaving Python.
- Integrate sequence homology detection into automated genome analysis or metagenomics workflows that already use Biopython or similar libraries.
- Retrieve and filter high-scoring hits from HMMER searches programmatically, sorting or post-processing results in memory.
- Parallelize hmmsearch or hmmscan across multiple CPUs for faster annotation of large sequence sets.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyHMMER provides Python bindings to HMMER3, a biological sequence analysis tool that uses profile hidden Markov models to search for sequence homologs in protein or DNA databases.
Yes. PyHMMER is actively maintained, has no known vulnerabilities, carries permissive licenses, and solves a real problem for bioinformatics workflows—embedding HMMER searches in Python without subprocess overhead or output parsing. Medium install friction is acceptable given the availability of pre-built wheels and the value of in-memory, structured access to HMMER results. Suitable for research and production use.
Install
pyhmmer on PyPI
pip
pip install pyhmmeruv
uv add pyhmmerpoetry
poetry add pyhmmerInstalling pyhmmer
Before you install
Medium install friction due to compiled C/Cython components, but pre-built wheels are available for Linux and macOS on x86-64 and Arm64. Actively maintained with a release just 1 day old and ongoing repository activity.
License in practice
Licensed under MIT, BSD-3-Clause, and BSD-2-Clause—all permissive licenses. No restrictions on commercial or private use.
Quickstart
pip install pyhmmer
import pyhmmer
with pyhmmer.easel.SequenceFile("sequences.faa", digital=True) as seq_file:
sequences = seq_file.read_block()
with pyhmmer.plan7.HMMFile("model.hmm") as hmm_file:
for hits in pyhmmer.hmmsearch(hmm_file, sequences, cpus=4):
print(f"Found {len(hits)} hits for {hits.query.name}")
HMMER3 internals are Unix-only; Windows is not supported. Requires a C compiler and Cython for source builds on platforms without pre-built wheels.
Verify before relying
- Whether PyPy support (listed in classifiers) is actively tested and maintained alongside CPython.
- Performance characteristics on very large sequence databases or HMM libraries beyond the Pfam benchmark mentioned.
Package facts
| License | MIT AND BSD-3-Clause AND BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — psutil |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,556,065/month — #3,769 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyhmmer-0.12.2-cp310-cp310-macosx_10_9_x86_64.whl; pyhmmer-0.12.2-cp310-cp310-macosx_11_0_arm64.whl; pyhmmer-0.12.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyhmmer-0.12.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyhmmer-0.12.2-cp310-cp310-win_amd64.whl; pyhmmer-0.12.2-cp311-cp311-macosx_10_9_x86_64.whl; pyhmmer-0.12.2-cp311-cp311-macosx_11_0_arm64.whl; pyhmmer-0.12.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyhmmer-0.12.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyhmmer-0.12.2-cp311-cp311-win_amd64.whl; pyhmmer-0.12.2-cp312-abi3-macosx_10_13_x86_64.whl; pyhmmer-0.12.2-cp312-abi3-macosx_11_0_arm64.whl; pyhmmer-0.12.2-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyhmmer-0.12.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyhmmer-0.12.2-cp312-abi3-win_amd64.whl; pyhmmer-0.12.2-cp314-cp314t-macosx_10_15_x86_64.whl; pyhmmer-0.12.2-cp314-cp314t-macosx_11_0_arm64.whl; pyhmmer-0.12.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyhmmer-0.12.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyhmmer-0.12.2-cp38-cp38-macosx_10_9_x86_64.whl
Keywords: bioinformatics, profile, HMM, sequence, pfam
Tags
More Bio-Informatics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
biopythonBiopython provides Python tools for…
unclear · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
PubChemPyPubChemPy is a Python wrapper around the…
permissive · top 5,000 on PyPI
hmmlearnhmmlearn implements unsupervised learning and…
permissive · top 5,000 on PyPI
pysylphPysylph provides Python bindings to sylph,…
permissive · top 15,000 on PyPI
abnumberAbNumber provides Python APIs to number and…
permissive · top 15,000 on PyPI
logomakerLogomaker creates customized sequence…
permissive · top 15,000 on PyPI
tmtoolsProvides Python bindings to the TM-align…
copyleft · top 15,000 on PyPI
biotiteBiotite provides a unified Python library for…
permissive · top 5,000 on PyPI
pipebioA Python SDK for the PipeBio cloud platform…
permissive · top 15,000 on PyPI
fair-esmProvides pre-trained transformer protein…
permissive · top 15,000 on PyPI
varcodeVarcode loads and analyzes genomic variant…
permissive · top 15,000 on PyPI