heatPlot {twoddpcr} | R Documentation

## Draw a heat plot of the droplets.

### 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

    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

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

[Package twoddpcr version 1.11.0 Index]