plotting-functions: Pedigree plotting functions

plotPedR Documentation

Pedigree plotting functions

Description

Plot a pedigree for a family or an individual.

Usage


doPlotPed(family=NULL, individual=NULL, father=NULL, mother=NULL, gender=NULL,
        affected=NULL, is.deceased=NULL, is.sab.or.top=NULL, is.proband=NULL,
        is.adopted=NULL, are.twins=NULL, are.consanguineous=NULL,
        text.inside.symbol=NULL, text.beside.symbol=NULL,
        text1.below.symbol=NULL, text2.below.symbol=NULL,
        text3.below.symbol=NULL, text4.below.symbol=NULL,
        filename=NULL, device="plot", res=600, ...)

switchPlotfun(method, check=TRUE)

Arguments

family

(Optional) character or numeric vector specifying the family id.

individual

(Required) character or numeric vector with the ids of the individuals.

father

(Required) character or numeric vector with the id of the father for each individual.

mother

(Required) character or numeric vector with the id of the mother for each individual.

gender

(Required) character, factor or numeric vector specifying the gender, with 1 or any string starting with "m" coding for male and 2 or any string starting with "f" for male; NA codes for unknown.

affected

(Optional) numeric or logical vector specifying if the individual is affected, 0 or FALSE for not affected, 1 or TRUE for affected, NA for not phenotyped.

is.deceased

(Optional) numeric of logical vector specifying whether the individual is deceased.

is.sab.or.top

(Optional) numeric or logical vector specifying if the individual is the result of a spontaneous abortion or termination of pregnancy.

is.proband

(Optional) numeric or logical vector specifying whether the individual is declared as proband (i.e. the first affected family member coming to medical attention).

is.adopted

(Optional) numeric or logical vector specifying if the individual has been adopted.

are.twins

(Optional) character vector spefifying twins in the family. Individuals sharing the same string are recognized as twins. The string has to start either with "m_" or "d_" for monozygotic or dizygotic twins, followed by the unique identifier for the twins.

are.consanguineous

(Optional) character vector specifying cosanguineous couples.

text.inside.symbol

(Optional) character vector with text to place inside symbols.

text.beside.symbol

(Optional) character vector with text to place beside symbols.

text1.below.symbol

(Optional) character vector with text to place below symbols.

text2.below.symbol

(Optional) character vector with text to place below symbols.

text3.below.symbol

(Optional) character vector with text to place below symbols.

text4.below.symbol

(Optional) character vector with text to place below symbols.

filename

(Optional) file name for the plot. If not specified the result is plotted to a temporary file.

device

The format of the output file. Can be "ps", "pdf", "svg", "png" or "txt" if HaploPainter is used to create the plot, or "pdf", "png" or "plot" if kinship2 is used for plotting. If the HaploPainter backend is not installed, it is still possible to produce HaploPainter input files using devive = "txt" for later invocation of HaploPainter: this is achieved by calling switchPlotfun("haplopaint", check = FALSE), which will not check for the presence of a HaploPainter executable. Note: if "plot" is specified the plot is displayed instead of exported to a file.

res

(Optional) the resolution of the image if saved to a bitmap device.

method

The method which should be used for plotting, either "ks2paint" (uses kinship2 for plotting) or "haplopaint" (uses HaploPaint). If not specified, the functions switches between the methods.

check

A logical indicating whether the plotting backends (currently applied only to HaploPaint) is installed and working. Defaults to TRUE, such that it is guaranteed that a call to doPlotPed will at least technically succeed. The test is omitted by setting this argument to FALSE.

...

For plotPed: additional arguments submitted to the plotting function doPlotPed.

Details

All arguments passed to the doPlotPed function have to have the same length (with the exception of arguments filename, device and res) and their order has to match the order of the individuals.

The arguments of the doPlotPed function represent the input parameters supported by HaploPainter; for more information about HaploPainter refer to http://haplopainter.sourceforge.net/.

By default, doPlotPed uses the kinship2 package for plotting, but can also be configured by the switchPlotFun to use HaploPainter instead. HaploPainter is a perl script/tool for pedigree plotting bundled in the package that requires however some dependencies that might not be present on every system. Thus, the package checks on startup whether all requirements for HaploPainter are available. This check can be skipped by using check=FALSE when calling switchPlotFun. While using this argument is generally not recommended, it is of use when only writing HaploPainter input files, which does not make use of the HaploPainter plotting backend.

If HaploPainter is used, the plot can only be exported to a pdf or png device, while, if kinship2 is used, the plot can also be directly plotted and displayed (if device="plot" is specified).

HaploPainter plotting supports also device = "txt" in which case the pedigree data are exported (in the HaploPainter file format) as a tabulator delimited file - no plot is created, the name of the file is returned. This can even be done without a HaploPainter executable by calling switchPlotFun("haplopaint", check=FALSE).

Also, the arguments of this function match the arguments for HaploPainter and not all settings can be directly matched to settings in kinship2 plotting. The list below lists all arguments specific to HaploPainter and how, if at all, they are displayed or used in kinship2 plotting:

is.sab.or.top

Not supported yet.

is.proband

The id of individuals which are marked as probands are highlighted in red.

is.adopted

Not supported yet.

are.twins

Not supported yet.

are.consanguineous

Not supported yet.

text2.below.symbol

The text will be plotted on the top left corner of the symbol of the respective individual.

text3.below.symbol

The text will be plotted on the top right corner of the symbol of the respective individual.

Value

switchMethod

A character string representing the plotting function to be used.

doPlotPed

The name of the file to which the plot was exported.

Author(s)

Johannes Rainer.

See Also

plot.pedigree, plotPed,FAData-method,

Examples


## load the Minnesota Breast Cancer record and subset to the
## first families.
data(minnbreast)
family <- minnbreast[minnbreast$famid==4, ]

## draw a pedigree and export it to a pdf file; the file name is
## returned by the function.
doPlotPed(family=family$famid, individual=family$id, father=family$fatherid,
          mother=family$motherid, gender=family$sex, device="pdf")

## switch to the plotting functions of the kinship2 package
switchPlotfun("ks2paint")

## plot the same pedigree, but display it
doPlotPed(family=family$famid, individual=family$id, father=family$fatherid,
          mother=family$motherid, gender=family$sex, device="plot")

## Finally, generate an input file that can be used for interactive or
## scripted HaploPainter pedigree drawing.
switchPlotfun("haplopaint", check=FALSE)
doPlotPed(family=family$famid, individual=family$id, father=family$fatherid,
          mother=family$motherid, gender=family$sex, device="txt",
          filename="haplopainter.tsv")


jotsetung/FamAgg documentation built on March 15, 2023, 3:48 a.m.