Computes the depth of each subject in the Pedigree.
Usage
# S4 method for class 'character_OR_integer'
kindepth(obj, dadid, momid, align_parents = FALSE, force = FALSE)
# S4 method for class 'Pedigree'
kindepth(obj, align_parents = FALSE, force = FALSE)
# S4 method for class 'Ped'
kindepth(obj, align_parents = FALSE, force = FALSE)
Arguments
- obj
A character vector with the id of the individuals or a
data.frame
with all the informations in corresponding columns.- dadid
A vector containing for each subject, the identifiers of the biologicals fathers.
- momid
A vector containing for each subject, the identifiers of the biologicals mothers.
- align_parents
If
align_parents = TRUE
, go one step further and try to make both parents of each child have the same depth. (This is not always possible). It helps the drawing program by lining up pedigrees that 'join in the middle' via a marriage.- force
If
force = TRUE
, the function will return the depth minusmin(depth)
ifdepth
reach a state with no founders is not possible.
Details
Mark each person as to their depth in a Pedigree; 0
for a founder,
otherwise :
$$depth = 1 + \max(fatherDepth, motherDepth)$$
In the case of an inbred Pedigree a perfect alignment may not exist.