This is the main function for pedigree plotting, with many options for controlling the appearance of pedigree symbols, labels and marker genotypes. Most of the work is done by the plotting functionality in the 'kinship2' package.
# S3 method for linkdat
plot(x, marker = NULL, alleles = NULL, sep = "/", missing = "-",
skip.empty.genotypes = FALSE, id.labels = NULL, title = NULL, available = FALSE,
col = 1, deceased = numeric(0), starred = numeric(0), aff2 = NULL,
margins = c(0.6, 1, 4.1, 1), ...)
# S3 method for singleton
plot(x, marker = NULL, alleles = NULL, sep = "/", missing = "-",
skip.empty.genotypes = FALSE, id.labels = NULL, title = NULL, available = FALSE,
col = 1, deceased = numeric(0), starred = numeric(0), aff2 = NULL,
margins = c(8,0,0,0), ...)
a linkdat
object.
either NULL, a vector of positive integers, a marker
object, or a list of marker
objects. If NULL, no genotypes are plotted.
If a marker
object (or a list of such), the genotypes are written below each individual in the pedigree, in the format determined by
alleles
, sep
and missing
. If a vector of integers is given, the corresponding marker objects are extracted from x$markerdata
.
a character vector with allele names.
a character of length 1 separating alleles for diploid markers.
the symbol (integer or character) for missing alleles.
a logical. If TRUE, and marker
is non-NULL, empty genotypes (which by default looks like "-/-") are not printed.
a vector with labels for each pedigree member. This defaults to x$plot.labels
is this is set (see setPlotLabels
), otherwise to as.character(x$orig.ids)
.
the plot title. If NULL or "", no title is added to the plot.
either a logical, a color name, or the word "shaded". If a color name is given, the available individuals (as defined by x$available
) are plotted in this color.
If available=F
no coloring is used, while (for backwards compatibility) available=T
is equivalent to available="red"
. The "shaded" option results in diagonal shading.
a vector with color indicators for the pedigree members. Recycled if necessary. By default everyone is drawn black.
a numeric containing ID's of deceased pedigree members.
a numeric containing ID's of pedigree members that should be marked with a star in the pedigree plot.
NULL, or a numeric with affection statuses (2=affected, 1=unaffected, 0=unknown) for a second trait.
a numeric of length 4 indicating the plot margins. For singletons only the first element (the "bottom" margin) is used.
arguments passed on to plot.pedigree
in the kinship2
package. In particular symbolsize
and
cex
can be useful.
plot.linkdat
is in essence a wrapper for plot.pedigree
in the kinship2
package.
# NOT RUN {
data(toyped)
x = linkdat(toyped)
plot(x, marker=1, alleles=c("a1","a2"), sep=" | ", deceased=2)
y = singleton(id=1)
m = marker(y, 1, c('A',0), alleles=c('A','B'))
plot(y, marker=m, id="indiv 1", title="Singleton", available=TRUE)
# }
Run the code above in your browser using DataLab