-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature in populate
method to sample from common tree distributions
#714
Add feature in populate
method to sample from common tree distributions
#714
Conversation
@jordibc Just wanted to check, is this pull request under consideration currently? I saw you mention in my other pull request that Thanks! |
Hi @harryrichman , yes, we were considering this and didn't decide yet -- mainly because of working on new features for ete4 and preparing a workshop. Your contribution looks very good (the idea, the implementation, the description with references and the explanation in the docstring). We almost surely would love to add it and do it soon. We postponed it because we prefer not to add functionality to ete3 and concentrate on ete4 and we normally ask for tests with the new code. We would probably leave ladderize out from the options too, but that's very minor. In any case we plan to add this to ete4 and exceptionally to ete3 too. Many thanks for it and for making it so clean! |
…nd support functions. This version incorporates ideas from #714 We can now select model='yule' or 'uniform'. And we have more flexibility with how the distances and supports are added: we can add either random distances and/or random supports, drawn from whatever distribution we choose, by passing the appropriate functions as arguments (instead of the tuples of (min,max) that we had for uniform distributions of both before). Also, a significant clean up of the code, and updated the tests.
@harryrichman You may want to know that since commit 1fff062 we also added this functionality to ete4, with some changes to the api that we hope makes it cleaner and more useful. Thanks again! |
The
populate
method is modified to have an additionaldistribution
argument, which can select from three possible options:distribution="fast"
: populates a subtree using the previous algorithm.distribution="yule"
: populate a subtree according to the Yule distribution.distribution="uniform"
ordistribution="pda"
: populate a subtree according to the uniform or PDA (proportional to distinguishable arrangements) distribution.These distributions are defined in Semple and Steel, Phylogenetics, Chapter 2.5.
This pull request also adds the following features to the
populate
method:ladderize
boolean keyword argument, with default valueTrue
.seed
keyword argument, which can be used to control the random behavior of subtree generation if desired.Closes #691