maxLik
uses maximum likelihood to find the logistic and double logistic equations that best describe the shape of the imageJ output data to then fit parameters that describe reistance, tolerance and sensitivity.
maxLik(projectName, clearHalo, diskDiam = 6, maxDist = 30, standardLoc = 2.5, ymax = 125, xplots = 5, height = 8, width = 8, FoG = 20, RAD = "all", needML = TRUE, popUp = TRUE, nameVector = TRUE, overwrite = TRUE, plotParam = TRUE, plotFoG = TRUE, savePDF = TRUE, plotSub = NA, plotCompon = FALSE)
plotRaw
(the red dashed line). To suppress this standardization use standardLoc = FALSE.FoG
= "80" (80% reduction in growth), FoG
= "50" (50% reduction in growth), and FoG
= "20" (20% reduction in growth) are supported. Note, the critical level for FoG can be different than that chosen for RAD.RAD
= "80" (80% reduction in growth), RAD
= "50" (50% reduction in growth), RAD
= "20" (20% reduction in growth), and RAD
= "all" are supported.maxLik
has already been run in this session then needML can be set to FALSE, which allows the user to replot the results without the need to rerun the time consuming maximum likelihood models. Defaults to TRUE.plotFoG
= "TRUE" or the components of the logistic equation plotCompon
= "TRUE". Defaults to TRUE.plotRaw
. Defaults to NA, which will plot data from all photographs. Note this does not affect the analysis component, all data is always analyzed.clearHalo
is extremely important to determine tolerance, as the intensity beside the disk for the chosen photograph is subtracted for all photographs. Choosing the photograph to be used for this purpose is the only subjective aspect of this pipeline; lighting and camera settings will determine the degre to which the hue of the plate backbground changes among different photographs. Care should be taken to ensure that plate background will be as similar as possible among different plates. Photographs are numbered alphabetically by name, and can also be found using plotRaw
, showNum = TRUE. In many experiments a suitable strain will already be included, however a good practice is to always take a photograph of a blank plate with just the disk in the center to use for this purpose (and save it with a name like "a" so that it is always the first photograph in the list (i.e., `clearHalo = 1`). The (non)results from this photograph can be later removed in the function `createDataframe()`.maxLik()
(e.g., computer is shut down) as long as R remains open it should resume where it left off when the computer is reactivated.maxLik
searches for the maximum likelihood (ML) parameter for a single logistic and double logistic equation using the pixel intensity information previously determined from IJMacro
. The equations fit are
single logistic ('ML'):
y = asymA*exp(scalA(x-od50A))\(1+exp(scalA(x-od50A)))+N(0, sigma)
double logistic ('ML2'):
y = asymA*exp(scalA(x-od50A))\(1+exp(scalA(x-od50A)))+asymB*exp(scalB(x-od50B)))\(1+exp(scalB(x-od50B)))+N(0, sigma)
where asymA and asymB are the two asymptotes, od50A and odB are the midpoints (of the two curves), scalA and scalB are the slopes at odA and odB divided by asymA/4 and asymB/4, respectively. Specifically, maxLik
uses thesubplex
method of optim
, as implemented in find.mle
. The single logistic is the essentially the same as the double, yet fits only a single asymptote, midpoint and slope. The results from the double logistic fit are used in createDataframe
to find the resistance points as well as to fit the area under the curve and thus tolerance, the single logistic is used to determine the midpoint of the curve which is later used to find sensitivity, i.e., the slope at this midpoint.
saveMLParam
to save the parameter estimates for asym, od50, scal and sigma, as well as the log likelihood of the single and double logistic models.
## Not run:
# maxLik("myProject", clearHalo=1)
# maxLik("myProject", clearHalo=1, xplots = 2, height = 4, width = 6, needML = FALSE)
# ## End(Not run)
Run the code above in your browser using DataLab