| plot_geno | R Documentation |
Plot multiple individuals' genome-wide genotypes
plot_geno(
geno,
map,
ind = NULL,
chr = NULL,
gap = 0,
col = NULL,
na_col = "white",
chrlines = "white",
swap_axes = FALSE,
...
)
geno |
Imputed phase-known genotypes, as a list of matrices
(as produced by |
map |
Marker map (a list of vectors of marker positions). |
ind |
Individuals to plot, either a numeric indexes or IDs. |
chr |
Selected chromosomes to plot; a vector of character strings. |
gap |
Gap between chromosomes |
col |
Vector of colors for the different genotypes. |
na_col |
Color for missing segments. |
chrlines |
Color for lines separating chromosomes |
swap_axes |
If TRUE, swap the axes, so that the chromosomes run horizontally. |
... |
Additional graphics parameters |
None.
plot_onegeno(), plot_genoprob()
# load data and calculate genotype probabilities
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
iron <- iron[1:50, ] # subset to first 50 individuals
map <- insert_pseudomarkers(iron$gmap, step=1)
pr <- calc_genoprob(iron, map, error_prob=0.002)
# infer genotypes, as those with maximal marginal probability
m <- maxmarg(pr, minprob=0.5)
# re-code the X chr, (5,6) -> (1,3)
m[["X"]] <- (m[["X"]] - 5)*2 + 1
# plot phased genotypes
plot_geno(m, map, col=c("#FFDC00", "#00C800", "#0064C9"))
# this is more interesting for Diversity Outbred mouse data
## Not run:
file <- paste0("https://raw.githubusercontent.com/rqtl/",
"qtl2data/main/DOex/DOex.zip")
DOex <- read_cross2(file)
# subset to first 25 individuals
DOex <- DOex[1:25, ]
pr <- calc_genoprob(DOex, error_prob=0.002)
# infer genotypes, as those with maximal marginal probability
m <- maxmarg(pr, minprob=0.5)
# guess phase
ph <- guess_phase(DOex, m)
# plot phased genotypes
plot_geno(ph, DOex$gmap)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.