Inferring putative transmission clusters from phylogenetic trees
Phydelity, a redesign of PhyCLIP, is a statistically-principled and phylogeny-informed tool capable of identifying putative transmission clusters in pathogen phylogenies without the introduction of arbitrary distance thresholds.
Minimally, Phydelity only requires a phylogeny (in NEWICK format) as input.
Phydelity infers the within-cluster divergence of putative transmission clusters by first determining the pairwise patristic distance distribution of closely-related tips. This distance distribution comprises of the pairwise distances of sequence j and its closest k-neighbouring tips, where the closest k-neighbours includes sequence j. The user can optionally input the desired k parameter OR allow Phydelity to automatically scale k to yield the supremum distribution with the lowest overall divergence.
To cite Phydelity:
Alvin X Han, Edyth Parker, Sebastian Maurer-Stroh, Colin A Russell, Inferring putative transmission clusters with Phydelity, Virus Evolution, Volume 5, Issue 2, July 2019, vez039, https://doi.org/10.1093/ve/vez039
Install dependencies using Anaconda.
$ conda install -c etetoolkit ete3
$ conda install -c anaconda cython
$ conda install numpy scipy
For Windows users, you may also need to compile C extensions using Microsoft Visual C++ Compiler for Python. You can install that from http://www.microsoft.com/en-us/download/details.aspx?id=44266.
Install Gurobi (linear programming solver) using Anaconda as well.
$ conda config --add channels http://conda.anaconda.org/gurobi
$ conda install gurobi
Obtain Gurobi license.
Method I: If your machine is connected to the internet via a recognized academic domain (e.g. '.edu' addresss)
Method II: If your machine is NOT connected via an academic domain but you can verify that you are an academic user.
Download and install Phydelity.
$ cd /path/to/Phydelity-master/
$ python setup.py install
$ python setup.py clean --all
$ phydelity.py --tree </path/to/treefile.newick>
See Full options below for other analysis options.
usage: phydelity.py [-h] [-t TREE] [--k K] [--outgroup OUTGROUP]
[--collapse_zero_branch_length]
[--equivalent_zero_length EQUIVALENT_ZERO_LENGTH]
[--solver_verbose {0,1}] [--solver_check] [--pdf_tree]
Phydelity v1.0
optional arguments:
-h, --help show this help message and exit
Required:
-t TREE, --tree TREE Input phylogenetic tree in NEWICK format.
Analysis options:
--k K Custom k neighbours (optional).
--outgroup OUTGROUP Taxon (name as appeared in tree) to be set as outgroup
OR type 'midpoint' for midpoint-rooting.
--collapse_zero_branch_length
Collapse internal nodes with zero branch length of
tree before running Phydelity.
--equivalent_zero_length EQUIVALENT_ZERO_LENGTH
Maximum branch length to be rounded to zero if the
--collapse_zero_branch_length flag is passed (default
= 1e-06).
Solver options:
--solver_verbose {0,1}
Gurobi solver verbose (default: 0)
--solver_check Check if Gurobi is installed.
Output options:
--pdf_tree PDF tree output annotated with cluster results (X
server required).