ratioFitFromDf {CalciOMatic}R Documentation

Perform a Ratiometric Fit from a "fluo_rawdata" object

Description

The function ratioFitFromDf performs a fit on an intracellular calcium concentration transient obtained from a "fluo_rawdata", after ratiometric transformation. The transient is fitted with a mono- or a biexponential decay, depending on the value of type

Usage

ratioFitFromDf(df, transients = 1, type = "mono",ig = NULL,
               Plot = FALSE, Fit = TRUE, AfterPeak = FALSE)

Arguments

df a data frame of class "fluo_rawdata" containing all relevant information (fluorescence transients, background fluorescence, calibration parameters and exposure times). The structure of the input data frame must be the same as the one defined in ratioExpSimul
transients a vector of integers giving the numbers of the transients to fit
type a character string (either "mono" or "bi"), specifying the type of calcium exponential decay to consider
ig an object of class "initial_guess", giving values of the calcium dynamics parameters to initiate the fitting process with using nls. This is a list including the following fields: ("log_Ca0", "log_dCa", "log_tau" for a monoexponential decay, eventually "mu" and "log_dtau" for a biexponential decay). If ig is not an object of class "initial_guess", initial guesses are estimated using the "igRatio" function
Plot a logical value. Set to TRUE to plot the original signals, the initial guess and the fit results
Fit a logical value. Set to TRUE to perform the fit, or to FALSE to compute an initial guess only
AfterPeak a logical or numerical value. Set to FALSE to perform the fit on the whole fluorescence transients, to TRUE to consider only the part before the fluorescence jump and the convex part after the fluorescence peak (for both signals), or to an integer to skip a given number of samples after the fluorescence jump

Details

The calcium concentration (Ca^2+) is deduced from the ratiometric transformation (see caFromRatio). A mono- or bi-exponential decay is fitted to the Ca^2+ signal, using the optim function. For more details, see ratioFitFromCa.

Value

An object that inherits from both "nls" and either "ratio_fit" or "ratio_fit_list" classes, depending whether transients is a single value or a vector. In the latter case, the output "ratio_fit_list" object is a list of "ratio_fit" objects, which have the following attributes:

"Name" a character string telling which type of fit has been performed
"Time" the whole time vector (in s)
"RawData" the Ca^2+ signal deduced from the ratiometric transformation. This signal, which is the one passed to the nls formula, has two attributes: "var" is the vector of variances estimated from the error propagation method, and "Time" is the vector of latencies at which fluorescence measurements were performed
"RawDataFrame" a copy of the input data frame
"FitFunction" the function passed to the nls formula
"Subset" the indices of the Time vector used for the fit

Author(s)

Sebastien Joucla sebastien.joucla@parisdescartes.fr

See Also

transientConvexPart, caFromDf, igRatio, ratioFitFromCa

Examples

## Load the data from cockroach olfactory interneurons
data(inVitro)

## Calibrated parameters
R_min <- list(value=0.136, mean=0.136, se=0.00363, USE_se=TRUE)
R_max <- list(value=2.701, mean=2.701, se=0.151,   USE_se=TRUE)
K_eff <- list(value=3.637, mean=3.637, se=0.729,   USE_se=TRUE)
K_d   <- list(value=0.583, mean=0.583, se=0.123,   USE_se=TRUE)

## Create the data frame containing the physiological data
## (experiment #2, stimulation #2)
## G and s_ro are the respectively the gain of the CCD camera
## and the standard deviation of its read-out process
physioData <- ratioExpPhysio(dataset="inVitro",
                             expe=2, stim=2,
                             idxOn=10,
                             R_min=R_min, R_max=R_max,
                             K_eff=K_eff, K_d=K_d,
                             G=0.146, s_ro=16.4,
                             alphamethod=FALSE)

## Perform a ratiometric fit
physioRatioFit <- ratioFitFromDf(df = physioData,
                                 transients = 2,
                                 AfterPeak = 14)

## Print the class of 'physioRatioFit'
print(class(physioRatioFit))

## Create the data frame containing the physiological data
## (experiment #2, stimulation #2)
## G and s_ro are the respectively the gain of the CCD camera
## and the standard deviation of its read-out process
physioData <- ratioExpPhysio(dataset="inVitro",
                             expe=2, stim=c(2,3),
                             idxOn=10,
                             R_min=R_min, R_max=R_max,
                             K_eff=K_eff, K_d=K_d,
                             G=0.146, s_ro=16.4,
                             alphamethod=FALSE)

## Perform a ratiometric fit
physioRatioFit <- ratioFitFromDf(df = physioData,
                                 transients = c(2,3),
                                 AfterPeak = 14)

## Print the class of 'physioRatioFit'
print(class(physioRatioFit[[2]]))

[Package CalciOMatic version 1.1-3 Index]