Skip to content

J-Moravec/BayesMonophyly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BayesMonophyly

This python 2.7 script will perform Bayesian monophyl test from MrBayes or BEAST tree files. It is dependent on ete2.

Run as: python BayesMonophyl.py -s [species to test] -i [input files] -b [burnin for all files, 20% by default] and specify minimum of two species. You can also specify more files, such as several runs from MrBayes analysis (by default, MrBayes is running two runs).


In Bayesian analysis, MCMC is sampling parametric space, not only searching for the best solution. After sufficient number of samples are taken and "warmum" phase is removed (burnin), this sample is equal to posterior distribution. This mean that frequency of trees with certain topology, or certain class of topologies, equals to probability (evidence for, belief that it is true) of this topology, or class of topologies.

This means that we can look at trees and count those which contain monophyly of taxons of interest and compare their frequency against those, which do not contain this monophyly.

Note however that Suchard et al. 2005 consider this approach naive as it does not correctly estimate (or take into account) error rate. For now, only simple Bayes factor (equation 2 from this work) is implemented. For this reason, take results of this script as preliminary results and test your hypothesis directly by running MrBayes (or similar software) with Stepping Stone sampling and with topology restricted to monophyly and another run with topology restricted to non-monophyly. Comparing these SS-obtained likelihoods will be much more accurate.

Have also on mind that your hypotheses have to make sense with respect to your sample. You can not test:

H1: group A and sequence X are monophyletic

against:

H0: group A is monophyletic

when you have general sample where group A does not have to by monophyletic. This will produce incorrect results. I think this is obvious but Bergsten at al. 2013 were able to write whole paper on it.

TODO:

  • Implement more correct Bayes Factor, such as Bayes titration.
  • Implement non-ete2 solution for testing monophyly

PosteriorTopology

This script takes newick file and search in bayesian posterior tree sample from MrBayes or BEAST for trees with the same topology. It outputs number of trees in posterior tree sample, number of trees with the same topology and posterior probability of that specific topology ( trees_found/total_trees ).

About

Bayesian monophyl test from MrBayes or BEAST tree files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages