1

系統樹とそのツリーの文字データがあるとします。単方向であることがわかっている文字が 1 つあります。0 から 1 への遷移率は正ですが、1 から 0 への遷移率はゼロです (たとえば、0 は 2 倍体、1 は倍数体です)。ツリーの祖先の再構築を行いたいとしましょう。パッケージ Ape の Ace またはパッケージ phytools の make.simmap を使用して祖先の再構築を行うことができることは知っていますが、一方向の文字変更のモデルを指定する方法がわかりません。

例:

require(ape)
require(phytools)

# Generate example tree
set.seed(100)
tree<-rtree(10, rooted=T, tip.label=letters[1:10])
# Example characters
characters<-sample(0:1, 10, replace=T)
names(characters)<-letters[1:10]

# Equal-rates model
mod=matrix(c(0,1,1,0),2)
simmap<-make.simmap(tree, characters, model=mod)
plotSimmap(simmap) # Works fine


# My attempt at a unidirectional model: rate of change from 1 to 0 set to zero
mod = matrix(c(0,0,1,0),2)
simmap<-make.simmap(tree, characters, model=mod) # Gives me error; Error in eigen(mat) : infinite or missing values in 'x'

誰が何をすべきか考えていますか?

4

1 に答える 1

2

上記のコードは、R バージョン 3.1.2 (2014-10-31) を使用して正常に機能しました。新しくインストールされたバージョンの ape と phytools を使用した Windows の「パンプキン ヘルメット」です。make.simmap のヘルプ ドキュメントでは、以前のバージョンでのいくつかのエラーについて説明しています。

mod = matrix(c(0,0,1,0),2)
simmap<-make.simmap(tree, characters, model=mod)
make.simmap is sampling character histories conditioned on the transition matrix
#Q =
#           0         1
#0 -0.8271365 0.8271365
#1  0.0000000 0.0000000
#(estimated using likelihood);
#and (mean) root node prior probabilities
#pi =
#  0   1 
#0.5 0.5 
#Done.
于 2015-03-10T19:02:08.890 に答える