| plot.simfam2 {FamEvent} | R Documentation |
Plot method for simfam2 or Plot pedigrees
Description
Provides pedigree plots for specified families generated from simfam2 function with option to save plots into a pdf file.
Usage
## S3 method for class 'simfam2'
plot(x, famid, pdf = FALSE, file = NULL, ...)
Arguments
x |
An object of class |
famid |
List of family IDs to plot. Default is the first family in given data set. |
pdf |
Logical; if |
file |
File name to save the pedigree plots; Default file name is |
... |
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, 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 simfam2 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
simfam2, summary.simfam2, carrierprob
Examples
set.seed(4321)
data <- simfam(N.fam = 10, design = "noasc", variation = "none",
base.dist = "Weibull", base.parms = c(0.016, 3), vbeta = c(1, 1))
IBDmatrix <- diag(1, dim(data)[1])
data <- data[ , c(1:7, 11, 14)]
fam2 <- simfam2(inputdata = data, IBD = IBDmatrix, design = "pop",
variation = c("kinship","IBD"), depend = c(1, 1),
base.dist = "Weibull", base.parms = c(0.016, 3),
var_names = c("gender", "mgene"), vbeta = c(1,1),
agemin=20)
plot(fam2, famid = c(1:2))