Description Usage Arguments Details Value Author(s) References See Also Examples
HIsurf
calculates the log likelihood of points on a bivariate grid to describe the joint likelihood surface of ancestry and interclass heterozygosity for a genotype given parental allele frequencies.
1 |
G |
An individual diploid genotype as matrix (http://pritch.bsd.uchicago.edu/structure.html). If |
P |
Parental allele frequencies. A matrix or data frame with the following columns (order is important!): Locus name, Allele name, P1 allele frequency, P2 allele frequency. For |
type |
A string representing the data type. The options are |
size |
An integer giving the desired number of gridlines in each direction. The function will calculate the likelihood for all |
Given two ancestral species or parental populations (P1 and P2), the ancestry index (S) is the proportion of an individual's alleles descending from alleles in the P1 population and the interclass heterozygosity (H) is the proportion of an individual's loci that have one allele from each ancestral population (Lynch 1991). The likelihood functions are described in Fitzpatrick (2012).
A size x size
matrix of log likelihoods for all combinations of ancestry (S) and interclass heterozygosity (H). Rows correspond to the size
values of S, and columns the size
values of H. For impossible combinations (H > min(2*S,2-2*S)
), NA's are returned.
Ben Fitzpatrick
Fitzpatrick, B. M. 2008. Hybrid dysfunction: Population genetic and quantitative genetic perspectives. American Naturalist 171:491-198.
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, HIclass
for likelihoods of early generation hybrid classes, HItest
to compare the classification to the maximum likelihood, HILL
for the basic likelihood function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data(Bluestone)
Bluestone <- replace(Bluestone,is.na(Bluestone),-9)
# parental allele frequencies (assumed diagnostic)
BS.P <- data.frame(Locus=names(Bluestone),Allele="BTS",P1=1,P2=0)
# a small surface to view in the console
BS.surf.5 <- HIsurf(Bluestone[21,],BS.P,type="allele.count",size=5)
BS.surf.5 # the maximum likelihood is very near the center (S ~ H ~ 0.5)
# # a more finely sampled surface to visualize with image
# BS.surf <- HIsurf(Bluestone[21,],BS.P,type="allele.count",size=99)
# image(-BS.surf,col=gray(seq(from=0,to=1,length.out=6)),
# breaks=seq(from=min(-BS.surf,na.rm=TRUE),by=2,length.out=7),
# cex.axis=1.5,bty="n",xaxs="r",yaxs="r")
# # the breaks option is set so that each level of shading corresponds to 2 log-likelihood
# # units (for one unit increments, set by=1).
# # now make it pretty:
# image(is.na(BS.surf),col="light blue",breaks=c(.5,1),add=TRUE)
# axis(1,labels=FALSE,lwd=2); axis(2,labels=FALSE,lwd=2)
# title(xlab=expression(italic(S)),ylab=expression(italic(H[I])),cex.lab=1.5)
# lines(c(0,.5,1,0),c(0,1,0,0),lty=2,lwd=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.