r2_hf: Expected r2 between standardized multilocus heterozygosity...

Description Usage Arguments Value Author(s) References Examples

View source: R/r2_hf.R

Description

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

Usage

1
2
r2_hf(genotypes, type = c("msats", "snps"), nboot = NULL,
  parallel = FALSE, ncores = NULL, CI = 0.95)

Arguments

genotypes

data.frame with individuals in rows and loci in columns, containing genotypes coded as 0 (homozygote), 1 (heterozygote) and NA (missing)

type

specifies g2 formula to take. Type "snps" for large datasets and "msats" for smaller datasets.

nboot

number of bootstraps over individuals to estimate a confidence interval around r2(h, f)

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.

CI

confidence interval (default to 0.95)

Value

call

function call.

r2_hf_full

expected r2 between inbreeding and sMLH for the full dataset

r2_hf_boot

expected r2 values from bootstrapping over individuals

CI_boot

confidence interval around the expected r2

nobs

number of observations

nloc

number of markers

Author(s)

Martin A. Stoffel (martin.adam.stoffel@gmail.com)

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

1
2
3
4
data(mouse_msats)
genotypes <- convert_raw(mouse_msats)
(out <- r2_hf(genotypes, nboot = 100, type = "msats", parallel = FALSE))
plot(out)

Example output

 20 bootstraps over individuals done
 40 bootstraps over individuals done
 60 bootstraps over individuals done
 80 bootstraps over individuals done
 100 bootstraps over individuals done
 ### bootstrapping over individuals finished! ###

Calculation of expected r2 between inbreeding level (f) and heterozygosity (sMLH)
---------------------------------------------------------------------------------


Data: 36 observations at 12 markers
Function call = r2_hf(genotypes = genotypes, type = "msats", nboot = 100, parallel = FALSE)

Expected r2 based on all markers:  0.2797576 

Confidence interval for r2 based on bootstrapping over individuals: 
     2.5%     97.5% 
0.0000000 0.4951413 

inbreedR documentation built on Feb. 2, 2022, 5:09 p.m.