This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cut a tree based on time t

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

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

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

1 answer

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

Log in to answer this question.