flFitLinear {QurvE}R Documentation

Data fit via a heuristic linear method

Description

Determine maximum slopes from using a heuristic approach similar to the “growth rates made easy”-method of Hall et al. (2013).

Usage

flFitLinear(
  time = NULL,
  growth = NULL,
  fl_data,
  ID = "undefined",
  quota = 0.95,
  control = fl.control(x_type = c("growth", "time"), log.x.lin = FALSE, log.y.lin =
    FALSE, t0 = 0, min.growth = NA, lin.h = NULL, lin.R2 = 0.98, lin.RSD = 0.05, lin.dY =
    0.05, biphasic = FALSE)
)

Arguments

time

Vector of the independent time variable (if x_type = "time" in control object).

growth

Vector of the independent time growth (if x_type = "growth" in control object).

fl_data

Vector of the dependent fluorescence variable.

ID

(Character) The name of the analyzed sample.

quota

(Numeric, between 0 an 1) Define what fraction of max_slope the slope of regression windows adjacent to the window with highest slope should have to be included in the overall linear fit.

control

A fl.control object created with fl.control, defining relevant fitting options.

Value

A gcFitLinear object with parameters of the fit. The lag time is estimated as the intersection between the fit and the horizontal line with y=y_0, where y0 is the first value of the dependent variable. Use plot.gcFitSpline to visualize the linear fit.

raw.x

Filtered x values used for the spline fit.

raw.fl

Filtered fluorescence values used for the spline fit.

filt.x

Filtered x values.

filt.fl

Filtered fluorescence values.

ID

(Character) Identifies the tested sample.

FUN

Linear function used for plotting the tangent at mumax.

fit

lm object; result of the final call of lm to perform the linear regression.

par

List of determined fluorescence parameters:

ndx

Index of data points used for the linear regression.

ndx2

Index of data points used for the linear regression for the second phase.

control

Object of class grofit.control containing list of options passed to the function as control.

rsquared R2

of the linear regression.

rsquared2 R2

of the linear regression for the second phase.

fitFlag

(Logical) Indicates whether linear regression was successfully performed on the data.

fitFlag2

(Logical) Indicates whether a second phase was identified.

reliable

(Logical) Indicates whether the performed fit is reliable (to be set manually).

References

Hall, BG., Acar, H, Nandipati, A and Barlow, M (2014) Growth Rates Made Easy. Mol. Biol. Evol. 31: 232-38, DOI: 10.1093/molbev/mst187

Petzoldt T (2022). growthrates: Estimate Growth Rates from Experimental Data. R package version 0.8.3, https://CRAN.R-project.org/package=growthrates.

Examples

# load example dataset
input <- read_data(data.growth = system.file("lac_promoters_growth.txt", package = "QurvE"),
                   data.fl = system.file("lac_promoters_fluorescence.txt", package = "QurvE"),
                   csvsep = "\t",
                   csvsep.fl = "\t")

# Extract time and normalized fluorescence data for single sample
time <- input$time[4,]
data <- input$norm.fluorescence[4,-(1:3)] # Remove identifier columns

# Perform linear fit
TestFit <- flFitLinear(time = time,
                       fl_data = data,
                       ID = "TestFit",
                       control = fl.control(fit.opt = "l", x_type = "time",
                       lin.R2 = 0.95, lin.RSD = 0.1,
                       lin.h = 20))

plot(TestFit)

[Package QurvE version 1.1.1 Index]