Plot pedigrees with genotypes
This is the main function for pedigree plotting, with many options for
controlling the appearance of pedigree symbols and accompanying labels. Most
of the work is done by the plotting functionality in the kinship2
package.
## S3 method for class 'ped' plot( x, marker = NULL, sep = "/", missing = "-", showEmpty = FALSE, labs = labels(x), title = NULL, col = 1, aff = NULL, carrier = NULL, hatched = NULL, shaded = NULL, deceased = NULL, starred = NULL, textInside = NULL, textAbove = NULL, hints = NULL, fouInb = "autosomal", margins = c(0.6, 1, 4.1, 1), keep.par = FALSE, ... ) ## S3 method for class 'singleton' plot( x, marker = NULL, sep = "/", missing = "-", showEmpty = FALSE, labs = labels(x), title = NULL, col = 1, aff = NULL, carrier = NULL, hatched = NULL, shaded = NULL, deceased = NULL, starred = NULL, textInside = NULL, textAbove = NULL, fouInb = "autosomal", margins = c(8, 0, 0, 0), yadj = 0, ... ) as_kinship2_pedigree(x, deceased = NULL, aff = NULL, hints = NULL) ## S3 method for class 'pedList' plot(x, ...)
x |
A |
marker |
Either a vector of names or indices referring to markers
attached to |
sep |
A character of length 1 separating alleles for diploid markers. |
missing |
The symbol (integer or character) for missing alleles. |
showEmpty |
A logical, indicating if empty genotypes should be included. |
labs |
A vector or function controlling the individual labels included in the plot. Alternative forms:
|
title |
The plot title. If NULL (default) or ”, no title is added to the plot. |
col |
A vector of colours for the pedigree members, recycled if
necessary. Alternatively, |
aff |
A vector of labels identifying members whose plot symbols should be filled. (This is typically used in medical pedigrees to indicate affected members.) |
carrier |
A vector of labels identifying members whose plot symbols should be marked with a dot. (This is typically used in medical pedigrees to indicate unaffected carriers of the disease allele.) |
hatched |
A vector of labels identifying members whose plot symbols should be hatched. |
shaded |
(Deprecated) synonym of |
deceased |
A vector of labels indicating deceased pedigree members. |
starred |
A vector of labels indicating pedigree members that should be marked with a star in the pedigree plot. |
textInside, textAbove |
Character vectors of text to be printed inside or above pedigree symbols. |
hints |
A list with alignment hints passed on to
|
fouInb |
Either "autosomal" (default), "x" or NULL. If "autosomal" or "x", inbreeding coefficients are added to the plot above the inbred founders. If NULL, or if no founders are inbred, nothing is added. |
margins |
A numeric of length 4 indicating the plot margins. For singletons only the first element (the 'bottom' margin) is used. |
keep.par |
A logical (default = FALSE). If TRUE, the graphical parameters are not reset after plotting, which may be useful for adding additional annotation. |
... |
Arguments passed on to |
yadj |
A tiny adjustment sometimes needed to fix the appearance of singletons. |
plot.ped
is in essence an elaborate wrapper for
kinship2::plot.pedigree()
.
Magnus Dehli Vigeland
x = nuclearPed(father = "fa", mother = "mo", child = "boy") m = marker(x, fa = "1/1", boy = "1/2", name = "SNP") plot(x, marker = m) # Markers attached to `x` may be called by name x = setMarkers(x, m) plot(x, marker = "SNP") # Other options plot(x, marker = "SNP", hatched = typedMembers(x), starred = "fa", deceased = "mo") # Filled symbols plot(x, aff = males(x)) # Label only some members plot(x, labs = c("fa", "boy")) # Label only some members; rename the father plot(x, labs = c(FATHER = "fa", "boy")) # Label males only plot(x, labs = males) # Colours plot(x, col = list(red = "fa", green = "boy"), hatched = "boy") # Founder inbreeding is shown by default founderInbreeding(x, "mo") = 0.1 plot(x) # ... but can be suppressed plot(x, fouInb = NULL) #----------------------------- # In some cases, the plotting machinery of `kinship2` needs a hint # (see ?kinship2::align.pedigree) # Example with 3/4-siblings y = nuclearPed(2) y = addChildren(y, 3, mother = 5, nch = 1) y = addChildren(y, 4, mother = 5, nch = 1) plot(y) # bad hints = list(order = 1:7, spouse = rbind(c(3,5,0), c(5,4,0))) plot(y, hints = hints) # good
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.