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 |
ibd |
A |
chrom |
A chromosome number, needed if |
ids |
A vector indicating for which pedigree members haplotypes should
be drawn. If NULL (default), all individuals in |
unit |
Either "mb" (default) or "cm". |
L |
A positive number: the chromosome length. By default derived from
|
pos |
A vector recycled to |
cols |
A colour vector corresponding to the alleles in |
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 |
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)