inbreedR (version 0.3.0)

g2_microsats: Estimating g2 from microsatellite data

Description

Estimating g2 from microsatellite data

Usage

g2_microsats(genotypes, nperm = 0, nboot = 0, 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)
nperm
Number of permutations for testing the hypothesis that the empirical g2-value is higher than the g2 for random associations between individuals and genotypes.
nboot
Number of bootstraps for estimating a confidence interval
CI
Confidence interval (default to 0.95)

Value

  • g2_microsats returns an object of class "inbreed". The functions `print` and `plot` are used to print a summary and to plot the distribution of bootstrapped g2 values and CI.

    An `inbreed` object from g2_microsats is a list containing the following components:

  • callfunction call.
  • g2g2 value
  • p_valp value from permutation test
  • g2_permutg2 values from permuted genotypes
  • g2_bootg2 values from bootstrap samples
  • CI_bootconfidence interval from bootstraps
  • se_bootstandard error of g2 from bootstraps
  • nobsnumber of observations
  • nlocnumber of markers

Details

Calculates g2 from smaller datasets. The underlying formula is compationally expensive due to double summations over all paits of loci (see David et al. 2007). Use convert_raw to convert raw genotypes (with 2 columns per locus) into the required format.

References

David, P., Pujol, B., Viard, F., Castella, V. and Goudet, J. (2007), Reliable selfing rate estimates from imperfect population genetic data. Molecular Ecology, 16: 2474

Examples

Run this code
data(mouse_msats)
# tranform raw genotypes into 0/1 format
genotypes <- convert_raw(mouse_msats)
(g2_mouse <- g2_microsats(genotypes, nperm = 1000, nboot = 100, CI = 0.95))

Run the code above in your browser using DataLab