neherlab / betatree Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rneher/betatree
Generate and analyze beta coalescent trees
License: MIT License
This project forked from rneher/betatree
Generate and analyze beta coalescent trees
License: MIT License
################################################################################ betatree is a collection of python scripts to generate trees from the beta coalescent ensemble, calculate properties of those trees and gather statistics across many instances. Authors: Taylor Kessinger and Richard Neher Contact: [email protected] Example output of the betatree generator are given as pdf files in example_trees. Example site frequency spectra for different parameters of the beta-coalescent ensemble are provided in example_SFS. If you use betatree in a publication, please refer to Neher, Kessinger, and Shraiman. "Coalescence and Genetic Diversity in Sexual Populations under Selection." PNAS 110: 15836-41. doi:10.1073/pnas.1309697110. ################################################################################ Tree generation the script src/betatree.py provides a class that generates coalescent trees using pseudorandom numbers given an initial sample size n and a parameter alpha of the beta measure of the Lambda coalescent process. The following 3 lines will generate a tree of a sample size of 100 and draw it with the Biopython.Phylo package. myT = betatree(100, alpha = 2) myT.coalesce() Phylo.draw(myT.BioTree) the tree is internally stored as a biopython.phylo tree with all the associated functionality. Sample code is appended to the definition of the class as will be exectuted if betatree.py is run as main. ################################################################################ Site frequency spectra the script src/sfs.py uses the class betatree to generate many trees and calculate the SFS assuming that mutation are uniformly distributed on the tree. The following three lines will generate an SFS for a sample size 100 and alpha=1.5 by averaging 1000 trees. mySFS = SFS(100, alpha=1.5) mySFS.getSFS(ntrees=1000) The sfs is accessible as mySFS.sfs and can be binned using different binning schemes or a user defined binning. mySFS.binSFS(mode='logit', bins=20) plt.plot(mySFS.bin_center, mySFS.binned_sfs) The sfs can be saved and loaded by member functions. Sample code is appended to the definition of the class as will be exectuted if sfs.py is run as main. ################################################################################ Dependencies: python 2.7 numpy scipy biopython matplotlib for plotting examples ################################################################################
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.