Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

inbreeding

Inbreeding coefficients


Description

Compute the inbreeding coefficients of all members of a pedigree. These are simple wrappers of kinship() and kinshipX(). The founders may be inbred; see pedtools::founderInbreeding() for how to set this up.

Usage

inbreeding(x, id = NULL)

inbreedingX(x, id = NULL)

Arguments

x

A pedigree, in the form of a pedtools::ped object.

id

Either a single ID label, or NULL (default).

Details

The autosomal inbreeding coefficient of a pedigree member is defined as the probability that, at a random autosomal locus, the two alleles carried by the member are identical by descent relative to the pedigree. It follows from the definition that the inbreeding coefficient of a member equals the kinship coefficient of the parents.

The X chromosomal inbreeding coefficient of an female member is defined similarly to the autosomal case above. For males is it always 1.

The inbreeding coefficients are computed from the diagonal of the kinship matrix, by the formula

f_a = 2*phi_aa - 1.

Value

If id is NULL, the output is a named numeric vector of length pedsize(x), containing the inbreeding coefficients of each pedigree member. is returned.

If id is the label of a pedigree member, the inbreeding coefficient of this individual is returned unnamed.

See Also

Examples

# Child of half siblings: f = 1/8
x = halfCousinPed(0, child = TRUE)
inbreeding(x)

# If the father is 100% inbred, the inbreeding coeff of the child doubles
fa = commonAncestors(x, 4:5) # robust to label change
founderInbreeding(x, fa) = 1

inbreeding(x)

# Simpler output using the `id` argument:
inbreeding(x, id = 6)

### X-chromosomal inbreeding coefficients ###
# These depend on the genders in the pedigree.
# To exemplify, we consider a child of half siblings.

xPat = halfSibPed(sex2 = 2) # paternal half sibs
xPat = addChildren(xPat, father = 4, mother = 5, nch = 1, sex = 2)
stopifnot(inbreedingX(xPat, id = 6) == 0)

# Change to maternal half sibs => coeff becomes 1/4.
xMat = swapSex(xPat, 1)
stopifnot(inbreedingX(xMat, id = 6) == 0.25)

# Example with selfing and complete inbreeding
s = selfingPed(1)
founderInbreeding(s, 1) = 1
inbreeding(s, id = 2)

ribd

Pedigree-based Relatedness Coefficients

v1.2.0
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.