condensedIdentityX: Identity coefficients on X

View source: R/condensedIdentity.R

condensedIdentityXR Documentation

Identity coefficients on X

Description

Computes the X chromosomal condensed identity coefficients of a pairwise relationship.

Usage

condensedIdentityX(x, ids, sparse = NA, simplify = TRUE, verbose = FALSE)

Arguments

x

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

ids

A character (or coercible to character) containing ID labels of two or more pedigree members.

sparse

A positive integer, indicating the pedigree size limit for using sparse arrays (as implemented by the slam package) instead of ordinary arrays.

simplify

Simplify the output (to a numeric of length 9) if ids has length 2. Default: TRUE.

verbose

A logical

Details

The implementation is inspired by Karigl's recursive algorithm (1981) for the autosomal case, modified to account for X-linked inheritance.

The X chromosomal pairwise identity states depend on the sexes of the two individuals. If both are female, the states are the same as in the autosomal case. When males are involved, the two individuals have less than 4 alleles, hence the states differ from the autosomal ones. However, to avoid drawing (and learning) new pictures we re-use the autosomal states by using the following simple rule: Replace any hemizygous male allele with a pair of autozygous alleles. In this way each X state corresponds to a unique autosomal state.

For simplicity the output always contains 9 coefficients, but with NA's in the positions of undefined states (depending on the sex combination). The README file on the GitHub home page of ribd has a table illustrating this.

Value

If ids has length 2 and simplify = TRUE: A vector of length 9, containing the condensed identity coefficients. If any of the individuals are male, certain states are undefined, and the corresponding coefficients are NA. (See Details.)

Otherwise, a data frame with 11 columns and one row for each pair of individuals. The first two columns contain the ID labels, and columns 3-11 contain the condensed identity coefficients.

See Also

kinship(), identityCoefs(), pedtools::founderInbreeding()

Examples


x = fullSibMating(1)
x_sisters = swapSex(x, 5)
x_brothers = swapSex(x, 6)

condensedIdentityX(x, ids = 5:6)
condensedIdentityX(x_sisters, ids = 5:6)
condensedIdentityX(x_brothers, ids = 5:6)


ribd documentation built on Aug. 10, 2023, 5:08 p.m.