validate_trio_consistency {networkR} | R Documentation |
Validate pedigree trio information consistency
Description
Simple tests to chech the consistency of the pedigree trio family data. Currently the following checks are undertaken: 1) that no duplicates ids are found; 2) that the primary id is not missing for anyone; 3) that founders have both the father and mother id missing; 4) that individuals are not both classified as male (fathers and mothers);
Usage
validate_trio_consistency(id, fid, mid, sex = NULL)
Arguments
id |
Numeric. The id of the individual. These values should be unique |
fid |
Numeric. The father id. NA or 0 are used for missing. |
mid |
Numeric. The mother id. NA or 0 are used for missing. |
sex |
An optional numeric vector with the sex of the individual. Only four values should be present 1 (male), 2 (female), 0 or NA (missing) |
Details
There are no checks of persons being both mother and father, nor being its
own parent and incest checks are not performed. In other words, the
obj
is assumed to be sane, but possibly immoral.
Value
Throws an error if an inconsistency is found. Otherwise returns TRUE.
Author(s)
Claus Thorn Ekstrøm, ekstrom@sund.ku.dk
Examples
library("data.table")
id <- 1:12
fid <- c(NA, 0, 1, 1, NA, 23, 45, 5, 5, 7, 10, 10)
mid <- c(NA, NA, 2, 2, 0, 56, 46, 6, 6, 6, 9, 11)
validate_trio_consistency(id, fid, mid)