Repository navigation
Tutorial 2 Adding a New Sequencing Run
Follow along! The sequencing team just finished run IV26Run8. In about
7 minutes you'll add it to the lab's master copy, rebuild the two JHH input
files with one command, and put them in source/, ready for a production
run.
You'll need access to the lab SharePoint and the Mostafa Lab folder (Step 1: Getting access). This is real patient-sample data: keep it on your computer and SharePoint only.
flowchart LR
A["Part A (2 min)<br/>Run FASTA + date<br/>→ SharePoint"] --> B["Part B1<br/>Copy SharePoint<br/>→ source_prep/"]
B --> C["Part B2<br/>prepare_source.py"]
C --> D{"READY?"}
D -->|STOPPED| E["Fix what it says"] --> C
D -->|READY| F["Part B3<br/>Copy 2 files → source/"]
Part A happens once per sequencing run; Part B each time you want to run the pipeline with new data.
Done by whoever receives the new data.
-
Find the run's folder in the Mostafa Lab shared folder. It is named after the run, e.g.
IV26Run8(IV+ 2-digit year +Run+ number; a re-run may end in a letter,IV25Run11b). -
Copy its consensus FASTA into
runs/on the lab SharePoint.- Name it
Consensus+ run name +.fasta:ConsensusIV26Run8.fasta. - Copy the file itself, not the whole run folder. Exactly one FASTA per run. Several FASTAs and unsure which is the consensus of all segments? Ask the sequencing team. Don't guess.
- Never open the FASTA in Word, Excel or TextEdit and save it.
- Name it
-
Add one row to
run_dates.csvon SharePoint, at the bottom:sequencing_run,date,notes IV26Run7,2026-06-08, IV26Run8,2026-10-06,3 samples re-extracted ← your new rowThe date is the one the sequencing team gives you, written
YYYY-MM-DD. Notes are optional. Saving from Excel: CSV UTF-8 (Comma delimited) (all rules).
- Copy all FASTA files from SharePoint's
runs/intosource_prep/runs/, replacing files already there. - Copy SharePoint's
run_dates.csvintosource_prep/, replacing the old one.
Tip
Windows (WSL): in the Ubuntu terminal, inside nextstrain, type
explorer.exe source_prep to open the folder in Explorer, then drag the
files in.
Mac: in Finder press Cmd+Shift+G and paste the path to
nextstrain/source_prep.
If SharePoint files show a cloud icon, right-click → Always keep on this
device first, so you copy the real file and not an empty placeholder.
cd ~/nextstrain # or wherever your nextstrain folder is
conda activate pekosz-nextstrain
python scripts/prepare_source.pyIt takes a few seconds and needs no options. It only reads runs/,
run_dates.csv and source/, and writes into source_prep/output/.
(python3 works too, even without the conda environment.)
The last lines say RESULT: READY or RESULT: STOPPED.
- STOPPED: nothing was made. Each problem has a HOW TO FIX line; the full list is in Step 1: Problems. Fix it and run the command again until it says READY.
-
READY: read any
[WARNING]lines (what they mean). APOSSIBLE CONTAMINATIONwarning goes to the sequencing team and Dr. Pekosz.
Then copy these two files into source/, replacing the old ones (don't
rename them, and leave prep_report.txt where it is):
source_prep/output/JHH_sequences.fasta → source/JHH_sequences.fasta
source_prep/output/JHH_metadata.txt → source/JHH_metadata.txt
Your source/ now includes run IV26Run8. Archive the previous build and run
the pipeline: Step 2.
-
I edited
run_dates.csvlocally. Make the same change on SharePoint, or the next person won't have it. -
It says a run has a FASTA but no date. You skipped Part A step 3 (or
didn't copy the new
run_dates.csvdown). -
It says I copied a whole run folder. Move the FASTA itself into
runs/and remove the folder. -
RESULT: UNEXPECTED ERROR. A bug, not your fault: send everything printed (andsource_prep/output/prep_report.txt, inside JHU only) to the maintainer.
Next step → Tutorial 3: Updating Vaccine Strains from GISAID
Pekosz Lab Seasonal Influenza Nextstrain · Repository · Builds · Never post GISAID or unpublished JHH data on this wiki (why) · Found an error? Fix it in the same PR as your code (how).
Written with support from Opus 5.5.
Start here
The pipeline, in order
- Source Data Preparation
- Running the Pipeline
- Filtering & QC
- Reports & Outputs
- Reviewing & Publishing
🧪 Tutorials
🤖 Coding with Agents
📚 Reference