Description Usage Arguments Details Value Examples
calculateProxy
will calculate a proxy for each sample, providing a single number which encapsulates lifespan.
plotProxy
will create a plot showing how the proxy is calculated for a specified sample.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
CFUsMLE |
A |
maxTime |
The maximum time. Proxy solutions will be searched for in the interval between |
viability |
The proportion of viable cells. See 'Details'. Defaults to |
constraint |
The constraint used when fitting a spline to CFU data. Must be one of |
... |
Additional arguments passed to |
Sample |
Length 1 character vector specifying which sample to plot. |
Proxies are calculated as the square root of the amount of time take for a sample to reach a specified viability.
This is achieved by fitting a median spline (see cobs
) to the CFU data.
Specifically, CFUsMLE$Time
is fitted against log10(CFUsMLE$ColonyFormingUnitsPerDroplet + 1)
.
The proxy is the square root of the amount of time taken for the fitted values to reach the indicated viability.
In the case that no solutions are found within the specified time interval, the proxy is set as NA
.
In the case that multiple solutions are found, the proxy is set as the first solution.
calculateProxy
will return a data.frame
containing the proxy for each sample.
plotProxy
will return a ggplot
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #Get a data.frame showing maximum likelihood estimation as produced by analyseColonyVectors
CFUsMLE <- system.file("extdata", "CFUsMLE.csv", package="DeadOrAlive")
CFUsMLE <- read.csv(CFUsMLE)
#Remove low quality data points
CFUsMLE <- CFUsMLE[CFUsMLE$TotalExclusions<=1,]
#Plot proxy calculation for the wt (972 h-)
g1 <- plotProxy(CFUsMLE, "972 h-")
print(g1)
#Calculate a proxy for all samples
proxy <- calculateProxy(CFUsMLE)
#Add proxies to CFUsMLE
CFUsMLE$Proxy <- proxy$Proxy[match(CFUsMLE$Sample, proxy$Sample)]
#Plot all lifespan curves and color by proxy
require(ggplot2)
g2 <- g2 <- ggplot(CFUsMLE, aes(Time, ColonyFormingUnitsPerDroplet + 1, group=Sample, color=Proxy))
g2 <- g2 + geom_point() + geom_line()
g2 <- g2 + scale_y_log10() + xlab("Time / days") + ylab("CFUs / droplet + 1")
print(g2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.