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.
- Install dependencies using Conda (or Mamba to save time):
conda create -n runlistcompare -c bioconda python=3 biopython=1.73 clonalframeml iqtree pytest treeswift networkx phyml
- Download and decompress the latest release, and
cdinto it - Activate and test installation
conda activate runlistcomparepytest(takes ~2mins)
- Download and decompress the release, and
cdinto it conda env create -f conda_python2.ymlconda 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 retained
align_snps.fa,align_positions.txt,align-compare.txtare the variable sites, their position in the reference genome and the raw pairwise snp difference between samples- the
clusterfolder contains variable site alignments for each cluster of related samples - the
cluster_mlfolder contains the output maximum likelihood phylogenies, e.g.cluster_1_phyml_tree_scaled.treeis the phyML generated tree scaled to have branch lengths in SNPs and thecluster_1_cf_scaled.treeis the ClonalFrameML corrected tree scaled to have branch lengths in SNPs - the
recomb_corrfolder contains alignment of variable sites with recombination removed for use as input with other software, e.g. BEAST - the
ML_distances.txtandCF_distances.txtfiles 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