makeFitness2: Generate QFA fitness

View source: R/FitnessEstimation.R

makeFitness2R Documentation

Generate QFA fitness

Description

This function generates a variety of informative fitnesses from the model parameters of the model used in qfa.fit2. Namely K, r, g & v for generalised and standard logistic model (with v = 1 for standard logisitc) or K, r and b for the Gompertz model. It takes a data frame as generated by the qfa.fit2 function and appends columns for Maximum Doubling Rate (MDR), Maximum Doubling Potential (MDP), Addinall et al. style fitness (MDRMDP), Doubling Time (DT) and Area Under Curve (AUC). Note that this model-based AUC is distinct from the model-free nAUC which is generated directly from observed data by the qfa.fit2 function. The two versions of AUC should be very similar in the vast majority of cases, however. Also, for MDR and MDP estimation of the Gompertz model, a g parameter (lower asymptote, starting growth value) is estimated from the Gompertz model parameters. Additionally, the user can indicate if qfaFitnessPlot should directly be called with all the same parameters specified in the help page of qfaFitnessPlot with changes to the parameter plotFitness of makeFitness2. Please refer to the help page of qfaFitnessPlot for details.

Usage

makeFitness2(
  results,
  AUCLim = NA,
  dtmax = Inf,
  plotFitness = "no",
  filename = NA,
  plotX = "ORF",
  plotFacet = "ScreenID",
  plotFill = "Treatment"
)

Arguments

results

data.frame. This is the output of qfa.fit2 containing model parameter estimations to compute fitness measurements from

dtmax

Numeric. Indicates max possible doubling time (DT). If a DT higher than dtmax is calculated, it will be set to dtmax. This is implemented as infinte DT would be estimated for dead culture spots.

plotFitness

String. Indicating if fitness boxplots should be produced. Default set to "no". Either set to "All" to plot all three types of fitness measurements if the Gompertz model was used, otherwise only MDR-based and modelfree fitness estimates are plotted. If set to "MDR" only MDR*MDP based fitness estimates are displayed. If set to "Gmp" only Gompertz model based fitness estimates are displayed. If set to "ModelFree" only model free fitness estimates are displayed.

filename

If this is anything else than NA, a pdf file will be saved into the current working directory named filename

plotX

String. Name of the column of the results data.frame used as a factor seperating boxplots on the x-axis

plotFill

String. Name of the column of the results data.frame used as a factor coloring the boxplots

AUClim

Numeric. Indicates the max time until which the AUC should be calculated. If set to NA (default), the max time within the initial data.frame used to generate the results data.frame is used

plotoFacet

String. Name of the column of the results data.frame used as a factor creaeting facets

Value

data.frame. The output data.frame contains the same information as the input data.frame with added fitness estimates for MDR, MDP, MDP*MDP based fitness estimates, DT and AUC.

Examples

data(qfa.testdata)
#Strip non-experimental edge cultures
qfa.testdata = qfa.testdata[(qfa.testdata$Row!=1) & (qfa.testdata$Col!=1) & (qfa.testdata$Row!=8) & (qfa.testdata$Col!=12),]
# Define which measure of cell density to use
qfa.testdata$Growth = qfa.testdata$Intensity
GmpFit = qfa.fit2(qfa.testdata, inocguess=NULL, detectThresh=0, globalOpt=F, AUCLim=NA, TimeFormat="h", Model="Gmp")
# Construct fitness measures
GmpFit = makeFitness2(GmpFit, AUCLim=NA, plotFitness="All", filename="Example_Gmp_fitness.pdf")
# Create plot
qfa.plot2("Example_Gmp_GrowthCurves.pdf", GmpFit, qfa.testdata, maxt=30)

JulBaer/baQFA documentation built on Feb. 19, 2023, 10:32 p.m.