Phylogenetics:How to Generate a binary newick tree from a list of species
1
0
Entering edit mode
5.5 years ago
View7 • 0

I have a list of species from which I would like to generate a collapsed binary newick tree. I have tried in ete3, but it does not work. (PhyloT has this feature, but cannot be used as it is not free anymore )

ex)

poly_1 = Test_tree.get_common_ancestor("Larimichthys crocea - 215358", "Takifugu rubripes - 31033")
print(poly_1)
poly_2 = poly_1.resolve_polytomy(recursive=True)
print(poly_2)

gives "None", whereas it has following three nodes. ( Larimichthys crocea - 215358 ,Gasterosteus aculeatus - 69293 ,Takifugu rubripes - 31033 )

have tried with polytomy of four, but does not work either. (Nipponia nippon - 128390 , Columba livia - 8932 , Ficedula albicollis - 59894 , Haliaeetus leucocephalus - 52644 )

Also, is there any way to retrieve simple newick format from ete3's ncbi.get_topology() method?

from ete3 import NCBITaxa
ncbi = NCBITaxa()

tree = ncbi.get_topology([9606, 9598, 10090, 7707, 8782])
print tree.get_ascii(attributes=["sci_name", "rank"])

Any recommendations would be appreciated. referenced the following: http://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html#understanding-ete-trees http://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html#basic-tree-attributes http://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html#reading-newick-trees http://evomicsorg.wpengine.netdna-cdn.com/wp-content/uploads/2019/01/ete_tutorial.pdf http://etetoolkit.org/documentation/ete-ncbiquery/#ncbi_tree

ete3 Phylogenetics Python PhyloT • 2.2k views
ADD COMMENT
0
Entering edit mode
5.4 years ago
jhc ★ 3.0k

not sure I understood the question, but hope the following points help:

  • resolves_politomies() does not return a new tree, it modifies the tree inplace.

  • the tree.standardize() function would be useful to remove one child nodes

  • to export a tree in newick, use tree.write() not tree.get_ascii()

ADD COMMENT
0
Entering edit mode

I want to generate a binary tree from a list of species. in ete3 it is possible to generate a tree but it contains polytomies, which need to be resolved manually. I would like to know if there is a method to do this automatically for all the polytomies in a tree. since there are a lot of polytomies in some cases, it is time consuming to resolve one by one. After I asked the above question, I have used the following. As you see, it has to be done for every polytomy.

poly_1= tree.get_common_ancestor("Pongo abeli - 9601", "Gorilla gorilla - 9593")
poly_2= tree.get_common_ancestor("Nipponia nippon - 128390", "Columba livia - 8932")

poly_r = poly_1.resolve_polytomy(recursive=True)
poly_r = poly_2.resolve_polytomy(recursive=True)

Thanks for the tips!

ADD REPLY

Login before adding your answer.

Traffic: 1832 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6