View source: R/dfalign.pedigree.R
dfalign.pedigree | R Documentation |
Calculate pedigree drawing coordinates and join them with pedigree data.
dfalign.pedigree(
ped,
chrtype = "autosome",
packed = TRUE,
width = 10,
align = TRUE,
hints = ped$hints
)
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 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. |
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
.
A data.frame
containing pedigree drawing coordinates and data with the following columns:
The numeric ID of each subject.
The name of each subject.
The numeric ID of each family.
The numeric ID of each mating.
Numeric. Information about the mating.
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.
The numeric ID of each twin pair.
Numeric. Information about the twin pair.
Identification variables for father and mother. Founders' parents should be coded as NA.
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
.
Numeric. Life status: 0=alive/missing, 1=dead, 2=stillbirth, 3=miscarriage.
Drawing coordinates of each subject.
Centerpoints for mating, offspring, and twins, respectively, for drawing the tree.
Numeric. Kinship between mating individuals as calculated by the kinship
function.
Further columns of type logical, containing affected indicators.
Each row represents one subject
kinship, align.pedigree, ggdraw.pedigree
data(minnbreast)
bpeds <- with(minnbreast, pedigree(id, fatherid, motherid, sex, affected=proband, famid=famid))
bped.id8 <- bpeds['8']
df<-dfalign.pedigree(bped.id8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.