Description Usage Arguments Value Author(s) Examples
Plot an object comprising droplet amplitudes and their classification. If specified, centres of clusters can be marked, e.g. k-means clustering can take a set of centres as the initial centres of the algorithm, and the algorithm also outputs the final cluster centres. Limits to the axes can also be set for ease of comparison and consistency.
If a ggplot
object is given as a parameter, this method will simply
plot it with the pretty colours, centres and restrictions on the axes.
If a data.frame
is given as a parameter, it should
correspond to droplets with their classification.
If a ddpcrWell
object is given as a parameter, plot the
droplets in the well with its classification.
If a ddpcrPlate
object is given as a parameter, plot the
droplets from all wells with their classifications.
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 43 44 45 46 47 48 49 50 51 | dropletPlot(
droplets,
ch1Label = "Ch1 Amplitude",
ch2Label = "Ch2 Amplitude",
...
)
## S4 method for signature 'data.frame'
dropletPlot(
droplets,
ch1Label = "Ch1 Amplitude",
ch2Label = "Ch2 Amplitude",
cMethod = "None",
mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
finalCentres = NULL,
initialCentres = NULL,
selectedCentre = NULL,
pointSize = 1,
plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
legendLabels = ddpcr$classesRain
)
## S4 method for signature 'ddpcrWell'
dropletPlot(
droplets,
ch1Label = "Ch1 Amplitude",
ch2Label = "Ch2 Amplitude",
cMethod = "None",
mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
finalCentres = NULL,
initialCentres = NULL,
selectedCentre = NULL,
pointSize = 1,
plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
legendLabels = ddpcr$classesRain
)
## S4 method for signature 'ddpcrPlate'
dropletPlot(
droplets,
ch1Label = "Ch1 Amplitude",
ch2Label = "Ch2 Amplitude",
cMethod = "None",
mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
finalCentres = NULL,
initialCentres = NULL,
selectedCentre = NULL,
pointSize = 1,
plotLimits = list(x = c(1000, 9000), y = c(3000, 13500)),
legendLabels = ddpcr$classesRain
)
|
droplets |
An object corresponding to droplet amplitudes and their classifications. This can be in the form of:
|
ch1Label |
The label for the channel 1 target. Defaults to "Ch1 Amplitude". |
ch2Label |
The label for the channel 2 target. Defaults to "Ch2 Amplitude". |
... |
Other plotting parameters that depend on the object type of
|
cMethod |
This should be the name or column number of |
mapping |
A list of aesthetic mappings to use for the plot. Defaults to
|
finalCentres |
A data frmae of final centres to plot (e.g. those
returned by the k-means or c-means algorithms). If |
initialCentres |
A data frame of initial centres to plot (e.g. initial
cluster centres used in the k-means). If |
selectedCentre |
An initial centre to highlight. This should be either
"NN", "NP", "PN" or "PP". If |
pointSize |
The size to draw each droplet. Defaults to 1. |
plotLimits |
A list of 2-element vectors with names |
legendLabels |
The character vector corresponding to the labels for the
legend. The elements of the vector should correspond to the NN, NP, PN, PP,
Rain and N/A classes, respectively. Defaults to |
A ggplot
object with all of the given information above.
Anthony Chiu, anthony.chiu@cruk.manchester.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Get a data frame and relabel the "Cluster" column to the right form.
aWell <- KRASdata[["E03"]]
aWell$Cluster <- relabelClasses(aWell, classCol="Cluster")
## Plot the data frame.
dropletPlot(aWell, cMethod="Cluster")
## Plot a ddpcrWell object.
aWell <- ddpcrWell(well=KRASdata[["E03"]])
dropletPlot(aWell, cMethod="Cluster")
## Plot a ddpcrPlate object.
krasPlate <- ddpcrPlate(wells=KRASdata[c("E03", "H03", "C04", "F04")])
dropletPlot(krasPlate, cMethod="Cluster")
## Use K-means clustering to classify a single sample. Then plot the
## classification and final cluster centres.
aWell <- kmeansClassify(aWell)
centres <- clusterCentres(aWell, cMethod="kmeans")
dropletPlot(aWell, cMethod="kmeans", finalCentres=centres)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.