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, main=NULL, device="plot", res=600, ...)switchPlotfun(method)
1 or any string starting with "m" coding
for male and 2 or any string starting with "f" for
male; NA codes for unknown.0 or FALSE for not affected, 1 or
TRUE for affected, NA for not phenotyped."m_" or
"d_" for monozygotic or dizygotic twins, followed by the
unique identifier for the twins."ps", "pdf",
"svg" or "png" if HaploPainter is used to
create the plot, or "pdf", "png" or "plot" if
kinship2 is used for plotting. Note: if "plot" is specified
the plot is displayed instead of exported to a file."ks2paint" (uses kinship2 for plotting) or
"haplopaint" (uses HaploPaint). If not specified, the
functions switches between the methods.plotPed: additional arguments submitted to the plotting
function doPlotPed.doPlotPed function have to have the
same length (with the exception of arguments filename,
main, 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.
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).
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:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
plot.pedigree,
plotPed,FAData-method,## 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")Run the code above in your browser using DataLab