网页 综合 更新时间 2026-11-17 08:40:40

Phylogenetic Trees — ETE Toolkit - analysis and visualization of trees

自动蜘蛛 etetoolkit.org 正文约 6000 字
Phylogenetic trees are the result of most evolutionary analyses. They represent the evolutionary relationships among a set of species or, in molecular biology, a set of homologous sequences.
The PhyloTree class is an extension of the base Tree object, providing a appropriate way to deal with phylogenetic trees. Thus, while leaves are considered to represent species (or sequences from a given species genome), internal nodes are considered ancestral nodes. A direct consequence of this is, for instance, that every split in the tree will represent a speciation or duplication event.
PhyloTree instances allow molecular phylogenies to be linked to the Multiple Sequence Alignments (MSA). To associate a MSA with a phylogenetic tree you can use the PhyloNode.link_to_alignment() method. You can use the alg_format argument to specify its format (See SeqGroup documentation for available formats)
Given that Fasta format are not only applicable for MSA but also for Unaligned Sequences, you may also associate sequences of different lengths with tree nodes.
The same could be done at the same time the tree is being loaded, by using the alignment and alg_format arguments of PhyloTree.
As currently implemented, sequence linking process is not strict, which means that a perfect match between all node names and sequences names is not required. Thus, if only one match is found between sequences names within the MSA file and tree node names, only one tree node will contain an associated sequence. Also, it is important to note that sequence linking is not limited to terminal nodes. If internal nodes are named, and such names find a match within the provided MSA file, their corresponding sequences will be also loaded into the tree structure. Once a MSA is linked, sequences will be available for every tree node through its node.sequence attribute.
PhyloTree instances can benefit from all the features of the programmable drawing engine. However, a built-in phylogenetic layout is provided for convenience.
All PhyloTree instances are, by default, attached to such layout for tree visualization, thus allowing for in-place alignment visualization and evolutionary events labeling.
PhyloTree instances allow to deal with leaf names and species names separately. This is useful when working with molecular phylogenies, in which node names usually represent sequence identifiers. Species names will be stored in the PhyloNode.species attribute of each leaf node. The method PhyloNode.get_species() can be used obtain the set of species names found under a given internal node (speciation or duplication event). Often, sequence names do contain species information as a part of the name, and ETE can parse this information automatically.
There are three ways to establish the species of the different tree nodes:
The default behavior can be changed by using the PhyloNode.set_species_naming_function() method or by using the sp_naming_function argument of the PhyloTree class. Note that, using the sp_naming_function argument, the whole tree structure will be initialized to use the provided parsing function to obtain species name information. PhyloNode.set_species_naming_function() (present in all tree nodes) can be used to change the behavior in a previously loaded tree, or to set different parsing function to different parts of the tree.
To disable the automatic generation of species names based on node names, a None value can be passed to the PhyloNode.set_species_naming_function() function. From then on, species attribute will not be automatically updated based on the name of nodes and it could be controlled manually.
Full Example: Species aware trees.
There are several ways to automatically detect duplication and speciation nodes. ETE provides two methodologies: One implements the algorithm described in Huerta-Cepas (2007) and is based on the species overlap (SO) between partitions and thus does not depend on the availability of a species tree. The second, which requires the comparison between the gene tree and a previously defined species tree, implements a strict tree reconciliation algorithm (Page and Charleston, 1997). By detecting evolutionary events, orthology and paralogy relationships among sequences can also be inferred. Find a comparison of both methods in Marcet-Houben and Gabaldon (2009).
In order to apply the SO algorithm, you can use the PhyloNode.get_descendant_evol_events() method (it will detect all evolutionary events under the current node) or the PhyloNode.get_my_evol_events() method (it will detect only the evolutionary events in which current node, a leaf, is involved).
By default the species overlap score (SOS) threshold is set to 0.0, which means that a single species in common between two node branches will rise a duplication event. This has been shown to perform the best with real data, however you can adjust the threshold using the sos_thr argument present in both methods.
Tree reconciliation algorithm uses a predefined species tree to infer all the necessary genes losses that explain a given gene tree topology. Consequently, duplication and separation nodes will strictly follow the species tree topology.
To perform a tree reconciliation analysis over a given node in a molecular phylogeny you can use the PhyloNode.reconcile() method, which requires a species PhyloTree as its first argument. Leaf node names in the the species are expected to be the same species codes in the gene tree (see taxonomic_info). All species codes present in the gene tree should appear in the species tree.
As a result, the PhyloNode.reconcile() method will label the original gene tree nodes as duplication or speciation, will return the list of inferred events, and will return a new reconcilied tree (PhyloTree instance), in which inferred gene losses are present and labeled.
Both methods, species overlap and tree reconciliation, can be used to label each tree node as a duplication or speciation event. Thus, the PhyloNode.evoltype attrib
访问原文 返回搜索 http://etetoolkit.org/docs/latest/tutorial/tutorial_phylogeny.html
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。