heatPlot: Draw a heat plot of the droplets.

Description Usage Arguments Value Author(s) References Examples

View source: R/heatPlot.R

Description

Using alpha transparency only, it is generally difficult to see where droplets are truly distributed and concentrated. A heat (density) plot gives a better illustration of this.

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
35
36
37
38
39
40
41
42
heatPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  binwidth = 100,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500))
)

heatPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  binwidth = 100,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500))
)

## S4 method for signature 'data.frame'
heatPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  binwidth = 100,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500))
)

## S4 method for signature 'ddpcrWell'
heatPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  binwidth = 100,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500))
)

## S4 method for signature 'ddpcrPlate'
heatPlot(
  droplets,
  ch1Label = "Ch1 Amplitude",
  ch2Label = "Ch2 Amplitude",
  binwidth = 100,
  plotLimits = list(x = c(1000, 9000), y = c(3000, 13500))
)

Arguments

droplets

A data frame of droplet amplitudes, a ggplot, ddpcrWell or ddpcrPlate object.

ch1Label

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

ch2Label

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

binwidth

The width of each hexagonal bin in the 2d heat (density) plot. Defaults to 100.

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)).

Value

A heat plot 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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Density plot of a data frame.
heatPlot(KRASdata[["E03"]])

## Density plot of a ddpcrWell object.
aWell <- ddpcrWell(well=KRASdata[["E03"]])
heatPlot(aWell)

## Density plot of a ddpcrPlate object with an adjusted bin size.
krasPlate <- ddpcrPlate(wells=KRASdata)
heatPlot(krasPlate, binwidth=50)

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