founderInbreeding: Inbreeding coefficients of founders

View source: R/ped_founder-inbreeding.R

founderInbreedingR Documentation

Inbreeding coefficients of founders

Description

Functions to get or set inbreeding coefficients for the pedigree founders.

Usage

founderInbreeding(x, ids, named = FALSE, chromType = "autosomal")

founderInbreeding(x, ids, chromType = "autosomal") <- value

setFounderInbreeding(x, ids = NULL, value, chromType = "autosomal")

Arguments

x

A ped object or a list of such.

ids

Any subset of founders(x). If ids is missing in founderInbreeding(), it is set to founders(x).

named

A logical: If TRUE, the output vector is named with the ID labels.

chromType

Either "autosomal" (default) or "x".

value

A numeric of the same length as ids, entries in the interval ⁠[0, 1]⁠. If the vector is named, then the names are interpreted as ID labels of the founders whose inbreeding coefficients should be set. In this case, the ids argument should not be used. (See examples.)

Value

For founderInbreeding, a numeric vector of the same length as ids, containing the founder inbreeding coefficients.

For setFounderInbreeding(), a copy of x with modified founder inbreeding.

⁠founderInbreeding<-⁠ is an in-place version of setFounderInbreeding().

Examples

x = nuclearPed(father = "fa", mother = "mo", child = 1)
founderInbreeding(x, "fa") = 1
founderInbreeding(x, named = TRUE)

# Setting all founders at once (replacement value is recycled)
founderInbreeding(x, ids = founders(x)) = 0.5
founderInbreeding(x, named = TRUE)

# Alternative syntax, using a named vector
founderInbreeding(x) = c(fa = 0.1, mo = 0.2)
founderInbreeding(x, named = TRUE)


magnusdv/pedtools documentation built on April 9, 2024, 7:35 a.m.