Question: Cut a tree based on time t
0
gravatar for tutoring891
4.5 years ago by
United States
tutoring8910 wrote:

I'm using the ape library to import a tree of type newick format. This tree contains branch lengths. I'm interested in cutting the tree at t=1. The time starts from 0 up until t=2 (rooted node) for example. Is there an easy way to cut the tree at specific time and then extract those different subtrees generated. I'm using R and I could not find any function in ape that does that. Any suggestions would be appreciated.

 

Update: Nevermind I was able to solve it. Convert the phylo tree to hclust and then use the function cutree.

trees R phylogenetic • 1.6k views
ADD COMMENTlink modified 4.5 years ago by Chrispin Chaguza230 • written 4.5 years ago by tutoring8910
1

can you add that as an answer perhaps. Thanks for following up.

ADD REPLYlink written 4.5 years ago by Istvan Albert ♦♦ 80k
1
gravatar for Chrispin Chaguza
4.5 years ago by
University of Liverpool, UK
Chrispin Chaguza230 wrote:

Check ete2 toolkit (http://etetoolkit.org/), I think it has a function for extracting subtrees based on a specified node.

ADD COMMENTlink written 4.5 years ago by Chrispin Chaguza230

yes, check this example: http://pythonhosted.org/ete2/tutorial/tutorial_trees.html#custom-searching-functions

ADD REPLYlink written 4.5 years ago by jhc2.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 755 users visited in the last hour