yes, check this example: http://pythonhosted.org/ete2/tutorial/tutorial_trees.html#custom-searching-functions
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.
• 4,131 views
•
link
1 answer
Check ete2 toolkit, I think it has a function for extracting subtrees based on a specified node.
• 1 views
•
link
• 0 views
•
link
Log in to answer this question.
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!