plateClassification {twoddpcr} | R Documentation |
Retrieve multiple classification factors that have been assigned to
a ddpcrPlate
object.
plateClassification( theObject, cMethod = NULL, withAmplitudes = FALSE, wellCol = FALSE ) ## S4 method for signature 'ddpcrPlate' plateClassification( theObject, cMethod = NULL, withAmplitudes = FALSE, wellCol = FALSE ) plateClassification(theObject, cMethod) <- value ## S4 replacement method for signature 'ddpcrPlate,character,list' plateClassification(theObject, cMethod) <- value ## S4 replacement method for signature 'ddpcrPlate,character,factor' plateClassification(theObject, cMethod) <- value
theObject |
A |
cMethod |
This is the name of the classification to retrieve and should
be a character vector. If |
withAmplitudes |
If |
wellCol |
If |
value |
Either:
|
If requesting one classification without the amplitudes, a list of factors corresponding to the classifications is returned. Otherwise, a list of data frames is returned where each row corresponds to a droplet in the corresponding well.
Anthony Chiu, anthony.chiu@cruk.manchester.ac.uk
### The examples here show how this method works by setting classifications ### using data frames. To do this, we use the ### \code{\link{thresholdClassify}} method on _data frames_. Note that ### \code{thresholdClassify} also works directly on \code{ddpcrWell} and ### \code{ddpcrPlate} objects; this is simply an illustration of ### how to use the \code{plateClassification} method directly. In general, ### it is recommended to use \code{thresholdClassify} directly on ### \code{ddpcrPlate} objects. ## Create a ddpcrPlate object. krasPlate <- ddpcrPlate(wells=KRASdata) ## Classify a data frame of droplets and keep it in a _single_ data frame. ## Set the new classification from this. droplets <- do.call(rbind, amplitudes(krasPlate)) clSingle <- thresholdClassify(droplets, ch1Threshold=7000, ch2Threshold=3500, fullTable=FALSE) plateClassification(krasPlate, "thresholdSing") <- clSingle ## We can also set the new classification from a list of factors. clList <- lapply(KRASdata, thresholdClassify, ch1Threshold=7000, ch2Threshold=3500, fullTable=FALSE) plateClassification(krasPlate, "thresholdList") <- clList ## We can get all of the classifications as a list of data frames. plate <- plateClassification(krasPlate) lapply(plate, head, n=1) ## We can include the droplet amplitudes columns. plate <- plateClassification(krasPlate, withAmplitudes=TRUE) lapply(plate, head, n=1) ## We can focus on specific classifications. plate <- plateClassification(krasPlate, cMethod=c("thresholdSing", "thresholdList")) lapply(plate, head, n=1) ## The wellCol option adds an extra column showing which well the droplet ## came from. plate <- plateClassification(krasPlate, withAmplitudes=TRUE, wellCol=TRUE) lapply(plate, head, n=1)