haploDraw: Draw haplotypes onto a pedigree plot

Description Usage Arguments Value Examples

View source: R/haploDraw.R

Description

Visualise the IBD pattern of a single chromosome, by drawing haplotypes onto the pedigree.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
haploDraw(
  x,
  ibd,
  chrom = NULL,
  pos = 1,
  cols = NULL,
  height = 4,
  width = 0.5,
  sep = 0.75,
  dist = 1.5,
  ...
)

Arguments

x

A ped object.

ibd

A genomeSim object.

chrom

A chromosome number, needed if ibd contains data from multiple chromosomes.

pos

A vector recycled to the length of labels(x), indicating where haplotypes should be drawn relative to the pedigree symbols: 0 = no haplotypes; 1 = below; 2 = left; 3 = above; 4 = right. By default, all are placed below.

cols

A colour vector corresponding to the alleles in ibd.

height

The haplotype height divided by the height of a pedigree symbol.

width

The haplotype width divided by the width of a pedigree symbol.

sep

The separation between haplotypes within a pair, given as a fraction of width.

dist

The distance between pedigree symbols and the closest haplotype, given as a fraction of width.

...

Arguments passed on to plot.ped().

Value

None.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
op = par(no.readonly = TRUE)

###############################
# Example 1: A family quartet #
###############################

x = nuclearPed(2)
s = ibdsim(x, N = 1, map = uniformMap(M = 1), seed = 4276)
s[[1]]

haploDraw(x, s[[1]], pos = c(2,4,2,4), cols = c(3,7,2,4),
          margins = c(2, 5, 5, 5), cex = 1.2)


###########################
# Example 2: Autozygosity #
###########################

x = halfCousinPed(0, child = TRUE)
s = ibdsim(x, N = 1, map = uniformMap(M = 1),
           skipRecomb = spouses(x, 2), seed = 19499)
s[[1]]

# Grey colour (8) for irrelevant founder alleles
haploDraw(x, s[[1]], pos = c(0,1,0,2,4,4),
          cols = c(8,8,3,7,8,8), margin = c(2, 2, 2, 2))


# Restore graphics parameters
par(op)

ibdsim2 documentation built on Nov. 13, 2020, 5:06 p.m.