Extract Sub_Tree From Big Phylogeny
3
1
Entering edit mode
12.0 years ago
Lhl ▴ 760

Hi There,

Does anyone know how to extract a subtree from a big phylogeny? Also, is it possible to keep the branch length information when doing extraction?

Many thanks in advance.

Lhl

phylogeny • 8.3k views
ADD COMMENT
1
Entering edit mode

This is the same as Where Can I Download The Phylogeny Information For Flowering Plants you just asked. Please use the same question header.

ADD REPLY
8
Entering edit mode
12.0 years ago
John St. John ★ 1.2k

You could use the python package ETE for this. They have an example for taking a phylogentic tree, and pruning parts of it off here: http://packages.python.org/ete2/tutorial/tutorial_trees.html#pruning-trees. I think the input is a newick style tree, and I am pretty sure ETE will not change the branch lengths that you put on your tree when you prune parts of it away.

ADD COMMENT
1
Entering edit mode

ETE (v2.1) will delete branches when pruning. Only branch lengths of the kept nodes will be maintained (never changed). The currently development version of ETE, includes a new option to preserve branch length information by summing up the lengths of all deleted nodes. This is: distances between nodes will be the same in the original and the pruned tree, which means that some of the remaining branches will be changed to account for the cumulative length that has been removed.

See prune method here: https://github.com/jhcepas/ete/blob/master/ete_dev/coretype/tree.py

ADD REPLY
0
Entering edit mode

sounds this is the functionality i need.

Thanks a lot.

Cheers

Huanle

ADD REPLY
0
Entering edit mode

Many thanks for your suggestion John.

By the way, if i want to sample species across clades. Do you think ETE would automatically adjust branch lengths?

I will explore ETE in more detail.

Cheers

Lhl

ADD REPLY
1
Entering edit mode
12.0 years ago
Joseph Hughes ★ 3.0k

If you want a visual way of pruning a subtree, I would recommend Archaeopteryx, it is easy to cut and paste subtrees and prune subtrees, even large trees. I am pretty sure it preserves the branch lengths.

ADD COMMENT
1
Entering edit mode
3.2 years ago
jaredroach ▴ 10

Use the TreeTools package in R. Example code:

tree <- BalancedTree(8)
plot(tree)
tip <- c('t1','t5','t7','t8')
subtree <- KeepTip(tree, tip, preorder = TRUE)
plot(subtree)
ADD COMMENT

Login before adding your answer.

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