g2_microsats: Estimating g2 from microsatellite data

Description Usage Arguments Details Value Author(s) References Examples

View source: R/g2_microsats.R

Description

Estimating g2 from microsatellite data

Usage

1
2
g2_microsats(genotypes, nperm = 0, nboot = 0, boot_over = "inds",
  CI = 0.95, verbose = TRUE)

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

boot_over

Bootstrap over individuals by specifying "inds" and over loci with "loci". Defaults to "ind".

CI

Confidence interval (default to 0.95)

verbose

If FALSE, nothing will be printed to show the status of bootstraps and permutations.

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.

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:

call

function call.

g2

g2 value

p_val

p value from permutation test

g2_permut

g2 values from permuted genotypes

g2_boot

g2 values from bootstrap samples

CI_boot

confidence interval from bootstraps

se_boot

standard error of g2 from bootstraps

nobs

number of observations

nloc

number of markers

Author(s)

Martin A. Stoffel ([email protected]) & Mareike Esser ([email protected])

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

1
2
3
4
data(mouse_msats)
# tranform raw genotypes into 0/1 format
genotypes <- convert_raw(mouse_msats)
(g2_mouse <- g2_microsats(genotypes, nperm = 1000, nboot = 100, boot_over = "inds", CI = 0.95))

mastoffel/inbreedR documentation built on May 21, 2019, 12:43 p.m.