text: user9872: 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.
  
  user3848: 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 Beast
  There isn't a singular Python library that will handle this but there is some functionality with Biopython here
  from Bio import Phylo
  
  
original_text: 9872: <p>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.</p>
   3848: <p>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.</p>
  <p>In this context you are looking for something like the biogeographic BAyesian analysis such as <a href="https://academic.oup.com/sysbio/article/62/6/789/1708738" rel="nofollow noreferrer">BayArea</a> or geographic add-ons to <code>Beast</code></p>
  <p>There isn't a singular Python library that will handle this but there is some functionality with Biopython <a href="https://biopython.org/wiki/Phylo" rel="nofollow noreferrer">here</a></p>
  <pre><code>from Bio import Phylo
  </code></pre>
  