网页 综合 更新时间 2026-11-17 09:01:16

Testing Evolutionary Hypothesis — ETE Toolkit - analysis and visualization of trees

自动蜘蛛 etetoolkit.org 正文约 5999 字
You should have codeml and slr in your path:
Download, compile and install both of the programs, in order to be able to run the examples.
This ETE extension is written on top of these two external programs, so it is strongly recommended to read their corresponding documentation.
An other aspect in the study of evolutionary history, is the analysis of selective pressures accounting for the conservation or degeneration of protein coding genes.
The EvolTree class is an extension of the class PhyloTree that implements mainly bindings to the PAML package [yang2007] but also to the SLR program [massingham2005].
Evolutionary variables that are used to summary selective pressures are, of course the branch-length (bL) already available in PhyloTree, but also the rate of non-synonymous mutations (dN), the rate of synonymous mutations (dS) and finally the \(\omega\) ratio:
EvolTree works mainly as PhyloTree, thus it needs a tree and an alignment. However as you are going to run external programs over it, a working directory needs to be defined. By default tree.workdiris “/tmp/ete3-codeml/”, but it is recommended to change it to a more useful path.
Jobs will be stored in the workdir, and you will be able to load precomputed evolutionary models from there.
In order to identify the evolutionary trends in a phylogenetic tree, one can either:
As for PhyloTree, we first load the tree and alignment (and you working directory, if you want to save a copy of your jobs):
Once loaded we are able to compute selective pressure among the tree according to an evolutionary model. In this case, we will use free-ratio model:
EvolNode.run_model() allows to run different evolutionary models (follow this link EvolNode.run_model() to see the full list of models available). By convention, the name of the model called is the first word, the rest of the string, after the dot, corresponds to its identifier in order to differentiate different runs of one model. We can thus either run “fb” model and “fb.something” with the same result, but they will be stored under different names instead of being overwritten.
Once computation is done, we can retrieve the evol.Model object from the tree, with the EvolNode.get_evol_model() function.
This last print statement would ouptut:
By default, the free-branch model is run with this parameters:
However, it is usually recommended to run one model several times with different starting values, and keep only the model with higher likelihood. Here an example, on how to do this.
Finally in order to have a quick look of the selctive pressures over our phylogeny:
by default this will the picture obtained:
Node size, and color dependant of the \(\omega\) value. But other displays are available:
With here \(\omega\) ratios in red and also in gray the dN and dS values.
Another way to look at selective pressures, is to compute directly along the alignment, the value of \(\omega\) for a whole column (putting all leaves together). For doing this, we can use for example the model M2 of CodeML or directly use SLR. As before we just have to:
and to display the results:
when a site model is computed, an histface is automatically generated. Thus with this call, what we are doing is to draw the default histface corresponding to the model named M2.lala. This is the result:
However customizing this face is feasible:
The col dictionary contains the colors for sites detected to be under positive selection (PS), relaxation (RX), or conserved (CN). However, it is not a good idea to use them now as we do not know if there is indeed positive selection.
To be able to accept M2 results we will have to test this model against a null model.
In order to know if the parameters estimated under a given model a reliable, we have to compare its likelihood to a null model.
Usually, the alternative model is a model that estimates the proportion of sites with \(\omega > 1\) and we compare its likelihood with a null model, usually a model that do not (letting \(\omega <= 1\)). This comparison is done through a likelihood ratio test. If the alternative model has the best fit than we are able to accept the possibility of \(\omega > 1\).
To see a non-exhaustive list of famous comparison see the documentation of the function: EvolNode.get_most_likely()
In order to know if some sites are significantly under positive selection, relaxed or conserved we have usually to compare 2 models. However using the model “SLR” we can directly infer positive selection or relaxation through the SLR program [massingham2005].
The most usual comparison, and perhaps the most robust, is the comparison of models M2 and M1.
Each sites model, contains a dictionary ‘model.sites’ in which are stored the results of CodeML. These are displayed through the histface, but they are still accessible by digging a bit. ‘site’ dictionary usually contains the result of the NEB and BEB analysis (prefer the BEB when available). For each of BEB and NEB, the probability of belonging from one category of site is summarized by ‘p0’, ‘p1’ and ‘p2’ in the case of M2 model that have only 3 class of sites (p0, the probability of belonging to the first class of sites with \(\omega < 1\); p1, the probability of belonging to the second class of sites with \(\omega = 1\); p2, the probability of belonging to the third class of sites with \(\omega > 1\)). For details on the models and outputs, it is recommended to read PAML documentation.
CodeML allows to test models that infer different selective pressures on a set of given branches. To do it, some branches of the tree are marked (usually with strings like this: ‘#1’). This is how to do it with ETE:
By doing this a branch model will compute different \(\omega\) values in mark branches (usually called foreground \(\omega_{frg}\)) and in the rest of the tree (usually called background \(\omega_{bkg}\)).
The comparison between free-branch and M0, will tell us if foreground branches have an \(\omega\) significantly different from the rest
访问原文 返回搜索 http://etetoolkit.org/docs/latest/tutorial/tutorial_adaptation.html
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。