A two-part tutorial for the Pekosz Lab Nextstrain Influenza Builds

tutorial
This tutorial sets up the Pekosz Lab influenza workflow in a single conda environment, runs it on a small teaching dataset containing 20 H1N1, 20 H3N2, and 20 B/Victoria strains generated by Dr. Heba Mostafa’s Lab at the Johns Hopkins Hospital, then walks through adding new sequencing runs for a production build.
Author
Affiliation

Elgin Akin

Johns Hopkins University

Published

August 9, 2026

Modified

October 8, 2026

What is Nextstrain and how do we use it?

Nextstrain is a powerful open-source platform for building, hosting, and interacting with phylogenies. The Pekosz Lab leverages this platform to facilitate discussions surrounding emerging Influenza A and B variants during genomic surveillance each influenza season. Please refer to the extensive Nextstrain Documentation for a more comprehensive overview.

One Snakemake command turns influenza sequences from the Johns Hopkins Hospital (JHH) network into 24 segment builds (all 8 segments of H1N1, H3N2 and B/Victoria), 3 whole-genome builds, and a surveillance report.

Pekosz Lab Nextstrain Builds are hosted by the Nextstrain team at the following locations:

Tutorial Resources

Note

This tutorial runs on macOS (Apple Silicon or Intel) and on Windows through WSL2. Everything runs from one conda environment, pekosz-nextstrain, built by scripts/build_env.sh. The Nextstrain Docker runtime used in earlier versions of this tutorial is no longer supported.

Warning

The repository is public and contains no data. It processes licensed GISAID sequences and unpublished JHH sequences, which must never be committed or shared. Read Data Protection before using real data.

Tutorial Part 1 - Building your environment and running the tutorial dataset

Part 1 installs conda, clones the repository, builds and checks the pekosz-nextstrain environment, and runs the full pipeline on a small practice dataset, producing all 27 builds and the surveillance report.

Tutorial Part 2 - Adding new sequencing runs and running the production pipeline

Part 2 shows how to add a new Mostafa Lab sequencing run to the lab SharePoint, build JHH_sequences.fasta and JHH_metadata.txt with one script (scripts/prepare_source.py), prepare the GISAID vaccine.fasta, archive the previous build, run the production pipeline, and review builds before uploading them by hand. An appendix keeps the legacy manual method (cat + Excel) for reference.