plot.pedigree: Visualization of pedigree

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/plot.pedigree.r

Description

A function to visualize pedigree structure by a graph using the igraph package. Each genotype is represented as vertex and direct offsprings are linked by an edge.

Usage

1
2
## S3 method for class 'pedigree'
plot(x, effect = NULL,...)

Arguments

x

object of class pedigree or object of class gpData with element pedigree

effect

vector of length nrow(pedigree) with effects to plot on the x axis

...

Other arguments for function igraph.plotting

Details

The pedigree is structured top to bottom. The first generation is printed in the first line. Links over more than one generation are possible as well as genotypes with only one (known) parent. Usually, no structure in one generation is plotted. If an effect is given, the genotypes are ordered by this effect in the horizontal direction and a labeled axis is plotted at the bottom.

Value

A named graph visualizing the pedigree structure. Color is used to distinguish sex.

Note

This function uses the plotting method for graphs in the library igraph

Author(s)

Valentin Wimmer and Hans-Juergen Auinger

See Also

create.pedigree, simul.pedigree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
id <- paste("ID", 1:9, sep="0")
par1 <- paste("ID", c("","","","",1,1,1,4,7), sep="0")
par2 <- paste("ID", c("","","","",2,3,2,5,8), sep="0")
ped1 <- create.pedigree(id,par1,par2,unknown="ID0")
ped1
plot(ped1)

# create 2nd pedigree object
Id <- paste("ID", 10:16, sep="")
Par1 <- paste("ID", c("","",1,1,6,7,7), sep="0")
Par2 <- paste("ID", c("","",10,"08","09",11,14), sep="")
ped2 <- create.pedigree(Id,Par1,Par2,unknown=c("ID0", "ID"))
ped2

ped <- add.pedigree(ped1, ped2)
plot(ped)

Example output

    ID Par1 Par2 gener
1 ID01    0    0     0
2 ID02    0    0     0
3 ID03    0    0     0
4 ID04    0    0     0
5 ID05 ID01 ID02     1
6 ID06 ID01 ID03     1
7 ID07 ID01 ID02     1
8 ID08 ID04 ID05     2
9 ID09 ID07 ID08     3
IGRAPH 0ea59c5 DN-- 9 10 -- 
+ attr: name (v/c), Par1 (v/c), Par2 (v/c), gener (v/n)
+ edges from 0ea59c5 (vertex names):
 [1] ID01->ID05 ID01->ID06 ID01->ID07 ID04->ID08 ID07->ID09 ID02->ID05
 [7] ID03->ID06 ID02->ID07 ID05->ID08 ID08->ID09
    ID Par1 Par2 gener
1 ID10    0    0     0
2 ID11    0    0     0
3 ID12 ID01 ID10     1
4 ID13 ID01 ID08     1
5 ID14 ID06 ID09     1
6 ID15 ID07 ID11     1
7 ID16 ID07 ID14     2
IGRAPH d91c293 DN-- 16 20 -- 
+ attr: name (v/c), Par1 (v/c), Par2 (v/c), gener (v/n)
+ edges from d91c293 (vertex names):
 [1] ID01->ID05 ID01->ID06 ID01->ID07 ID01->ID12 ID04->ID08 ID07->ID15
 [7] ID07->ID09 ID01->ID13 ID06->ID14 ID07->ID16 ID02->ID05 ID03->ID06
[13] ID02->ID07 ID10->ID12 ID05->ID08 ID11->ID15 ID08->ID09 ID08->ID13
[19] ID09->ID14 ID14->ID16

synbreed documentation built on March 19, 2018, 3 p.m.