This repository includes an example configuration file for running a Nextstrain analysis of SARS-CoV-2 genomes from GISAID for a specific country (South Africa).
Select the "Fork" button in the top right of this repository's GitHub page. This will make a copy of the repository in your personal or organizational GitHub account that you can edit. Working from this forked copy, follow the instructions below to make your own country-focused Nextstrain analysis of SARS-CoV-2.
Setup the Nextstrain software environment and download the ncov workflow. For example, to download the workflow you can run the following command.
git clone https://github.com/nextstrain/ncov.git
Select data from GISAID for your country and for phylogenetic context.
Download these data files into your ncov/data/
directory.
For this analysis, we will use recent data from South Africa and the recent "nextregions" download for Africa.
Download this repository into the parent directory of the ncov
workflow.
If you've forked this repository, replace blab
with your username or organization.
git clone https://github.com/blab/ncov-africa.git
Change directories to the ncov
workflow.
cd ncov/
Edit the workflow configuration for your country, as needed.
For example, change instances of "south-africa" and "South Africa" to your country of interest.
Update the list of inputs
to match the data you curated from GISAID.
open ../ncov-africa/builds.yaml
Edit the Auspice configuration, setting the build_url
and maintainers
, as needed.
open ../ncov-africa/auspice_config.json
Dry-run the workflow (print commands without running anything).
nextstrain build . -j 4 -n -p --configfile ../ncov-africa/builds.yaml
Create a graph of the workflow.
nextstrain build . --configfile ../ncov-africa/builds.yaml --dag | dot -Tpdf > dag.pdf
View a graph of the workflow.
open dag.pdf
Run the workflow.
nextstrain build . -j 4 -p --configfile ../ncov-africa/builds.yaml
View the resulting tree locally with Auspice.
nextstrain view auspice/
Open the local Auspice server at http://localhost:4000/.
Copy the Auspice tree files from the workflow directory into your GitHub repository.
cp auspice/* ../ncov-africa/auspice/
Change directories to your GitHub repository.
cd ../ncov-africa
Add the new Auspice JSONs to the repository and commit them.
git add auspice/*
git commit -m "Add Auspice JSONs for my country's build"
Push your changes to GitHub to make them public.
git push origin main
View the tree from this analysis through Nextstrain's community interface.
You can view trees hosted on GitHub with a URL like https://nextstrain.org/community/blab/ncov-africa@main/south-africa
where blab
is your GitHub username or organization, ncov-africa
is the repository, main
is the branch, and south-africa
corresponds to a file in the repository named ncov-africa_south-africa.json
.
See the Nextstrain SARS-CoV-2 tutorial for more details about the workflow and see the Nextstrain documentation for more about the tools behind the workflow.
If you have questions, let us know on the Nextstrain discussion site and we'll do our best to help.