calcR {FnR}R Documentation

Compute numerator relationship coefficients between two distinct groups of individuals

Description

Compute numerator relationship coefficients between two distinct groups of individuals

Usage

calcR(ped, set1, set2, type = "notdam-notsire", f = c(), d = c())

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.

set1

: A set of individual IDs.

set2

: A set of individual IDs, distinct from set1.

type

: "notdam-notsire" (default), "sire-sire", or "dam-dam" relationships

"notdam-notsire"

requires set1 and set2 individuals not to be members of ped$DAM and ped$SIRE, respectively.

"sire-sire"

requires set1 and set2 individuals to be members of ped$SIRE.

"dam-dam"

requires set1 and set2 individuals to be members of ped$DAM.

f

: (Optional) If available, the vector of inbreeding coefficients for the whole pedigree (without dummy progeny) or 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}' where A is the numerator relationship matrix, for the whole pedigree (without dummy progeny) or from the previous calculation of inbreeding coefficients with less number of animals in the pedigree.

Value

: Numerator relationship coefficients between set1 and set2 individuals in the form of a matrix (a partition of the numerator relationship matrix A).

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)
)

# Example 1: Calculate relationship coefficients between two groups of animals,
# one's members not among dams, and the members of the other not among sires.
calcR(ped, set1 = c(12, 6), set2 = c(11, 8), type = "notdam-notsire")
# Since `"notdam-notsire"` is the default type, `type = "notdam-notsire"` might be omitted.

# Example 2: Calculate relationship coefficients between dam 7 and dams 8 and 9.
calcR(ped, set1 = 7, set2 = 8:9, type = "dam-dam")

# Example 3: Calculate relationship coefficients between sires 2 & 6 and sires 4 & 10.
calcR(ped, set1 = c(2, 6), set2 = c(4, 10), type = "sire-sire")

# Example 5: Repeat example 2 with inbreeding coefficients provided.
f <- rep(0, 12)
f[10] <- 0.25
f[11] <- 0.015625
calcR(ped, set1 = 7, set2 = 8:9, type = "dam-dam", f = f)

# Example 6: Repeat example 3 with inbreeding and d coefficients provided.
d <- c(1, 1, 1, 0.5, 0.5, 1, 0.5, 0.5, 0.75, 0.5, 0.4375, 0.6875)
calcR(ped, set1 = c(2, 6), set2 = c(4, 10), type = "sire-sire", f = f, d = d)


[Package FnR version 1.1.0 Index]