网页
综合
更新时间 2026-11-17 09:04:35
SCRIPTS: orthoXML — ETE Toolkit - analysis and visualization of trees
自动蜘蛛
etetoolkit.org
正文约 3459 字
etree2orthoxml is a python script distributed as a part of the ETE toolkit package. It uses an automatic python parser generated on the basis of the OrthoXML schema to convert the evolutionary events in phylogenetic tree topologies into the orthoXML format.
ETE OrthoXML parser is a low level python module that allows to operate with the orthoXML structure using python objects. Every element defined in the orthoXML schema has its akin in the parser module, so a complete orthoXML structure can be generated from scratch within a python script. In other words, low level access to the orthoXML parser allows to create orthoxml documents in a programmatic way.
The following example will create a basic orthoXML document
etree2orthoxml is a standalone python script that allows to read a phylogenetic tree in newick format and export their evolutionary events (duplication and speciation events) as an orthoXML document. The program is installed along with ETE, so it should be found in your path. Alternatively you can found it in the script folder of the latest ETE package release (http://etetoolkit.org/releases/ete3/).
To work, etree2orthoxml requires only one argument containing the newick representation of a tree or the name of the file that contains it. By default, automatic detection of speciation and duplication events will be carried out using the built-in species overlap algorithm, although this behavior can be easily disabled when event information is provided along with the newick tree. In the following sections you will find some use case examples.
Also, consider reading the source code of the script. It is documented and it can be used as a template for more specific applications. Note that etree2orthoxml is a work in progress, so feel free to use the etetoolkit mailing list to report any feedback or improvement to the code.
If all internal nodes in the provided tree are correctly label as duplication or speciation nodes, automatic detection of events can be disabled using the --skip_ortholog_detection flag.
Node labeling should be provided using the extended newick format. Duplication nodes should contain the label evoltype set to D, while speciation nodes should be set to evoltype=S. If tag names is different, the option evoltype_attr can be used as convenient.
In the following example, we force the HUMAN clade to be considered a speciation node.
You can avoid tree reformatting when node labels are slightly different by using the evoltype_attr:
However, more complex modifications on raw trees can be easily performed using the core methods of the ETE library, so they match the requirements of the etree2orthoxml script.
As different databases and software may produce slightly different newick tree formats, the script provides several customization options.
In gene family trees, species names are usually encoded as a part of leaf names (i.e. P53_HUMAN). If such codification follows a simple rule, etree2orthoxml can automatically detect species name and used to populate the relevant sections within the orthoXML document.
For this, the sp_delimiter and sp_field arguments can be used. Note how species are correctly detected in the following example:
When evolutionary events are expected to be automatically inferred from tree topology, outgroup information can be passed to the program to root the tree before performing the detection.
© Copyright 2015, The ETE Toolkit Team. Last updated on Mar 18, 2016.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。