validatePed: Pedigree errors

View source: R/ped.R

validatePedR Documentation

Pedigree errors

Description

Validate the internal pedigree structure. The input may be either a (possibly malformed) ped() object, or its defining vectors id, fid, mid, sex.

Usage

validatePed(x = NULL, id = NULL, fid = NULL, mid = NULL, sex = NULL)

Arguments

x

A ped object.

id

A vector (numeric or character) of individual ID labels.

fid

A vector of the same length as id, containing the labels of the fathers. In other words fid[i] is the father of id[i], or 0 if id[i] is a founder.

mid

A vector of the same length as id, containing the labels of the mothers. In other words mid[i] is the mother of id[i], or 0 if id[i] is a founder.

sex

A numeric of the same length as id, describing the genders of the individuals (in the same order as id.) Each entry must be either 1 (=male), 2 (=female) or 0 (=unknown).

Value

If no errors are detected, the function returns NULL invisibly. Otherwise, messages describing the errors are printed to the screen and an error is raised.

Examples

x = nuclearPed()
validatePed(x)

# Various errors
# validatePed(id = c(1,2), fid = c(2,0), mid = c(0,1), sex = c(1,2))


pedtools documentation built on Nov. 5, 2023, 5:06 p.m.