6_2_plotFig_EvolTimesComp module
Plot Figure 3 (panel B)
from the paper, i.e., a comparison
of evolutionary estimates based on pairwise alignments (ours)
versus those based on phylogenetic analysis
(Kuderna et al. [2023] and Upham et al. [2019]).
The comparison depends on how many species from our 40-vertebrate dataset overlap with those from other studies. Specifically, there are 15 species shared with the dataset from Kuderna et al. (2023), and 31 species shared with the dataset from Upham et al. (2019).
In the two generated plots, our estimates are shown in the y-axis, whereas those from other studies are shown in the x-axis. Each dot corresponds to a species shared by both datasets, with the color of the dot indicating its divergence time from humans, following the color code specified in the paper in Figure 3, panel A (green for primates, yellow for mammals, and red for vertebrates).
For more information about the two studies used in this comparison, please check the papers:
“A global catalog of whole-genome diversity from 233 primate species” (Kuderna et al., Science, 2023);
“Inferring the mammal tree: species-level sets of phylogenies for questions in ecology, evolution, and conservation” (Upham et al., PLoS Biol, 2019).
Use:
python3 6_2_plotFig_EvolTimesComp.py
Example of Usage:
python3 ~/code/6_2_plotFig_EvolTimesComp.py
Input Parameter:
To ensure the graphs match those used in the paper, the parameters are hard-coded in the script and cannot be modified via command line.
Pre-requisites
Before using this script, make sure all the required files were pre-computed:
a) Files with sampled evolutionary times
Make sure to run 5_sampleEvolTimes.py
for α=10.0.
b) Logs from evolutionary time estimates
Make sure to keep the logs from 4_estimateEvolTimes.py
for α=10.0. It contains the information regarding windows without estimates.
Time, Memory & Disk space
Running the script on a single core takes 74.35 seconds and requires a small amount of memory. All output files take very few space (< 25 kb).
- Output files:
evolTimes-compKuderna2023.pdf
: The PDF output file containing the comparison with the estimates from Kuderna et al. (2023);evolTimes-compUpham2019-corr.pdf
: The PDF output file containing the (adjusted) comparison with the estimates from Upham et al. (2019);evolTimes-compUpham2019.pdf
: The PDF output file containing the (non-adjusted) comparison with the estimates from Upham et al. (2019) (inset plot);
Function details
Only relevant functions have been documented below. For more details on any function, check the comments in the souce code.
- 6_2_plotFig_EvolTimesComp.getDistances(mappingSpecies, tree, refName, paperRef)
Get distance (i.e., the sum of branch lengths in the path joining two species), between humans (reference species) and all other species that also appear in our dataset.
- 6_2_plotFig_EvolTimesComp.getEmptyWindows(alpha, my_dataset)
- 6_2_plotFig_EvolTimesComp.loadData(my_dataset, mappingSpecies, paperRef)
- 6_2_plotFig_EvolTimesComp.loadOurData(alpha, my_dataset, empty_windows=None, empty_mu=-1)
- 6_2_plotFig_EvolTimesComp.makeColormap(my_dataset)
- 6_2_plotFig_EvolTimesComp.makeFigure3(alpha, my_dataset)
- 6_2_plotFig_EvolTimesComp.meanEvolTimes(taudistrib_est_onespecies, empty_win_info=(-1, -1), empty_win_tau=-1)
- 6_2_plotFig_EvolTimesComp.parseMapping(mappingFilename, UCSConly=True)
- 6_2_plotFig_EvolTimesComp.plotComparisonEvolTimes(paperRef, my_dataset, alldists_ours, alldists_other, outliers, sameAxis, hasEmptyWindows)
- 6_2_plotFig_EvolTimesComp.rgba_to_hex(rgba)