plot.updog: Draw a genotype plot from the output of 'updog'.

Description Usage Arguments Details Value Author(s)

View source: R/generics.R

Description

If ggplot2 is installed, then this function will use it to make the genotype plot. Otherwise, "classic" R base graphics will be used. The ggplot2 version is made using the function plot_geno. The "classic" R base graphics version is made using the function plot_geno_base.

Usage

1
2
3
4
## S3 method for class 'updog'
plot(x, gg = requireNamespace("ggplot2", quietly = TRUE),
  plot_beta = FALSE, ask = TRUE, use_colorblind = FALSE,
  show_maxpostprob = FALSE, show_ogeno = TRUE, show_outlier = TRUE, ...)

Arguments

x

The output from updog.

gg

Should we use ggplot2 to plot the genotypes (TRUE), or not (FALSE). If ggplot2 is present, then this defaults to TRUE. If it is not present, then it defaults to FALSE.

plot_beta

A logical. If true, then we'll plot the estimated beta density of the outlier model, followed by the estimated beta distributions of the overdispersion models.

ask

A logical. Should we ask before continuing on to the next plot (TRUE) or not (FALSE)?

use_colorblind

A logical. Should we use a colorblind safe palette (TRUE), or not (FALSE)?

show_maxpostprob

A logical. Should we scale the sizes by x$maxpostprob (TRUE), or not (FALSE)?

show_ogeno

A logical. Should we color code by x$ogeno (TRUE), or not (FALSE)?

show_outlier

A logical. Should we scale the transparency by x$prob_ok (TRUE), or not (FALSE)?

...

Not used.

Details

The returned plot is what we call a "genotype plot". On the x-axis is the number of "a" reads and on the y-axis is the number of "A" reads, where "a" and "A" are the possible alleles. If available, the observations are colorcoded by estimated genotype (via the maximum a posteriori classifier), their transparency is proportional to the the posterior probability that a point is an outlier, and their size is (possibly) scaled by their maximum posterior probability. The lines are defined by the equation

A / (A + a) = p,

where A is the number of "A" reads, a is the number of "a" reads, and p is the proportion of counts we would expect to observe on average given the genotype of an individual, the sequencing error rate, and the read-mapping bias.

If there is parental data, these are also plotted with crosses and plusses. If the parents have larger counts than the offspring, then (at least when gg = TRUE) the parental counts are scaled until they just reach the plot. The scaled parental counts are labeled on the plot with a semi-transparent "(scaled)".

The second plot is the distribution of outlying points.

The third plot contains the underlying beta densities for the different genotypes.

Value

A plot object.

Author(s)

David Gerard


dcgerard/updogAlpha documentation built on May 14, 2019, 3:10 a.m.