phytools : setMap
RのパッケージphytoolsのコマンドsetMapでは、contMapで描いた系統樹の枝の色を変えられる。
-----------------------------------------------
library(phytools)
Tree<-pbtree(n=15)
x<-c(runif(15))
labels<-c("t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15")
names(x)<-labels
contTree<-contMap(Tree, x, res=100)
###色付けされた系統樹のオブジェクトを設定
setTree<-setMap(contTree,colors=c("blue","purple","red"))
###青→紫→赤の順になるよう設定
plot(setTree)
###図示
-----------------------------------------------
phytools : contMap
Rのパッケージphytoolsのコマンドcontmapでは、系統樹の枝に各種の形質値に合わせた色付けができる。
-----------------------------------------
library(phytools)
###パッケージの設定
Tree<-pbtree(n=15)
###サンプル系統樹の読み込み
x<-c(runif(15))
labels<-c("t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15")
names(x)<-labels
###サンプル系統樹の形質値、および、そのラベル付け
contMap(Tree, x, res=100)
###形質値の色付けされた系統樹が表示される(resは解像度)
-----------------------------------------
枝の色を変えたいときはsetMapを使う。