haploDraw {ibdsim2}R Documentation

Draw haplotypes onto a pedigree plot

Description

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

Usage

haploDraw(
  x,
  ibd,
  chrom = NULL,
  ids = NULL,
  unit = "mb",
  L = NULL,
  pos = 1,
  cols = NULL,
  height = 4,
  width = 0.75,
  sep = 0.75,
  dist = 1,
  ...
)

Arguments

x

A ped object.

ibd

A genomeSim object, typically made by ibdsim().

chrom

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

ids

A vector indicating for which pedigree members haplotypes should be drawn. If NULL (default), all individuals in ibd are included.

unit

Either "mb" (default) or "cm".

L

A positive number: the chromosome length. By default derived from ibd.

pos

A vector recycled to pedsize(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, measured in pedigree symbol widths.

dist

The distance between pedigree symbols and the closest haplotype, measured in pedigree symbol widths.

...

Further arguments passed on to plot.ped(), e.g. margins, cex, keep.par.

Value

None.

Examples


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

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

haploDraw(x, s)

# Custom colours and placements
haploDraw(x, s, cols = c(3,7,2,4), pos = c(2,4,2,4))

# Standard plot options apply
haploDraw(x, s, margins = 3, cex = 1.5, title = "Full sibs")


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

x = halfCousinPed(0, child = TRUE)
map = uniformMap(M = 1)
s = ibdsim(x, map = map, skipRecomb = c(1,3), seed = 2)

# Only include relevant individuals (skip 1 and 3)
haploDraw(x, s, ids = c(2,4,5,6), pos = c(1,2,4,4))

###############################
# Example 3: X-chromosomal sims
###############################

x = nuclearPed(2, sex = 2:1)
s = ibdsim(x, N = 1, map = uniformMap(M = 1, chrom = "X"), seed = 123)

haploDraw(x, s)



[Package ibdsim2 version 2.0.0 Index]