What are some smart ways of generating newick tree string randomly, say, with 128 leaf for example ...
What are some smart ways of generating newick tree string randomly, say, with 128 leaf for example ...
There are several ways to do this in R.
rtree()
in the ape
library will simulate a random tree.
The TreeSim
library will allow you to simulate trees under various parameter combinations and constrain on the number of taxa, age, etc. I use it for simulations and when I need a quick dummy tree.
Save the objects in Newick format once you've got what you want.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
thanks; The thing is I would like the tree to be equidistant !! I should have said that earlier in the question, It would be nice to know how can I constrain the simulation to make equidistance tree ...
Just to be clear, by 'equidistant' do you mean 'ultrametric'? TreeSim will produce ultrametric trees.
sorry about the confusion; I have pasted an image under the other answer ... I hope that makes it clear :-)