buildPeds: Build all possible pedigrees

Description Usage Arguments Value Examples

View source: R/buildPeds.R

Description

Build all possible pedigrees

Usage

1
2
3
buildPeds(ids, sex, knownPO = NULL, allKnown = F, notPO = NULL,
  connected = F, maxLinearInbreeding = Inf, genderSym = F,
  verbose = F)

Arguments

ids

A vector of ID labels

sex

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

knownPO

A list of pairs of ID labels: The known parent-offspring pairs

allKnown

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

notPO

A list of pairs of ID labels: Pairs known not to be parent-offspring.

connected

A logical; if TRUE only connected pedigrees are returned. Default: FALSE.

maxLinearInbreeding

A nonnegative integer, or Inf (default). If this is a finite number, it disallows mating between pedigree members X and Y if X is a linear descendant of Y separated by more than the given number. For example, setting maxLinearInbreeding = 0 forbids mating between parent-child, grandparent-grandchild, a.s.o. If maxLinearInbreeding = 1 then parent-child matings are allowed, but not grandparent-grandchild or higher.

genderSym

A logical. If TRUE, 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

Value

A list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
p = buildPeds(1:3, sex = c(1,2,1), knownPO = list(c(1,3), c(2,3)))
stopifnot(length(p) == 26)
# plotPeds(p)

# Remove duplicates coming from gender swaps among added parents.
# Only one such duplicate here: where 1 and 2 are paternal/maternal half sibs
p2 = buildPeds(1:3, sex = c(1,2,1), knownPO = list(c(1,3), c(2,3)),
              genderSym = TRUE)
stopifnot(length(p2) == 25)
# plotPeds(p2)

# Remove pedigrees with linear inbreeding (e.g. parent-child)
p3 = buildPeds(1:3, sex = c(1,2,1), knownPO = list(c(1,3), c(2,3)),
              maxLinearInbreeding = 0)
stopifnot(length(p3) == 8)
# plotPeds(p3)

magnusdv/pedbuildr documentation built on Oct. 9, 2019, 2:51 p.m.