Entering edit mode

4.8 years ago

al-ash
▴
200

I'd like to generate all existing bifurkating newick trees for a set of N taxa (specifically N=5 for my task but I would prefer a general solution for N).

The tool or code would ideally take as input a set of N strings (e.g. "species1","species2","species3","species4","species5") and generate all possible trees in newick text format - is there any existing solution? (I plan to use this to generate alternative tree topologies for topology testing of a larger tree which I can brake into 5 clades for which I'm sure they are monophyletic) Thanks!

see How do I generate all possible Newick Tree permutations for a set of species given an outgroup in Python?

Thanks! https://stackoverflow.com/questions/46626414/how-do-i-generate-all-possible-newick-tree-permutations-for-a-set-of-species-giv/46670077#46670077 is very close - I think I can generate the bifurcating trees by taking this solution and removing the polytomies (which I can do here by e.g. removing all trees with pattern "comma-whatevercharacter-comma"). I'm actually quite confused when it comes to polytomies - e.g. I do not really understand why ((A,B),(C,D),E); is not one of the trees of 5 taxa combinations when polytomies are allowed.