karyoHaploid {ibdsim2} | R Documentation |
Haploid karyogram
Description
Show chromosomal segments in a haploid karyogram
Usage
karyoHaploid(
segments,
chrom = 1:22,
colBy = NULL,
col = NULL,
separate = TRUE,
alpha = 1,
bgcol = "gray92",
title = NULL,
legendTitle = NULL,
base_size = 16
)
Arguments
segments |
A data.frame (or an object coercible to data.frame)
containing the segments to be shown on the karyogram. The first three
columns must contain chromosome (with or without "chr" prefix), start
position and stop position (in Mb). Any further columns are ignored, except
possibly a column indicated by |
chrom |
A vector indicating which chromosomes to include. |
colBy |
A character vector naming the columns to be used for colouring. If NULL (default), all segments have the same colour. |
col |
A single fill colour for all the segments, or (if |
separate |
A logical; relevant only if the |
alpha |
A single numeric in |
bgcol |
The background colour of the chromosomes. |
title |
Plot title. |
legendTitle |
Legend title. |
base_size |
Font size, passed onto |
Value
The plot object is returned invisibly, so that additional ggplot
layers may be added if needed.
Examples
## Not run:
segs = data.frame(chrom = c(1,4,5,5,10,10),
start = c(100,50,20,80,10,50),
end = c(120,100,25,100,70,120),
IBD = c("paternal","maternal"))
cols = c(paternal = "blue", maternal = "red")
karyoHaploid(segs, col = "cyan")
karyoHaploid(segs, colBy = "IBD", col = cols)
# Note difference if `separate = FALSE`
karyoHaploid(segs, colBy = "IBD", col = cols, separate = FALSE)
# Reduce alpha to see the overlaps:
karyoHaploid(segs, colBy = "IBD", col = cols, separate = FALSE, alpha = 0.7)
## End(Not run)