buildPeds: Build a list of pedigrees

Description Usage Arguments Details Value Examples

View source: R/buildPeds.R

Description

Build all pedigrees between a set of individuals, subject to given restrictions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
buildPeds(
  labs,
  sex,
  extra = "parents",
  age = NULL,
  knownPO = NULL,
  allKnown = FALSE,
  notPO = NULL,
  noChildren = NULL,
  connected = TRUE,
  linearInb = TRUE,
  maxLinearInb = NULL,
  sexSymmetry = TRUE,
  verbose = TRUE
)

Arguments

labs

A character vector of ID labels.

sex

A vector of the same length as labs, with entries 1 (male) or 2 (female).

extra

Either the word "parents", or a nonnegative integer. See details.

age

A numeric or character vector. If numeric, and age[i] < age[j], then individual i will not be an ancestor of individual j. The numbers themselves are irrelevant, only the partial ordering. Note that no interpretation is made about individuals of equal age.

Alternatively age may be a character vector of inequalities, e.g., age = c("1>2", "1>3"). This syntax allows finer control than the numeric version.

knownPO

A list of vectors of length 2, containing the ID labels of pairs known to be parent-offspring. By default, both directions are considered; use age to force a specific direction.

allKnown

A logical. If TRUE, no other pairs than knownPO will be assigned as parent-offspring. If FALSE (default), all pairs except those in notPO are treated as potential parent-offspring.

notPO

A list of vectors of length 2, containing the ID labels of pairs known not to be parent-offspring.

noChildren

A vector of ID labels, indicating individuals without children of their own.

connected

A logical. If TRUE (default), only connected pedigrees are returned.

linearInb

Either TRUE (allow any linear inbreeding), FALSE (disallow linear inbreeding) or a nonnegative integer indicating the maximum separation linearly related spouses. For example, linearInb = 1 allows mating between parent and child, but not between grandparent and grandchild (or more distant).

maxLinearInb

Deprecated; replaced by linearInb.

sexSymmetry

A logical. If TRUE (default), pedigrees which are equal except for the gender distribution of the added parents, are regarded as equivalent, and only one of each equivalence class is returned. Example: paternal vs. maternal half sibs.

verbose

A logical.

Details

The parameter extra controls which of two algorithms are used to create the pedigree list.

If extra is a nonnegative integer, it determines the number of extra individuals allowed in the iterative pedigree construction. These extras start off with undetermined sex, meaning that both males and females are used. It should be noted that the final pedigrees may contain additional extras, since missing parents are added at the end.

If extra is the word "parents", the algorithm is not iterative. It first generates all directed acyclic graphs between the original individuals. Then their parents are added and merged in all possible ways. This option has the advantage of not requiring an explicit/ad hoc number of "extras", but works best in smaller cases.

Value

A list of pedigrees. Each element is a ped object or a list of such.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Showing off a few of the options
plist = buildPeds(1:3, sex = c(1,2,1), extra = 1, knownPO = list(1:2),
                  age = "1 > 2", linearInb = FALSE)
stopifnot(length(plist) == 12)


# Slightly different output with `extra = "parents"`
plist2 = buildPeds(1:3, sex = c(1,2,1), extra = "parents", knownPO = list(1:2),
                   age = "1 > 2", linearInb = FALSE)
stopifnot(length(plist2) == 8)

pedbuildr documentation built on March 16, 2021, 9:07 a.m.