ped2dot: write a dot file from a pedigree specified in a data frame

Description Usage Arguments Examples

View source: R/pedvis.R

Description

write a dot file from a pedigree specified in a data frame

Usage

1
2
3
4
5
6
7
ped2dot(x, pa = "Pa", ma = "Ma", kid = "Kid", ObsNodes = character(0),
  ShowLabelNodes = character(0), ProngNodes = character(0),
  ObsStyle = list(style = "filled", fillcolor = "gray"),
  ProngStyle = list(style = "dashed"), ProngEdgeStyle = list(style =
  "dashed"), outf = "pedvis-ped", pfactorNodeStyle = "filled",
  pfactorEdgeStyle = "solid", Draw_O_factors = FALSE, RankSep = 1,
  NodeSep = 1)

Arguments

x

the data frame holding the pedigree. There must be at least three columns (kid, pa, and ma) which should be character vectors, NOT factors and NOT integers. Coerce them to characters if they are actually integers.

pa

string giving the name of the column holding the fathers in each row of the pedigree. (Or can be thought of as "parent 1" in the case in which sex is not treated.) Default is "Pa"

ma

the name of the column holding the mother in each row (or "parent 2"). Default is "Ma"

kid

the name of the column the kid

ObsNodes

a character vector of the identifiers of the kids, mas, and pas that have observed genotype data associated with them.

ShowLabelNodes

a character vector of the identifiers of the kids, mas, and pas that should have their labels printed inside their nodes.

ProngNodes

a character vector of the identifiers of the kids, mas, and pas that should be considered prong nodes, and therefore be printed a little differently. Additionally, the edges incident to a prong node will be drawn with ProngEdgeStyle.

ObsStyle

a named list of the extra style values that you want the observed nodes to have

ProngStyle

a named list of the extra style values that you want the prong nodes to have

ProngEdgeStyle

a named list of the extra style values that you want the edges connected to prong nodes to have

outf

Name of the output file without any suffixes (so files will be outf.dot, outf.ps, outf.pdf, etc.)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# simple pedigree as marriage node diagram
junk1 <- ped2dot(simple_test_ped(), outf = "ped2dot_ex1", pfactorNodeStyle = "invis", pfactorEdgeStyle = "invis")

# color in some of the individuals as having observed data
junk2 <- ped2dot(simple_test_ped(), ObsNodes = c("a", "b", "f", "C", "D", "Z", "U", "10"), outf = "ped2dot_ex2")

# draw the same thing, but make the allele freq factors invisible
junk3 <- ped2dot(simple_test_ped(), ObsNodes = c("a", "b", "f", "C", "D", "Z", "U", "10"),
        pfactorNodeStyle = "invis", pfactorEdgeStyle = "invis",
        outf = "ped2dot_ex3")

# like example 2 but with labels on the variable nodes (big circles and squares)
junk4 <- ped2dot(simple_test_ped(), ObsNodes = c("a", "b", "f", "C", "D", "Z", "U", "10"),
         outf = "ped2dot_ex4", ShowLabelNodes = unique(unlist(simple_test_ped())))

# put some prong nodes on there
junk5 <- ped2dot(simple_test_ped(), ObsNodes = c("a", "b", "f", "C", "D", "Z", "U", "10"),
             outf = "ped2dot_ex5", ShowLabelNodes = unique(unlist(simple_test_ped())), ProngNodes = c("c", "d", "e", "E", "V", "3", "11", "12", "4"))

eriqande/pedvis documentation built on Dec. 10, 2020, 1:15 p.m.