plot.simfam_c: Plot method for 'simfam_c' or Plot pedigrees

View source: R/plot.simfam_c.R

plot.simfam_cR Documentation

Plot method for simfam_c or Plot pedigrees

Description

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

Usage

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

Arguments

x

An object of class 'simfam' created by simfam function or a data frame that has class attributes c("simfam", "data.frame").

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 is FALSE.

file

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

...

Additional arguments passed on to the plot function.

Details

Argument x can be a data frame that contains famID, indID, fatherID, motherID, gender (1 for male, 0 for female), status (1 for affected by event 1, 2 for affected by event 2, 0 for non-affected), mgene (1 for mutation carrier, 0 for non-carrier, NA for missing), and proband (1 for proband, 0 for non-proband) and should have class attributes class(x) <- c("simfam", "data.frame").

Optionally, the data frame can contain a column named carrp.geno or carrp.pheno to replace missing values in mgene with their carrier probabilities.

Value

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

When object 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


# Simulated competing risk data from gamma frailty model based on pop+ design

set.seed(4321)
fam <- simfam_c(N.fam = 10, design = "pop+", variation = "frailty", competing=TRUE,
                  base.dist = "Weibull", frailty.dist = "gamma", depend=c(2, 2), 
                  allelefreq = 0.02, base.parms = list(c(0.01, 3), c(0.01, 3)), 
                  vbeta = list(c(-1.13, 2.35),c(-1, 2)))

# Pedigree plots for first three simulated families

plot(fam, famid = 1)


FamEvent documentation built on Nov. 17, 2022, 5:06 p.m.