Learn R Programming

gap (version 1.6)

pedtodot: Converting pedigree(s) to dot file(s)

Description

Converting pedigree(s) to dot file(s)

Usage

pedtodot(
  pedfile,
  makeped = FALSE,
  sink = TRUE,
  page = "B5",
  url = "https://jinghuazhao.github.io/",
  height = 0.5,
  width = 0.75,
  rotate = 0,
  dir = "none"
)

Value

For each pedigree, the function generates a .dot file to be used by dot. The collection of all pedigrees (*.dot) can also be put together.

Arguments

pedfile

a pedigree file in GAS or LINKAGE format, note if individual's ID is character then it is necessary to specify as.is=T in the read.table command.

makeped

a logical variable indicating if the pedigree file is post-makeped.

sink

a logical variable indicating if .dot file(s) are created.

page

a string indicating the page size, e.g, A4, A5, B5, Legal, Letter, Executive, "x,y", where x, y is the customized page size.

url

Unified Resource Locator (URL) associated with the diagram(s).

height

the height of node(s).

width

the width of node(s).

rotate

if set to 90, the diagram is in landscape.

dir

direction of edges, i.e., "none", "forward","back","both". This will be useful if the diagram is viewed by lneato.

Author

David Duffy, Jing Hua Zhao

Details

This function converts GAS or LINKAGE formatted pedigree(s) into .dot file for each pedigree to be used by dot in graphviz, which is a flexible package for graphics freely available.

Note that a single PostScript (PDF) file can be obtainaed by dot, fdp, or neato.

dot -Tps <dot file> -o <ps file>

or

fdp -Tps <dot file> -o <ps file>

or

neato -Tps <dot file> -o <ps file>

See relevant documentations for other formats.

To preserve the original order of pedigree(s) in the data, you can examine the examples at the end of this document.

Under Cygwin/Linux/Unix, the PostScript file can be converted to Portable Document Format (PDF) default to Acrobat.

ps2pdf <ps file>

Use ps2pdf12, ps2pdf13, or ps2pdf14 for appropriate versions of Acrobat according to information given on the headline of <ps file>.

Under Linux, you can also visualize the .dot file directly via command,

dotty <dot file> &

We can extract the code below (or within pedtodot.Rd) to pedtodot and then use command:

sh pedtodot <pedigree file>

See Also

package sem in CRAN and Rgraphviz in BioConductor https://www.bioconductor.org/.