HILL
calulates the log-likelihood of a hybrid genotype given parental allele frequencies, an ancestry index (S), and interclass heterozygosity (H). This function is used by HIest
and HIclass
for data analysis.
HILL(par = c(S, H), G, P, type)
G
. If type == "codominant"
, G
must be a two-row matrix with one column for each locus, as in STRUCTURE (http://pritch.bsd.uchicago.edu/structure.html). If type == "dominant"
, G
is a vector of 0,1 for absence,presence of the dominant allele. If type == "allele.count"
, G
must be a vector of genotypes coded as 0,1,2 for the number of "j" alleles. That is, genotype 2 is homozygous for allele j, genotype 1 is heterozygous, and genotype 0 has no j alleles.
type="dominant"
or type="allele.count"
, there should be one row per locus, giving the frequencies of the dominant or "1" allele. For type="codominant"
there should be a separate row for each allele AND the Allele names should match the data in G
.
"codominant"
, "dominant"
, and "allele.count"
.
Fitzpatrick, B. M. 2012. Estimating ancestry and heterozygosity of hybrids using molecular markers. BMC Evolutionary Biology 12:131. http://www.biomedcentral.com/1471-2148/12/131
Lynch, M. 1991. The genetic interpretation of inbreeding depression and outbreeding depression. Evolution 45:622-629.
HIest
for maximum likelihood estimation of S and H, HIsurf
for a likelihood surface, HIclass
for likelihoods of early generation hybrid classes, HItest
to compare the classification to the maximum likelihood.
##-- A random codominant data set of 1 individual with 5 markers with three possible alleles each
P <- data.frame(Locus=rep(1:5,each=3),Allele=rep(1:3,5),
P1=as.vector(rmultinom(5,10,c(.7,.2,.1)))/10,
P2=as.vector(rmultinom(5,10,c(.1,.2,.7)))/10)
G <- matrix(nrow=2,ncol=5)
for(i in 1:5){
G[,i] <- sample(c(1,2,3),size=2,replace=TRUE,prob=rowMeans(P[P$Locus==i,3:4]))
}
HILL(par=c(0.5,0.5),G,P,type="codominant")
##-- Make it into allele count data (count "3" alleles)
P.c <- P[seq(from=3,to=15,by=3),]
G.c <- colSums(G==3)
HILL(par=c(0.5,0.5),G.c,P.c,type="allele.count")
##-- Make it into dominant data where allele 3 is dominant
G.d <- replace(G.c,G.c==2,1)
HILL(par=c(0.5,0.5),G.d,P.c,type="dominant")
Run the code above in your browser using DataLab