Learn R Programming

inbreedR (version 0.1.0)

r2_hf: Expected r2 between standardized multilocus heterozygosity (h) and inbreeding level (f)

Description

Expected r2 between standardized multilocus heterozygosity (h) and inbreeding level (f)

Usage

r2_hf(genotypes, subsets = NULL, nboot = 100, type = c("msats", "snps"),
  parallel = FALSE, ncores = NULL)

Arguments

genotypes
data.frame with individuals in rows and loci in columns, containing genotypes coded as 0 (homozygote), 1 (heterozygote) and NA (missing)
subsets
a vector specifying the sizes of marker-subsets to draw. For a subset of 20 markers, subsets = c(2, 5, 10, 15, 20) could be a reasonable choice. The minimum subset size is 2 and the maximum is the number of markers in the data. This analysis can be used
nboot
number re-draws per subset.
type
specifies g2 formula to take. Type "snps" for large datasets and "msats" for smaller datasets.
parallel
Default is FALSE. If TRUE, bootstrapping and permutation tests are parallelized
ncores
Specify number of cores to use for parallelization. By default, all available cores but one are used.

Value

  • callfunction call.
  • r2_hf_fullexpected r2 between inbreeding and sMLH for the full dataset
  • r2_hf_resexpected r2 for each randomly subsetted dataset
  • summary_r2_hfr2 mean and sd for each number of subsetted loci
  • nobsnumber of observations
  • nlocnumber of markers

References

Slate, J., David, P., Dodds, K. G., Veenvliet, B. A., Glass, B. C., Broad, T. E., & McEwan, J. C. (2004). Understanding the relationship between the inbreeding coefficient and multilocus heterozygosity: theoretical expectations and empirical data. Heredity, 93(3), 255-265. Szulkin, M., Bierne, N., & David, P. (2010). HETEROZYGOSITY-FITNESS CORRELATIONS: A TIME FOR REAPPRAISAL. Evolution, 64(5), 1202-1217.

Examples

Run this code
data(mouse_msats)
genotypes <- convert_raw(mouse_msats)
(out <- r2_hf(genotypes, subsets = c(2,4,6,8,10,12), nboot = 1000, type = "msats",
              parallel = FALSE))
plot(out)

Run the code above in your browser using DataLab