01_Training: Phage Bioinformatics

Workshop Guide

Introduction to
Phage Bioinformatics

From raw Illumina reads to an annotated, visualised bacteriophage genome

SeqFu Shovill Pharokka Phold clinker VipTree
Before you start: this guide assumes all tools and environments (qc_env, shovill, pharokka, phold) and their databases are already installed inside WSL. If you haven’t set these up yet, work through the installation guide first.
Open WSL and set up your working directory:
wsl
cd ~
mkdir -p ~/phage_training/input
Your raw test files will be posted in the training Discord channel. Also you can download them here Google drive If you’re working from Windows, check what’s in your Downloads folder from the WSL side:
ls /mnt/c/Users/USER/Downloads/drive*/
(replace USER with your own Windows username)

Copy the files into your WSL working directory, then move into it:
cp /mnt/c/Users/USER/Downloads/drive*/* ~/phage_training/input/
cd ~/phage_training/input
ls
You should see your read files (phage_R1.fq, phage_R2.fq) and the assembly file (Shovill_Contigs.fasta).
01

Read QC

SeqFu

Before assembling anything, always look at your test genome. Make sure you’re in ~/p/input.

# activate the QC environment
conda activate qc_env
ls
seqfu stats *.fq

Save the stats to a file instead of just printing them:

seqfu stats *.fq > stats.tsv
ls
head stats.tsv
conda deactivate
TIP Want to trim adapters/low-quality bases before assembly? fastp pairs well here if it’s installed alongside SeqFu in qc_env.

Read more about SeqFu: telatin.github.io/seqfu2

02

Genome Assembly

Shovill

Shovill wraps SPAdes (and other assemblers) with sensible defaults for small, high-coverage genomes like phages — much faster than running SPAdes directly. Still inside ~/phage_training/input:

conda activate shovill

shovill --outdir ./assembly \
  --R1 phage_R1.fq \
  --R2 phage_R2.fq \
  --cpus 4

ls
conda deactivate

Your assembled contigs will land in ~/phage_training/input/assembly/contigs.fa.

TIP A phage genome should usually assemble into a single contig (or a small handful). Many fragmented contigs can point to low coverage, contamination, or a genuinely complex/segmented genome — worth investigating, not ignoring.
03

Genome Annotation

Pharokka

Pharokka is a rapid annotation tool built specifically for bacteriophage genomes — gene calling, functional annotation against phage-specific databases, tRNA/CRISPR detection, and more.

conda activate pharokka

pharokka.py -i Shovill_Contigs.fasta -o ./pharokka -t 4

ls
ls pharokka

Have a look at the outputs — in particular pharokka.gbk, pharokka.gff, and the summary file.

TIP If pharokka.py errors out partway through — often because ./pharokka already has partial contents from an earlier attempt — delete or rename that folder and re-run rather than resuming into it.
HELP Check any tool’s full option list at any time with pharokka.py --help.
04

Genome Map

pharokka_plotter

Pharokka ships with its own plotting utility, generating a circular genome map — genes coloured by functional category, strand, tRNAs, CRISPRs, and more. A great figure for a report or paper. Still inside ~/phage_training/input, with the pharokka environment active:

pharokka_plotter.py -i Shovill_Contigs.fasta -o ./pharokka \
  -n pharokka_plot --gff pharokka/pharokka.gff

ls pharokka
TIP -n just sets the file name prefix for the plot — any name works, it doesn’t need to match anything else.

Copy the finished plot out to Windows so you can open it:

cp pharokka/pharokka_plot.* /mnt/c/Users/USER/Downloads/
conda deactivate
05

Structural Annotation

Phold

Phold builds on Pharokka’s output, using structure-based annotation to assign function to the many phage genes with no similarity to anything in sequence databases (“hypothetical proteins”). This is one of the most powerful things you can currently do for phage genomes, since so much of phage diversity has no close sequence homologs.

conda activate phold

phold run -i pharokka/pharokka.gbk -o phold -t 4

conda deactivate

Compare how many CDS went from “hypothetical protein” in Pharokka to having a predicted function in Phold — this is usually a striking difference.

HELP Both phold --help and phold run --help are worth a look before running on your own data.
06

Synteny Comparison

phold · clinker

Once you have more than one annotated phage genome (your own isolates, or reference genomes from NCBI/INPHARED), it’s useful to visualise how gene order/content is conserved or rearranged between them — this is “synteny.”

Phold’s built-in comparison mode works directly off its own outputs (only relevant once you have more than one sample’s phold folder to compare):

conda activate phold

phold compare -i phold_<sample_A> phold_<sample_B> \
  -o ./synteny_output \
  -t 4

conda deactivate

Alternatively, clinker compares gene clusters directly from GenBank files (e.g. your pharokka.gbk outputs):

conda activate clinker

clinker pharokka_<sample_A>/pharokka.gbk \
        pharokka_<sample_B>/pharokka.gbk \
  -p ./synteny_output/clinker.html

conda deactivate
07

Proteomic Tree

VipTree (web)

VipTree builds a genome-wide proteomic tree from whole-genome amino acid content, rather than a single marker gene — well suited to phages, which often lack universal marker genes. No install needed; we use the web version.

🔗 www.genome.jp/viptree

Upload your assembled/annotated contig(s) (FASTA), select the appropriate reference dataset (e.g. “Prokaryotic dsDNA viruses”), and submit. This places your phage(s) in context against thousands of reference genomes based on overall proteome similarity.

TIP Save the resulting tree and similarity heatmap — useful both as a quick taxonomic sanity check and as figures for reporting.

Where to go next

Genome completeness & contamination — CheckV

Confirm you’ve assembled a complete, non-contaminated phage genome (and check for terminal repeats indicating circularity) before treating annotation as final.

Taxonomy via intergenomic similarity — VIRIDIC / pyani

VipTree gives context, but ICTV phage taxonomy is based on intergenomic nucleotide similarity thresholds. VIRIDIC (web) or pyani (local) are the standard tools for genus/species-level calls.

Lifestyle prediction — bacphlip / PhageLeads

Predict whether a phage is likely temperate or obligately lytic from genome content — a natural next question once a genome is annotated.

Host prediction — iPHoP

Relevant when the host is unknown. Worth knowing about, with the caveat that databases for these tools can run to hundreds of GB and predictions should be treated with appropriate caution.

Assembly QC via read mapping — minimap2 + samtools

Mapping the original reads back to the final assembly is a useful sanity check for coverage evenness and misassemblies before annotation.