plot_genoprobcomp: Plot comparison of two sets of genotype probabilities

Description Usage Arguments Details See Also Examples

View source: R/plot_genoprobcomp.R

Description

Plot a comparison of two sets of genotype probabilities for one individual on one chromosome, as a heat map.

Usage

1
2
plot_genoprobcomp(probs1, probs2, map, ind = 1, chr = NULL, geno = NULL,
  threshold = 0, n_colors = 256, swap_axes = FALSE, ...)

Arguments

probs1

Genotype probabilities (as produced by qtl2geno::calc_genoprob()) or allele dosages (as produced by qtl2geno::genoprob_to_alleleprob()).

probs2

A second set of genotype probabilities, just like probs1.

map

Marker map (a list of vectors of marker positions).

ind

Individual to plot, either a numeric index or an ID.

chr

Selected chromosome to plot; a single character string.

geno

Optional vector of genotypes or alleles to be shown (vector of integers or character strings)

threshold

Threshold for genotype probabilities; only genotypes that achieve this value somewhere on the chromosome (in one or the other set of probabilities) will be shown.

n_colors

Number of colors in each color scale.

swap_axes

If TRUE, swap the axes, so that the genotypes are on the x-axis and the chromosome position is on the y-axis.

...

Additional graphics parameters passed to graphics::image().

Details

We plot the first set of probabilities in the range white to blue and the second set in the range white to red and attempt to combine them, for colors that are white, some amount of blue or red, or where both are large something like blackish purple.

See Also

plot_genoprob()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(qtl2geno)
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2geno"))
iron <- iron[1,"2"]   # subset to first individual on chr 2
map <- insert_pseudomarkers(iron$gmap, step=1)

# in presence of a genotyping error, how much does error_prob matter?
iron$geno[[1]][1,3] <- 3
pr_e <- calc_genoprob(iron, map, error_prob=0.002)
pr_ne <- calc_genoprob(iron, map, error_prob=1e-15)

# image of probabilities + comparison
par(mfrow=c(3,1))
plot_genoprob(pr_e, map, main="Allow errors")
plot_genoprob(pr_ne, map, main="Assume very low error error")
plot_genoprobcomp(pr_e, pr_ne, map, main="Comparison")

rqtl/qtl2plot documentation built on May 28, 2019, 2:36 a.m.