Question: Cut a tree based on time t
gravatar for tutoring891
5.3 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.8k views
ADD COMMENTlink modified 5.3 years ago by Chrispin Chaguza250 • written 5.3 years ago by tutoring8910

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

ADD REPLYlink written 5.3 years ago by Istvan Albert ♦♦ 82k
gravatar for Chrispin Chaguza
5.3 years ago by
Wellcome Sanger Institute
Chrispin Chaguza250 wrote:

Check ete2 toolkit (, I think it has a function for extracting subtrees based on a specified node.

ADD COMMENTlink written 5.3 years ago by Chrispin Chaguza250

yes, check this example:

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


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