Friday, March 15, 2013

New version of countSimmap for "multiPhylo" objects

I just posted a new version of countSimmap for an object of class "multiPhylo" that uses the method described in a recent post. Here's a quick demo:

> require(phytools)
> source("utilities.R")
> tree<-pbtree(n=100,scale=1)
> Q<-matrix(c(-2,1,1,1,-2,1,1,1,-2),3,3)
> colnames(Q)<-rownames(Q)<-LETTERS[1:nrow(Q)]
> tree<-sim.history(tree,Q)
> mtrees<-make.simmap(tree,tree$states,model="ER",nsim=10)
> XX<-countSimmap(mtrees)
> XX
$Tr
       N A,A A,B A,C B,A B,B B,C C,A C,B C,C
 [1,] 43   0  13  15   3   0   5   5   2   0
 [2,] 35   0  13  12   3   0   4   1   2   0
 [3,] 39   0  15  11   3   0   6   3   1   0
 [4,] 46   0  12  15   3   0   6   3   7   0
 [5,] 48   0   5   5  10   0  14   8   6   0
 [6,] 45   0  14  12   5   0   7   5   2   0
 [7,] 53   0  12  11  18   0   7   1   4   0
 [8,] 46   0   5   5   9   0   7  11   9   0
 [9,] 48   0  10   5   6   0  12   8   7   0
[10,] 49   0  16   8  15   0   6   3   1   0

$message
[1] "Column N is the total number of character changes on 
the tree"
[2] "Other columns give transitions x,y from x->y" 

That's it.

No comments:

Post a Comment

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.