Cut a tree based on time t
1
0
Entering edit mode
10.1 years ago

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: Never mind I was able to solve it. Convert the phylo tree to hclust and then use the function cutree.

phylogenetic R trees • 3.4k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Hi, I am facing a similar problem and would be happy to hear your thoughts on how you addressed the challenge. Thanks!

ADD REPLY
1
Entering edit mode
10.1 years ago

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

ADD COMMENT
0
Entering edit mode
ADD REPLY

Login before adding your answer.

Traffic: 1866 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