Description Usage Arguments Value Author(s) Examples
Assume that each of the classified clusters are bivariate normally distributed. We add fuzziness to the classifications by assigning droplets far away from the centres as "Rain". We use the Mahalanobis distance for each cluster to determine whether a droplet is 'too far away'.
1 2 3 4 5 6 7 8 9 10 | mahalanobisRain(droplets, cMethod, maxDistances = 30, ...)
## S4 method for signature 'data.frame'
mahalanobisRain(droplets, cMethod, maxDistances = 30, fullTable = TRUE)
## S4 method for signature 'ddpcrWell'
mahalanobisRain(droplets, cMethod, maxDistances = 30)
## S4 method for signature 'ddpcrPlate'
mahalanobisRain(droplets, cMethod, maxDistances = 30)
|
droplets |
A |
cMethod |
The name or column number of the classification for which we want to add rain to. |
maxDistances |
A list of (levels) with keys in |
... |
Other options depending on the type of |
fullTable |
If |
An object where the specified class has "Rain" entries added.
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 21 22 23 24 25 26 27 28 29 30 31 | ## Take a data frame of droplets of transform it into the rigth format.
droplets <- KRASdata[["E03"]]
droplets$Cluster <- relabelClasses(droplets, classCol="Cluster")
## Add rain as a new column.
droplets$ClusterMahRain <-
mahalanobisRain(droplets, cMethod="Cluster", fullTable=FALSE)
table(droplets$ClusterMahRain)
## The maximum distance around each mean can be changed uniformly.
droplets$ClusterMahRain <-
mahalanobisRain(droplets, cMethod="Cluster", maxDistances=35,
fullTable=FALSE)
table(droplets$ClusterMahRain)
## Or we can change the maximum distances for each individual cluster.
droplets$ClusterMahRain <-
mahalanobisRain(droplets, cMethod="Cluster",
maxDistances=list(NN=35, NP=30, PN=30, PP=30),
fullTable=FALSE)
table(droplets$ClusterMahRain)
# This method works the same for ddpcrWell objects.
aWell <- ddpcrWell(well=KRASdata[["E03"]])
aWell <- mahalanobisRain(aWell, cMethod="Cluster")
table(wellClassification(aWell, cMethod="ClusterMahRain"))
# Likewise for ddpcrPlate objects.
krasPlate <- ddpcrPlate(wells=KRASdata[c("E03", "H03", "C04", "F04")])
krasPlate <- mahalanobisRain(krasPlate, cMethod="Cluster")
lapply(plateClassification(krasPlate, cMethod="ClusterMahRain"), table)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.