facetPlot: Draw each of the individual wells in a ddPCR experiment.

Description Usage Arguments Value Author(s) References See Also Examples

Description

Plot each of the wells in a ddpcrPlate object or a large data frame of droplets. By default, a density plot is returned for speed purposes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
facetPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  cMethod = NULL,
  binwidth = 100,
  pointSize = 0.1,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
  showEmptyWells = FALSE
)

## S4 method for signature 'data.frame'
facetPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  cMethod = NULL,
  binwidth = 100,
  pointSize = 0.1,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
  showEmptyWells = FALSE
)

## S4 method for signature 'ddpcrPlate'
facetPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  cMethod = NULL,
  binwidth = 100,
  pointSize = 0.1,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
  showEmptyWells = FALSE
)

Arguments

droplets

A ddpcrPlate object or a data frame of droplet amplitudes with a "Well" column.

ch1Label

The label for the channel 1 target. Defaults to "Ch1 Amplitude".

ch2Label

The label for the channel 2 target. Defaults to "Ch2 Amplitude".

cMethod

This should be the name or column number of droplets corresponding to the classification to be plotted. This column should only have entries in "NN", "PN", "NP, "PP", "Rain" and "N/A". If "None", plots the droplets with all of them classified as N/A. If NULL, a density plot is plotted. Defaults to NULL.

binwidth

The width of each hexagonal bin in the density plot. Ignored if cMethod is not NULL (see pointSize instead). Defaults to 100.

pointSize

If cMethod is not NULL, this is the size to draw each droplet. Otherwise this parameter is ignored (see binwidth instead). Defaults to 0.1.

plotLimits

A list of 2-element vectors with names x and y. These are used to fix the x and y limits of the plot, which is especially useful for comparing plots. Defaults to list(x=c(1000, 9000), y=c(3000, 13500)).

showEmptyWells

If TRUE, plots a facet_grid of all the wells in the plate, including the empty ones. If FALSE, plots a facet_wrap of only the loaded (nonempty) wells. Defaults to FALSE.

Value

A collection of plots as a ggplot object.

Author(s)

Anthony Chiu, anthony.chiu@cruk.manchester.ac.uk

References

The nice log-scaled palette was achieved using http://www.everydayanalytics.ca/2014/09/5-ways-to-do-2d-histograms-in-r.html

See Also

By default, each subplot uses the same plotting style as heatPlot.

Examples

1
2
3
## Plot a facet wrap of density plots of each well.
krasPlate <- ddpcrPlate(wells=KRASdata)
facetPlot(krasPlate)

twoddpcr documentation built on Nov. 8, 2020, 5:49 p.m.