Pharokka: Fast Phage Annotation Tool

repository·master·Indexed 42 days ago

https://github.com/gbouras13/pharokka

A rapid, standardized annotation tool for bacteriophage genomes and metagenomes. Pharokka provides functions for genome annotation, antimicrobial resistance prediction, tRNA gene prediction, sequence formatting, and sequence assembly. It utilizes PHANOTATE for gene prediction and matches sequences to PHROGs, CARD, and VFDB databases using MMseqs2 and PyHMMER. It can be used as part of a pipeline with Phold and Phynteny to maximize functional annotation of viral genetic material.

Tokens
28.6K
Snippets
81
Records
131
Agent score
52%

What's inside Pharokka

  1. Overview of Pharokka

    master

    Pharokka is a rapid, standardized annotation tool designed specifically for bacteriophage genomes and metagenomes. It provides functions for genome annotation, antimicrobial resistance prediction, tRNA gene prediction, sequence formatting, and sequence assembly.

    While Pharokka is optimized for phage, users looking for bacterial genome annotation should use Bakta or Prokka.

  2. Overview of the Pharokka annotation workflow

    master

    Pharokka is a fast, scalable bacteriophage annotation pipeline that follows these main steps:

    1. Gene Prediction: Uses PHANOTATE by default (tailored for bacteriophages). Alternatives include Prodigal (via pyrodigal) and Prodigal-gv (via pyrodigal-gv).
    2. Functional Annotation: Matches predicted coding sequences (CDS) to several databases using MMseqs2:
      • PHROGs
      • CARD
      • VFDB
    3. HMM Matching (v1.4.0+): Additionally matches CDS to the PHROGs database using sensitive Hidden Markov Models via PyHMMER.

    Main Outputs

    • GFF file: Suitable for downstream pangenomic pipelines like Roary.
    • cds_functions.tsv: A summary file containing counts of CDSs, tRNAs, tmRNAs, CRISPRs, and functions assigned to CDSs based on the PHROGs database.
  3. Use cases for pharokka

    master

    Pharokka is designed for two primary workflows:

    1. Local, rapid annotation: Quickly annotate a phage without relying on web-servers (like RAST/PATRIC or CPT Galaxy).
    2. High-throughput batch processing: Annotate large numbers of phages or phage contigs quickly and with consistent results.

    Key Technical Advantages

    • Improved Small Gene Prediction: By default, pharokka uses PHANOTATE for gene prediction. This is specifically optimized for phages and is more likely to predict small phage genes compared to prokaryote-centric tools like Prodigal.
    • Conservative AMR Detection: When searching for Antimicrobial Resistance (AMR) genes using the VFDB and CARD databases, pharokka employs conservative thresholds of 80% identity over 40% coverage, following recommendations for AMR gene searches.
  4. How to use Pharokka, Phold, and Phynteny together

    master

    Pharokka, Phold, and Phynteny are complementary tools that can be used in a pipeline to substantially increase the annotation rate of phage genomes:

    1. Pharokka: Performs initial rapid standardized annotation (including HMM-based methods).
    2. Phold: Uses structural homology to improve annotation. It is recommended to run phold after pharokka because phold takes the Genbank output of Pharokka as input. phold excels at characterizing less-known phages but lacks some of Pharokka's features like tRNA/tmRNA identification and CRISPR repeat detection.
    3. Phynteny: Uses phage synteny (conserved gene order) to assign hypothetical proteins to PHROG categories. This can be used to add extra annotations to hypothetical genes remaining after running phold.

    For a non-installation option, you can run this entire pipeline via a Google Colab notebook.

  5. How to use phold to improve Pharokka annotations

    master

    While pharokka is a fast annotation pipeline, phold uses structural homology to provide even more accurate functional predictions, especially for less characterized phages (e.g., from metagenomic datasets).

    Because pharokka identifies features that phold currently lacks (such as tRNA, tmRNA, CRISPR repeats, and INPHARED taxonomy searches), the recommended workflow is to run phold after running pharokka.

    phold accepts the Genbank output generated by pharokka as its input, allowing you to easily update your existing annotations with improved functional predictions.

  6. How meta mode and fast mode affect performance and sensitivity

    master

    When working with metagenomic/metavirome samples, you can choose between different modes that balance speed and sensitivity:

    • Meta Mode (-m): Specifically for metavirome input samples.
      • By default, it uses --mmseqs2_only (fastest).
      • Use --meta_hmm to run both MMseqs2 and PyHMMER for higher sensitivity (recommended for metagenomes).
    • Fast Mode (--fast): Runs only PyHMMER (HMMs) with PHROGs.
      • This is significantly faster (e.g., ~45-75 seconds for a single phage) but will not detect virulence factors or AMR genes.
      • It is designed for phage isolates and is not recommended for large metagenomes where sensitivity is critical.
  7. Use meta mode for metagenome-assembled viral genomes

    master

    When processing large collections of genomes, such as metagenome-assembled viral genomes (e.g., crAss-like phages), enable meta mode using the -m flag to optimize the run.

    # Example enabling meta mode
    pharokka -m [other options]
  8. How Pharokka works: Workflow and Tools

    master

    Pharokka is a fast, scalable bacteriophage annotation tool that follows this workflow:

    1. Gene Prediction: Uses PHANOTATE by default (tailored for bacteriophages). Alternatives include pyrodigal (implementing Prodigal) and pyrodigal-gv (implementing Prodigal-gv).
    2. Functional Annotation: Matches predicted coding sequences (CDS) to the PHROGs, CARD, and VFDB databases using MMseqs2.
    3. HMM Matching: As of v1.4.0, it also uses PyHMMER for more sensitive PHROGs matching.

    Main Outputs:

    • A GFF file suitable for downstream pangenomic pipelines like Roary.
    • A cds_functions.tsv file containing counts of CDSs, tRNAs, tmRNAs, CRISPRs, and PHROGs-assigned functions.
  9. Annotate non-coding RNAs with Rfam

    master

    As of v1.11.0, Pharokka annotates non-coding RNAs (riboswitches, ribozymes, regulatory sRNAs, introns, leader elements) by scanning against Rfam using Infernal. This is enabled by default.

    Key behaviors:

    • Meta Mode: Rfam is skipped by default in meta mode to save time. To run it in meta mode, use the --meta_rfam flag.
    • Redundancy: Rfam is additive and does not replace tRNAscan-SE, ARAGORN, or MinCED. However, hits to Rfam's tRNA (RF00005) and tmRNA (RF00023) models are discarded by default to avoid conflicts. To keep them, use --rfam_keep_trna.
    • Output: Results are written to {prefix}_ncrna.tsv and included as ncRNA features in the .gff and .gbk files.

    To disable Rfam entirely, use --skip_rfam.

    # Run Rfam in meta mode
    pharokka run -i <fasta> -o <out> -d <db> -m --meta_rfam
    
    # Keep Rfam tRNA/tmRNA hits despite potential conflicts
    pharokka run -i <fasta> -o <out> -d <db> --rfam_keep_trna
  10. Understand the main GFF3 output

    master

    The primary output of pharokka is a .gff (GFF3) file. This file is designed for compatibility with downstream pangenomic pipelines like Roary or panaroo.

    Key attributes in the GFF3 file:

    • phrog=: Displays the closest matching PHROG, or No_PHROG if no match meets the E-value threshold.
    • top_hit=: Shows the closest matching protein in the PHROGs database.
    • 6th Column: Contains the coding score. Depending on the predictor used, this is either the PHANOTATE w_orf score (more negative = more likely a gene) or the Prodigal coding score (larger = more likely a gene).
  11. Prepare phage genomes for GenBank submission

    master

    To ensure viral genomes are submitted to GenBank in compliance with NCBI, ICTV, and MIUViG guidelines, use the following workflow:

    1. Annotate with pharokka to generate .gbk or .tbl files.
    2. Improve annotations using phold.
    3. Convert and Validate using suvtk. Use suvtk gbk2tbl to convert phold GenBank files into the feature tables required for submission.

    This workflow is supported from pharokka v1.8.2 onwards.

  12. Optimize Pharokka for large metavirome datasets

    master

    When processing extremely large datasets (e.g., thousands of input contigs), you can optimize performance by choosing the right gene predictor and search mode:

    • For maximum speed: Use Prodigal as the gene predictor. Benchmarks show that pharokka Prodigal Meta Mode is significantly faster than PHANOTATE for large datasets.
    • For high sensitivity: If compute resources allow, use --fast or --meta_hmm. While slower for metagenomes, these modes provide much higher sensitivity for HMM-based searches.
    • Scaling behavior: Pharokka scales well because MMseqs2 uses a 'many vs many' approach, meaning the time taken for database searches remains relatively small even as input size increases. The primary time sinks are gene prediction (especially PHANOTATE) and tRNA-scan SE2.