resume_inbreed: Calculate inbreeding coefficients from scratch or resume for...

View source: R/resume_inbreed.R

resume_inbreedR Documentation

Calculate inbreeding coefficients from scratch or resume for new individuals in the pedigree

Description

Calculate inbreeding coefficients from scratch or resume for new individuals in the pedigree

Usage

resume_inbreed(ped, f = c(), d = c(), export_d = FALSE)

Arguments

ped

: A data frame with integer columns corresponding to ID, SIRE, and DAM. IDs should be sequential, starting from 1. Missing parents (SIRE and DAM) are denoted as 0.

f

: (Optional) If available, the vector of inbreeding coefficients from the previous calculation of inbreeding coefficients with less number of animals in the pedigree.

d

: (Optional) If available, the vector of the diagonal elements of the diagonal matrix D in \mathbf A = \mathbf{TDT}' from the previous calculation of inbreeding coefficients with less number of animals in the pedigree, where A is the numerator relationship matrix.

export_d

: FALSE (default) or TRUE. If TRUE, vector d is retuned for future use.

Value

: Vector of inbreeding coefficients if export_d == FALSE, or a list containing the vector of inbreeding coefficients and the vector of d coefficients if export_d == TRUE.

Examples

# A sample pedigree data frame:
ped <- data.frame(
    ID = 1:12,
    SIRE = c(0, 0, 0, 2, 2, 0, 4, 6, 0, 6, 10, 10),
    DAM = c(0, 0, 0, 1, 1, 0, 3, 5, 7, 8, 9, 0)
)

oldped <- ped[1:9, ]
(oldrun <- resume_inbreed(oldped, export_d = TRUE))
resume_inbreed(ped)
resume_inbreed(ped, f = oldrun$f)
resume_inbreed(ped, f = oldrun$f, d = oldrun$d)


FnR documentation built on June 22, 2024, 12:26 p.m.