data("dna.obj")
### Method for signature 'Dna'.
x<-dna.obj
x<-dna.obj[c(1,20,21,26,27,28,30,3,4,7,13,14,15,16,23,24,25),,as.matrix=FALSE]
populations<-c("pop1","pop1","pop1","pop1","pop1","pop1","pop1","pop2",
"pop2","pop2","pop2","pop2","pop3","pop4","pop3","pop4","pop4")
##skip permutation testing
pst<-pairPhiST(x, populations, nperm=0)
pst
##allow negative PhiST values
pst<-pairPhiST(x, populations, nperm=0, negatives=TRUE)
pst
##Gaps as missing characters.
pst<-pairPhiST(x, populations, indels="m", nperm=0, negatives=TRUE)
pst
##using subset, second population against others
pst <-pairPhiST(x, populations, nperm=0,subset=c(2))
pst
if (FALSE) {
## 999 permutations.
pst<-pairPhiST(x, populations, nperm=999,showprogbar=TRUE)
pst
## random populations
x<-dna.obj
populations<-sample(1:4,nrow(x),replace=TRUE)
pst<-pairPhiST(x, populations, nperm=999,showprogbar=TRUE)
pst
## populations based on clusters
x<-dna.obj
d<-distance(x)
hc<-hclust(d,method="ward.D")
populations<-cutree(hc,4)
pst<-pairPhiST(x, populations, nperm=999,showprogbar=TRUE)
pst
}
### Method for signature 'dist'.
x<-dna.obj
x<-dna.obj[c(1,20,21,26,27,28,30,3,4,7,13,14,15,16,23,24,25),,as.matrix=FALSE]
populations<-c("pop1","pop1","pop1","pop1","pop1","pop1","pop1","pop2",
"pop2","pop2","pop2","pop2","pop3","pop4","pop3","pop4","pop4")
d<-distance(x)
pst<-pairPhiST(d, populations, nperm=0)
pst
### Method for signature 'matrix'.
x<-dna.obj
x<-dna.obj[c(1,20,21,26,27,28,30,3,4,7,13,14,15,16,23,24,25),,as.matrix=FALSE]
populations<-c("pop1","pop1","pop1","pop1","pop1","pop1","pop1","pop2",
"pop2","pop2","pop2","pop2","pop3","pop4","pop3","pop4","pop4")
d<-as.matrix(distance(x))
pst<-pairPhiST(d, populations, nperm=0)
pst
Run the code above in your browser using DataLab