Description Usage Arguments Value Examples
View source: R/Maximum_Likelihood_Estimation.R
analyseColonyVectors
analyses the colony patterns extracted using the extractColonyVectors
function in order to estimate the number of colony forming units per droplet from the original liquid culture.
This is done by performing a maximum likelihood estimation on the pattern using Brent optimisation (see optim
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | analyseColonyVectors(
colonyVectors,
tolerance = 0.001,
dilution = 3,
initialDilution = 1,
minCellsPerDroplet = 0.001,
maxCellsPerDroplet = NULL,
CIprob = 0.95,
save.table = T,
table.name = "CFUsMLE.csv",
save.markdown = T,
markdown.name = "CFUsMLE.html",
save.directory = getwd()
)
|
colonyVectors |
An object of class |
tolerance |
The minimum probability of observing data at each dilution factor to be considered acceptable. If the probability of observing the data at any of the dilution factors falls below this value, the pattern will be considered anomalous. In this case, an algorithm will re-attempt the maximum likelihood estimation with excluded data points, until a suitable solution is found. Any data points which are removed are shown in the output table and markdown files. |
dilution |
The dilution factor used in the the experiment. Defaults to |
initialDilution |
The initial dilution factor. Defaults to |
minCellsPerDroplet |
The minimum number of viable cells per droplet to test in the optimisation. Defaults to |
maxCellsPerDroplet |
The maximum number of viable cells per droplet to test in the optimisation. In the default case ( |
CIprob |
The probabilty of the confidence intervals to be returned. Defaults to |
save.table |
Should a csv file of the results be saved. Defaults to |
table.name |
Name of the csv file. |
save.markdown |
Should a markdown (html) document showing the results of the maximum likelihood estimation be saved. Defaults to |
markdown.name |
Name of the markdown file. |
save.directory |
Directory to save the csv and markdown file. Defaults to the current working directory. |
analyseColonyVectors
returns a data.frame
containing the results of the maximum likelihood estimation for each sample at each time.
The table contains the following columns:
Sample |
The sample name. |
Time |
The time in days. |
ColonyFormingUnitsPerDroplet |
The maximum likelihood estimation of the number of viable cells per droplet. |
Likelihood |
The value of the maximum likelihood (i.e. the probability of observing the pattern provided in the case that the maximum likelihood estimation is correct). |
LowerCI |
The lower confidence interval for the estimation of viable cells per droplet. |
UpperCI |
The upper confidence interval for the estimation of viable cells per droplet. |
GridSize |
The size of the grid (i.e. the number of grid positions for each dilution factor). |
ExcludedWellPositions |
Any well positions which were excluded. This is as a result of an attempted optimisation not passing the |
ExcludedGridPositions |
Any grid positions which were excluded. This is as a result of an attempted optimisation not passing the |
TotalExclusions |
The total number of excluded well and grid positions. |
In addition, a csv file containing this data and a markdown (html) report showing the maximum likelihood optimisation for each colony pattern are saved by default.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #Get a csv file showing the identity of each plate to be analysed
plateReferenceFile <- system.file("extdata", "plateReferenceFile.csv", package="DeadOrAlive")
#Get a csv file showing the identity of each sample on each plate
sampleReferenceFile <- system.file("extdata", "sampleReferenceFile.csv", package="DeadOrAlive")
#Get the directory of files to be analysed
dir <- system.file("extdata", "Image_Analysis", package="DeadOrAlive")
#Get the patterns of colonies from the files (from left to right across the plate)
myColonyVectors <- extractColonyVectors(dir=dir, plateReferenceFile, sampleReferenceFile)
#Perform a maximum likelihood estimation of the number of viable cells
#Note: This will save a csv and markdown file in the current working directory
## Not run:
CFUsMLE <- analyseColonyVectors(myColonyVectors)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.