I was wondering if there was a Python program that detects convergent and divergent evolution on a tree. I am also curious if it is just better to look at a phylogenetic tree and conclude what is convergent or divergent evolution than what a program tells you.
Well in the absence of a definition of 'divergent evolution' I would simply use a definition of allopatry. If the divergence is congruent with geographic distance or geographic foci this provides some proof of divergent evolution.
In this context you are looking for something like the biogeographic BAyesian analysis such as BayArea or geographic add-ons to
There isn't a singular Python library that will handle this but there is some functionality with Biopython here
from Bio import Phylo