runListCompare.py
and associated scripts provide a Python wrapper for generating maximum likelihood phylogenies from a list of fasta consensus sequence files obtained from mapping to the same reference. The script enables large numbers of samples to be initially handled in parallel and clustered with similar sequences based on a SNP threshold before calculating maximum likelihood trees for each cluster using either PhyML or IQTree. Correction for recombination is done with ClonalFrameML.
conda create -n runlistcompare -c bioconda python=3 biopython=1.73 clonalframeml iqtree pytest treeswift networkx phyml
cd
into itconda activate runlistcompare
pytest
(takes ~2mins)cd
into itconda env create -f conda_python2.yml
conda activate runlistcompare2
python runListCompare.py tests/data/ec/ec.ini
Here test.ini
is an ini file containing the desired parameters. It is advisable to run the above command to test that things are working with the included demo data. Input sequences are listed in a tab separated format, and an example is provided in tests/data/ec/ec.seqlist.txt
. The first column can be up to 8 characters in length and is used for tip labels of the final trees, a requirement imposed by ClonalFrameML.
Important configurable parameters to consider include:
perACGT_cutoff
: Minimum percentage of reference genome to be called in order for a sequence to be includedcluster_snp
: Threshold for single linkage clustering by SNP distancevarsite_keep
: Proportion of variable sites that need to be called across all sequences for site to be retainedseq_keep
: Proportion of variable sites that need to be called within a sequence for the sequence to be retainedalign_snps.fa
, align_positions.txt
, align-compare.txt
are the variable sites, their position in the reference genome and the raw pairwise snp difference between samplescluster
folder contains variable site alignments for each cluster of related samplescluster_ml
folder contains the output maximum likelihood phylogenies, e.g. cluster_1_phyml_tree_scaled.tree
is the phyML generated tree scaled to have branch lengths in SNPs and the cluster_1_cf_scaled.tree
is the ClonalFrameML corrected tree scaled to have branch lengths in SNPsrecomb_corr
folder contains alignment of variable sites with recombination removed for use as input with other software, e.g. BEASTML_distances.txt
and CF_distances.txt
files contain the pairwise distances obtained from the maximum likelihood and ClonalFrameML phylogenies.David Eyre & Bede Constantinides
david.eyre@bdi.ox.ac.uk
17 April 2019