dfalign.pedigree: dfalign.pedigree

View source: R/dfalign.pedigree.R

dfalign.pedigreeR Documentation

dfalign.pedigree

Description

Calculate pedigree drawing coordinates and join them with pedigree data.

Usage

dfalign.pedigree(
  ped,
  chrtype = "autosome",
  packed = TRUE,
  width = 10,
  align = TRUE,
  hints = ped$hints
)

Arguments

ped

a pedigree object

chrtype

chromosome type. The currently supported types are "autosome" and "X" or "x".

packed

should the pedigree be compressed, i.e., to allow diagonal lines connecting parents to children in order to have a smaller overall width for the plot.

width

for a packed output, the minimum width

align

for a packed pedigree, align children under parents (TRUE), to the extent possible given the page width, or align to to the left margin (FALSE). The latter is mostly used by internal routines.

hints

plotting hints for the pedigree. This is a list with components order and spouse, the second one is optional. If the hints are missing the autohint routine is called to supply an initial guess.

The order component is a numeric vector with one element per subject in the pedigree. It determines the relative order of subjects within a sibship, as well as the relative order of processing for the founder couples. (For this latter, the female founders are ordered as though they were sisters). The spouse component is a matrix with one row per hinted marriage, usually only a few marriages in a pedigree will need an added hint, for instance reverse the plot order of a husband/wife pair. Each row contains the index of the left spouse, the right hand spouse, and the anchor: 1=left, 2=right, 0=either. Children will preferentially appear under the parents of the anchored spouse.

Details

This function calculates pedigree drawing coordinates using the align.pedigree function and combines them with the provided pedigree data. The resulting data frame can be used to plot pedigrees with ggplot2 or specific pedigree plotting functions like ggdraw.pedigree.

Value

A data.frame containing pedigree drawing coordinates and data with the following columns:

ID

The numeric ID of each subject.

Name

The name of each subject.

family

The numeric ID of each family.

mate.id

The numeric ID of each mating.

mate.helper

Numeric. Information about the mating.

mate.type

Factor. 1 = subject plotted to the immediate right is a spouse, 2 = subject plotted to the immediate right is an inbred spouse, 0 = not a spouse.

twin.id

The numeric ID of each twin pair.

twin.type

Numeric. Information about the twin pair.

dad.id, mom.id

Identification variables for father and mother. Founders' parents should be coded as NA.

sex

Gender of the individual noted in 'id'. Either character ("male","female","Male","Female","M","F") or numeric (1="male", 2="female") data is understood by downstream function ggdraw.pedigree.

status

Numeric. Life status: 0=alive/missing, 1=dead, 2=stillbirth, 3=miscarriage.

x, y

Drawing coordinates of each subject.

mate.centerpoint, family.centerpoint, twin.centerpoint

Centerpoints for mating, offspring, and twins, respectively, for drawing the tree.

kinship

Numeric. Kinship between mating individuals as calculated by the kinship function.

...

Further columns of type logical, containing affected indicators.

Each row represents one subject

See Also

kinship, align.pedigree, ggdraw.pedigree

Examples

data(minnbreast)
bpeds <- with(minnbreast, pedigree(id, fatherid, motherid, sex, affected=proband, famid=famid))
bped.id8 <- bpeds['8']
df<-dfalign.pedigree(bped.id8)

moritzlindner/ggped documentation built on Sept. 14, 2024, 12:14 p.m.