pairPhiST-methods {haplotypes} | R Documentation |
Provides the pairwise PhiST between populations
Description
This function calculates pairwise PhiST between populations using the AMOVA framework.
Usage
## S4 method for signature 'Dna'
pairPhiST(x,populations,indels="sic",nperm=99, negatives=FALSE, subset =NULL,
showprogbar=TRUE)
## S4 method for signature 'dist'
pairPhiST(x,populations,nperm=99, negatives=FALSE, subset=NULL,showprogbar=TRUE)
## S4 method for signature 'matrix'
pairPhiST(x,populations,nperm=99,negatives=FALSE, subset=NULL,showprogbar=TRUE)
Arguments
x |
an object of class |
populations |
a vector giving the populations, with one element per individual. |
indels |
the indel coding method to be used. This must be one of "sic", "5th" or "missing". Any unambiguous substring can be given. See |
nperm |
the number of permutations. Set this to 0 to skip the permutation procedure. |
negatives |
boolean; if it is FALSE all negative PhiST values are replaced with zero. |
subset |
a vector of integers in the range [1, |
showprogbar |
boolean; whether the progress bar is displayed or not displayed. |
Details
The null distribution of pairwise PhiST under the hypothesis of no difference between the populations is obtained by permuting individuals between populations.
Value
a list with following components:
PhiST |
a matrix giving the PhiST values between populations. |
p |
a matrix giving the p-values, or NULL if permutation test is not performed. |
Methods
signature(x = "Dna")
signature(x = "dist")
signature(x = "matrix")
Note
An internal code Statphi
is taken from package ade4 version 1.7-8 without any modification, author Sandrine Pavoine. Function amova
from package pegas is used internally to estimate variance components, author Emmanuel Paradis.
Author(s)
Caner Aktas, caktas.aca@gmail.com
References
Excoffier, L., Smouse, P.E. and Quattro, J.M. (1992) Analysis of molecular variance inferred from metric distances among DNA haplotypes: application to human mitochondrial DNA restriction data. Genetics, 131, 479-491.
Examples
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
## Not run:
## 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
## End(Not run)
### 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