Description Usage Arguments Details Value Warning Author(s) References See Also Examples
View source: R/sHe-old.R View source: R/sHe.R
Estimate spatial gene diversity (expected heterozygozity - He) through the individual-centred approach by Manel et al. (2007).
sHe()
calculates the unbiased estimate of He based on the information of allele frequency obtained from codominant or
dominant markers in individuals within a circular moving windows of known radius over the sampling area.
1 2 3 |
x |
a data frame or numeric matrix containing columns with coordinates of individuals and marker genotyping |
coord.cols |
a vector of integer giving the columns of coordinates in |
marker.cols |
a vector of integer giving the columns of markers in |
marker.type |
a character; the type of molecular marker |
grid |
optional; a two-column matrix containing coordinates over which to predict He |
latlong2km |
logical; should coordinates be converted from lat/long format into kilometer-grid based? |
radius |
the radius of the moving window. It must be in the same format as sampling coordinates |
nmin |
optional; a numeric value indicating the minimum number of individuals used to calculate He. If is
the number of individuals in a certain location is less then |
The unbiased estimate of expected heterogygozity (Nei, 1978) is given by:
He = (1 - ∑_{i=1}^{n} p_{i}^{2}) \frac{2n}{2n - 1}
where p_{i} is the frequency of the i-th allele per locus considering the n individuals in a certain location.
A list of
diversity |
a data frame with the following columns: coord.x - the x-axis coordinates of the predicion grid, coord.y - the y-axis coordinates of the predicion grid, n - the number of individuals in a certain points in the grid, MaxDist - the maximum observed distance among these individuals, uHe - the unbiased estimate of gene diversity (as expressed above), and SE - the standard error of uHe. |
mHe |
a matrix containing the estimates of He for every marker, on each point of the |
locations |
a numeric matrix containing the sampling coordinates, as provides as input. |
Depending on the dimension of x
and/or grid
, sHe()
can be time demanding.
Anderson Rodrigo da Silva <anderson.agro@hotmail.com>
Ivandilson Pessoa Pinto de Menezes <ivan.menezes@ifgoiano.edu.br>
da Silva, A.R.; Malafaia, G.; Menezes, I.P.P. (2017) biotools: an R function to predict spatial gene diversity via an individual-based approach. Genetics and Molecular Research, 16: gmr16029655.
Manel, S., Berthoud, F., Bellemain, E., Gaudeul, M., Luikart, G., Swenson, J.E., Waits, L.P., Taberlet, P.; Intrabiodiv Consortium. (2007) A new individual-based spatial approach for identifying genetic discontinuities in natural populations. Molecular Ecology, 16:2031-2043.
Nei, M. (1978) Estimation of average heterozygozity and genetic distance from a small number of individuals. Genetics, 89: 583-590.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | data(moco)
data(brazil)
# check points
plot(brazil, cex = 0.1, col = "gray")
points(Lat ~ Lon, data = moco, col = "blue", pch = 20)
# using a retangular grid (not passed as input!)
# ex <- sHe(x = moco, coord.cols = 1:2,
# marker.cols = 3:20, marker.type = "codominant",
# grid = NULL, radius = 150)
#ex
# plot(ex, xlab = "Lon", ylab = "Lat")
# A FANCIER PLOT...
# using Brazil's coordinates as prediction grid
# ex2 <- sHe(x = moco, coord.cols = 1:2,
# marker.cols = 3:20, marker.type = "codominant",
# grid = brazil, radius = 150)
# ex2
#
# library(maps)
# borders <- data.frame(x = map("world", "brazil")$x,
# y = map("world", "brazil")$y)
#
# library(latticeExtra)
# plot(ex2, xlab = "Lon", ylab = "Lat",
# xlim = c(-75, -30), ylim = c(-35, 10), aspect = "iso") +
# latticeExtra::as.layer(xyplot(y ~ x, data = borders, type = "l")) +
# latticeExtra::as.layer(xyplot(Lat ~ Lon, data = moco))
# End (not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.