Hello,
I would like to calculate a Fitch parsimony score for each site in an alignment
using parsimony(). The problem is that the function only returns a score for
each unique site pattern (as determined by phyDat). Is there anyway (either
with phyDat() or parsimony()) to get scores for each site regardless of whether
or not it is a unique site pattern?
For example:
> library(ape)
> library(phangorn)
>
> dat<-matrix(c(0,1,1,0,0,1,1,0,0,0,0,1,1,1,0,1),ncol=4)
> rownames(dat)<-c("A","B","C","D")
> colnames(dat)<-c("X1","X2","X3","X4")
> dat
X1 X2 X3 X4
A 0 0 0 1
B 1 1 0 1
C 1 1 0 0
D 0 0 1 1
> pdat<-phyDat(dat,type="USER",levels=c(0,1))
> pdat
4 sequences with 4 character and 3 different site patterns.
The states are 0 1
> tree<-rtree(4, rooted = TRUE, tip.label = c("A","B","C","D"), br = runif)
> parsimony(tree,pdat,site="site")
[1] 2 1 1
There are four positions (X1-X4) but only three site patterns and therefore
three parsimony scores.
Thank you.
Rob
[[alternative HTML version deleted]]
_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/