1

我已经使用 BEAST 运行了祖先状态重建,这给了我一个像这样的 Nexus 文件

#NEXUS

Begin taxa;
    Dimensions ntax=93;
        Taxlabels
            adan1251 
            blag1240-nule 
            wers1238-marit
            ;
End;
Begin trees;
    Translate
           1 adan1251,
           2 blag1240-nule,
           3 wers1238-marit
;
tree STATE_0 = ((1[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792,2[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.01067010801410265,3[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.03310620306359057)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.022661511629175332;
tree STATE_1 = ((1[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:1.02243609504948792,2[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.01067010801410265,3[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.03310620306359057)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.022661511629175332;
tree STATE_2 = ((1[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:2.02243609504948792,2[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.01067010801410265,3[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.03310620306359057)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.022661511629175332;
tree STATE_3 = ((1[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:3.02243609504948792,2[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.01067010801410265,3[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.03310620306359057)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.022661511629175332;
tree STATE_4 = ((1[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:4.02243609504948792,2[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.02243609504948792)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.01067010801410265,3[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.03310620306359057)[&recon_lexicon:cooked rice="00000000000001",recon_lexicon:mountain="000000000001",recon_lexicon:to die="00001",recon_lexicon:wall="00000001"]:0.022661511629175332;
End;

(除了 20 倍的分类群,2000 倍的树木和实际不同的树木。)

我想可视化 intenal 和 tip 节点中词汇项的重建,似乎ape可能是一个很好的工具,因为它可以编写脚本,它可以读取 Nexus 文件(我尝试使用 read. nexus("filename.nex"), 似乎 str 是合理的) 并且从http://ape-package.ird.fr/ape_screenshots.html判断它可以以很好的格式显示重建:

祖先节点重建的猿树

在从原始数据构建某种共识树之后,如何让thermo从 10000 棵不同的 Newick 树的评论 () 中给出的数据构建类似这棵树的东西?[&...]

4

1 回答 1

1

在查看了该ape包的一些文档之后,如果看起来您会对nodelabels()函数感兴趣。

绘制树后,您只需传递一个长度等于您拥有的分类群数量的向量,每个值代表占据其中一个字符状态的概率。然后,只需在thermo选项打开的情况下绘制节点上的概率。

从帮助文件:

data(bird.orders)
plot(bird.orders, "c", use.edge.length = FALSE, font = 1) 
nodelabels(thermo = runif(22), cex = .8)

如果您有两个以上的州,则必须创建一个矩阵,其列数等于您的州数,行数等于分类单元数。对于每一行,包括该状态对每个分类群的相对概率。每行应加起来为 1。

具有 3 个状态的扩展示例:

thermo <- matrix(c(.6,.3,.1), nrow=22, ncol=3)
plot(bird.orders, "c", use.edge.length = FALSE, font = 1)
nodelabels(thermo = thermo, cex = .8)
于 2017-08-11T20:05:29.193 回答