Skip to main content

Combating Phage Genomes


phu - Phage Utilities

phu (phage utilities) is a command-line toolkit for phage and viral genomics. Each command answers one common question about your contigs: which carry a protein family, which carry relatives of proteins you have, which genes look auxiliary, which genomes group together. Searches, gene prediction and alignments run inside phu, the reference databases (Pfam, KOfam, PHROG, ECOD, dbCAN, CheckAMG) install themselves on first use, and every run records what it did.

Installation

You can install phu using mamba or conda from the bioconda channel:

mamba create -n phu bioconda::phu

To try unreleased changes from the main branch without installing them using uv:

uvx --from git+https://github.com/camilogarciabotero/phu.git@main phu --help

Usage

As a command-line tool, phu follows a modular structure. You can access different functionalities through subcommands. The general syntax is:

phu <command> [options]

For the complete command list and global options, run:

phu --help

The top-level help menu is:

Usage: phu [OPTIONS] COMMAND [ARGS]...                                         
                                                                                
 Phage utilities CLI                                                            
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --version  -v        Show version and exit.                                  │
│ --help     -h        Show this message and exit.                             │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Main ───────────────────────────────────────────────────────────────────────╮
│ screen             Find contigs that carry given protein families.           │
│ jack               Find contigs carrying relatives of seed proteins, by      │
│                    iterative search.                                         │
│ avger              Predict and curate putative auxiliary viral genes.        │
│ cluster            Sequence clustering wrapper around external 'vclust'.     │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Database ───────────────────────────────────────────────────────────────────╮
│ dbs                Install and check the phu-db database bundle              │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Utils ──────────────────────────────────────────────────────────────────────╮
│ phrogs             Find PHROG identifiers by alias, functional category or   │
│                    annotation, for use with `phu screen`.                    │
│ clean              Remove phu's cache and/or its installed databases.        │
│ normalize-lineage  Normalize vContact lineage predictions without changing   │
│                    column names.                                             │
╰──────────────────────────────────────────────────────────────────────────────╯

Commands

  • screen: Find contigs that carry given protein families: your own HMMs, or Pfam, KOfam, PHROG, ECOD and dbCAN families by name.
  • jack: Find contigs carrying relatives of seed proteins (yours, or PHROG families) by iterative search with jackhmmer.
  • cluster: Cluster viral sequences into vOTUs, dereplicated representatives, or genus- and species-level groups.
  • avger: Predict proteins, annotate them against Pfam, KOfam and PHROG, and score putative auxiliary viral genes.
  • normalize-lineage: Normalize vContact lineages while preserving input columns.
  • phrogs: Find PHROG identifiers by alias (mcp, terl, portal, ...), functional category or annotation, to use with screen and jack.
  • clean: List or remove the prediction cache (--cache) and the installed databases (--dbs, asks first).
  • dbs prepare: Download, verify and install the reference database bundle ahead of time.

Each command page includes the current CLI help menu, input/output behavior, examples, and workflow guidance.

Databases

screen, jack and avger use reference databases: Pfam, KOfam, PHROG, ECOD, dbCAN and the CheckAMG AVG tables. phu ships them as one pinned and checksummed bundle, phu-db, hosted on Zenodo. The bundle installs automatically the first time a command needs it, or ahead of time with:

phu dbs prepare

The download is about 2.9 GB and shows its progress; the install needs about 20 GB of free disk while it runs and keeps about 21 GB, including fast-loading copies of the models. Useful settings:

Setting Effect
PHU_DB_FOLDER Where the databases are installed (default ~/.local/share/phu/db). Point it at a shared folder so every job reuses one install.
PHU_DB_BUNDLE or phu dbs prepare --bundle PATH Install from a pre-downloaded phu-db.tar.gz, for nodes without internet access.
PHU_DB_CONNECTIONS or phu dbs prepare --connections N Parts of the bundle downloaded at once (default 8).
PHU_DB_VERIFY=1 or phu dbs prepare --verify Re-hash every installed file and reinstall if any check fails.

Each run records the bundle version and database releases it used in the .phu/ folder of its output. See Databases and Provenance for offline and HPC use, what the bundle contains, and citation.

For screening pass/fail and threshold rules, see Screen thresholds.

Cache Handling

phu caches predicted proteins for screen, jack and avger so repeated runs can reuse the same translated proteins when the prediction inputs have not changed. Search settings such as HMM files, seed markers, combine mode, and output folder do not affect the cache.

The cache is rebuilt when you change the contig input, --mode, an explicit --ttable, or the protein-length filter. Without --ttable, meta-mode contigs use the translation table selected by pyrodigal-gv. For phu screen, that is --min-protein-len-aa. For phu jack, both --min-gene-len and --min-protein-len-aa participate in the cache key.

To remove previously cached predictions, run phu clean --cache.

See the full Cache Handling guide, including cache locations, disabling reuse, and cleanup behavior.

Contributing

We welcome contributions to phu. See CONTRIBUTING.md for testing and documentation requirements. Notable changes are tracked in CHANGELOG.md.

Developers

You can also install the development version of phu directly from GitHub with uv:

git clone https://github.com/camilogarciabotero/phu.git
cd phu
uv sync

phu is also available on PyPI and can be installed with uv:

uv tool install phu

Run the test suite and documentation build from a synced development checkout:

uv sync
uv run pytest
uv run mkdocs build --strict

The project uses ruff for linting when the lint dependency group is installed:

uv run ruff check src tests

References

This program uses several key tools and libraries, make sure to acknowledge them when using phu:

  • vclust: A high-performance clustering tool for viral sequences:

Zielezinski A, Gudyś A, Barylski J, Siminski K, Rozwalak P, Dutilh BE, Deorowicz S. Ultrafast and accurate sequence alignment and clustering of viral genomes. Nat Methods. https://doi.org/10.1038/s41592-025-02701-7

  • FAMSA and pyfamsa: A multiple sequence aligner for large protein families, and its Python bindings.

Deorowicz, S., Debudaj-Grabysz, A., & Gudyś, A. (2016). FAMSA: Fast and accurate multiple sequence alignment of huge protein families. Scientific Reports, 6, 33964. https://doi.org/10.1038/srep33964

  • trimAl and pytrimal: Automated alignment trimming, and its Python bindings.

Capella-Gutiérrez, S., Silla-Martínez, J. M., & Gabaldón, T. (2009). trimAl: a tool for automated alignment trimming in large-scale phylogenetic analyses. Bioinformatics, 25(15), 1972–1973. https://doi.org/10.1093/bioinformatics/btp348

  • Prodigal: A gene prediction tool for prokaryotic genomes.

Hyatt, D., Chen, G. L., LoCascio, P. F., Land, M. L., Larimer, F. W., & Hauser, L. J. (2010). Prodigal: prokaryotic gene recognition and translation initiation site identification. BMC bioinformatics, 11(1), 119. https://doi.org/10.1186/1471-2105-11-119

  • pyrodigal: A tool for gene prediction in prokaryotic genomes.

Larralde, M., (2022). Pyrodigal: Python bindings and interface to Prodigal, an efficient method for gene prediction in prokaryotes. Journal of Open Source Software, 7(72), 4296, https://doi.org/10.21105/joss.04296

  • HMMER: A suite of tools for sequence analysis using profile hidden Markov models.

Eddy, S. R. (2011). Accelerated Profile HMM Searches. PLoS Computational Biology, 7(10), e1002195. https://doi.org/10.1371/journal.pcbi.1002195

  • pyHMMER: Python bindings for HMMER.

Larralde, M., & Zeller, G. (2023). PyHMMER: a Python library binding to HMMER for efficient sequence analysis. Bioinformatics, 39(5). https://doi.org/10.1093/bioinformatics/btad214

  • Pfams: A comprehensive collection of protein families and domains based on hidden Markov models.

Pfam: The protein families database in 2021: J. Mistry, S. Chuguransky, L. Williams, M. Qureshi, G.A. Salazar, E.L.L. Sonnhammer, S.C.E. Tosatto, L. Paladin, S. Raj, L.J. Richardson, R.D. Finn, A. Bateman, Nucleic Acids Research (2021) doi: 10.1093/nar/gkaa913

  • KOFamKOALA: KEGG ortholog assignment based on profile HMM and adaptive score threshold.

Aramaki T., Blanc-Mathieu R., Endo H., Ohkubo K., Kanehisa M., Goto S., Ogata H. KofamKOALA: KEGG ortholog assignment based on profile HMM and adaptive score threshold. Bioinformatics. 2019 Nov 19. pii: btz859. doi: 10.1093/bioinformatics/btz859.

  • V-Score-Search: A framework for identifying viral sequences and auxiliary viral genes and CheckAMG: Reference data and curation resources for auxiliary metabolic and auxiliary viral gene analysis.

Martin et al. (2025): A call for caution in the biological interpretation of viral auxiliary metabolic genes. Nature Microbiology, 10, 2122-2129. doi: 10.1038/s41564-025-02095-4

Zhou et al. (2026). V- and VL-scores unveil viral signatures and origins of protein families. Nat Commun 17, 5828 (2026) doi: 10.1038/s41467-026-72028-0

Metadata

Release files for phu 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phu 0.10.0
File Size Uploaded Provenance Actions
phu-0.10.0.tar.gz 220.2 kB With provenance Details for phu-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for phu 0.10.0
File Interpreter ABI Platform Actions
phu-0.10.0-py3-none-any.whl Python 3 none any Details for phu-0.10.0-py3-none-any.whl

Total release size: 370.0 kB

Release files / phu-0.10.0.tar.gz

Download URL phu-0.10.0.tar.gz
Size 220.2 kB
Tags Source
SHA-256 checksum
How to use checksums
27a76562fa13da6abad631d762330b2602dd6912e0e697f1d6b4c104d2e9cd5a
BLAKE2b-256 checksum
How to use checksums
e8d2788b993c8eaa7e329d0fb0de8e5d6b201991193e4b1aabdb6e5273b3b08e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / phu-0.10.0-py3-none-any.whl

Download URL phu-0.10.0-py3-none-any.whl
Size 149.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c083cd0b26e8337bc38b12e0d3368f28979bc3b239f1c4f10c5ad9058380c7cf
BLAKE2b-256 checksum
How to use checksums
d143be04dbac152e001657a0d3119f1f9febdf41a6c1e8f0036cb58a43722cb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for phu 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for phu-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page