Plot pedigrees

Share:

Description

Plot method for simfam. Provides pedigree plots for specified families generated from simfam function with option to save plots into a pdf file.

Usage

1
2
## S3 method for class 'simfam'
plot(x, famid, pdf=FALSE, file=NULL, ...)

Arguments

x

Object created by simfam function, or a data frame that contains famID,indID,fatherID, motherID,gender (1 for male, 0 for female),status (1 for affected, 0 for non-affected), mgene (1 for mutation carrier, 0 for non-carrier), and proband (1 for proband, 0 for non-proband). Optionally, data frame can contain a column named carrp.geno or carrp.pheno to replace missing values in mgene to their carrier probabilities.

famid

List of family IDs to plot. Default is the first family in given data set

pdf

logical; if TRUE, pedigree plots are saved in a pdf file. If FALSE, plot pedigrees on current plotting device. Default=FALSE.

file

File name to save the pedigree plots; Default file name is "pedigreeplot.pdf".

...

Additional arguments passed on to the plot function.

Value

Returns pedigree plots for specified families created by simfam function or dataframe provided along with the affection and carrier mutation statuses of family members. Probands from each pedigree are indicated using red color.

When dataframe inlcudes carrp.geno and/or carrp.pheno generated by carrierprob function, the plot function displays the carrier probabilities for those with missing carrier status.

See Also

simfam, summary.simfam, carrierprob

Examples

1
2
3
4
5
6
7
8
9
# Simulated family data

fam <- simfam(N.fam=300, design="pop+", base.dist="Weibull", allelefreq=0.02, 
       base.parms=c(0.01,3), vbeta=c(-1.13, 2.35), agemin=20)
 
# Pedigree plots for first five simulated families

plot.simfam(fam, famid=c(1:3), pdf=TRUE, file="pedigrees.pdf")