> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/pathogenwatch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/pathogenwatch/technical-descriptions-of-analysis-tools/trees-clustering-and-context-search/sars-cov-2-genome-tree.md).

# SARS-CoV-2 Genome Tree

### About

Pathogenwatch will automatically generate a tree of SARS-CoV-2 genomes when a collection is created from the [Genome Browser](/pathogenwatch/how-to-use-pathogenwatch/browsing-and-viewing-genomes/browsing-searching-genomes.md). When each genome is uploaded to Pathogenwatch an alignment against the Wuhan Hu 1 reference genome is stored. The selected genomes are aligned into a multiple sequence alignment and a dendrogram produced using [FastTree](http://www.microbesonline.org/fasttree/). This tree is then displayed in the interactive collection viewer.

![SARS-CoV-2 tree built using the Pathogenwatch pipeline.](/files/-MVpfMEl1TQlY8YLwNAW)

### Method

#### Alignment

* Each genome is mapped against the wuhan-hu-1 reference genome ([NCBI Reference Sequence: NC\_045512.2](https://www.ncbi.nlm.nih.gov/nuccore/1798174254)) using [minimap2](https://github.com/lh3/minimap2).
* The resulting SAM file from each genome is converted into FASTA format using [goFASTA](https://github.com/cov-ert/gofasta).
* The aligned FASTA output is stored in Pathogenwatch.

#### Tree Building

* The FASTA files are concatenated into a multiple sequence alignment along with the wuhan-hu-1 reference.
* Run [FastTree](http://www.microbesonline.org/fasttree/) with the options `-gtr -nosupport -nt`.
* Root the resulting tree to the reference.
* Remove the reference from the tree.

### References

* FastTree: Price, M.N., Dehal, P.S., and Arkin, A.P. (2010) **FastTree 2 -- Approximately Maximum-Likelihood Trees for Large Alignments**. PLoS ONE, 5(3):e9490. [doi:10.1371/journal.pone.0009490](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0009490).
* goFASTA: <https://github.com/cov-ert/gofasta>
* minimap2: Li, H. (2018). Minimap2: pairwise alignment for nucleotide sequences. *Bioinformatics*, **34**:3094-3100. [doi:10.1093/bioinformatics/bty191](https://doi.org/10.1093/bioinformatics/bty191)
