$ gcc -o a.out -Wall randnewick.c
$ ./a.out 50
((((id6:0.989116,(id41:0.360497)id13:0.950718,id17:0.707824,id35:0.470217)id4:0.527722,((id19:0.181608,id25:0.906145)id15:0.063857)id9:0.211315,(id27:0.806891)id21:0.070135,id39:0.343071)id1:0.669585,(((id23:0.050679)id22:0.536582,id37:0.194032)id3:0.561614,id5:0.709683,id48:0.208214)id2:0.923997,((id38:0.891580)id16:0.737224,(id47:0.927089)id32:0.326778)id7:0.567435,(id31:0.801572,id34:0.805844,id43:0.258143)id11:0.844238)id0:0.012241,((id12:0.920365,id26:0.932368)id10:0.493677,((id45:0.407019,id46:0.991169)id29:0.387065,id42:0.427880)id18:0.064881,(id24:0.585694)id20:0.089364)id8:0.973614,((id33:0.951334)id30:0.562422,id36:0.292341,id40:0.655812)id14:0.842271,id28:0.279305,id44:0.499579)id49;
What are some smart ways of generating newick tree string randomly, say, with 128 leaf for example ...
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 :-)