Visualise the IBD pattern of a single chromosome, by drawing haplotypes onto the pedigree.
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,
...
)
None.
A ped
object.
A genomeSim
object, typically made by ibdsim()
.
A chromosome number, needed if ibd
contains data from multiple
chromosomes.
A vector indicating for which pedigree members haplotypes should
be drawn. If NULL (default), all individuals in ibd
are included.
Either "mb" (default) or "cm".
A positive number: the chromosome length. By default derived from
ibd
.
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.
A colour vector corresponding to the alleles in ibd
.
The haplotype height divided by the height of a pedigree symbol.
The haplotype width, divided by the width of a pedigree symbol.
The separation between haplotypes within a pair, measured in pedigree symbol widths.
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
.
###############################
# 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)
Run the code above in your browser using DataLab