Skip to contents

Fit the standard mass action kinetics model of gene expression using a linear model after log-transforming the observed values (i.e. assuming gaussian homoscedastic errors of the logarithmized values) for the given gene. The fit takes only old RNA into account and requires proper normalization, but can be performed without assuming steady state for the degradation rate. The parameters are fit per Condition.

Usage

FitKineticsGeneLogSpaceLinear(
  data,
  gene,
  slot = DefaultSlot(data),
  time = Design$dur.4sU,
  CI.size = 0.95
)

Arguments

data

A grandR object

gene

The gene for which to fit the model

slot

The data slot to take expression values from

time

The column in the column annotation table representing the labeling duration

CI.size

A number between 0 and 1 representing the size of the confidence interval

Value

A named list containing the model fit:

  • data: a data frame containing the observed value used for fitting

  • Synthesis: the synthesis rate (in U/h, where U is the unit of the slot)

  • Degradation: the degradation rate (in 1/h)

  • Half-life: the RNA half-life (in h, always equal to log(2)/degradation-rate

  • conf.lower: a vector containing the lower confidence bounds for Synthesis, Degradation and Half-life

  • conf.upper: a vector containing the lower confidence bounds for Synthesis, Degradation and Half-life

  • f0: The abundance at time 0 (in U)

  • logLik: the log likelihood of the model

  • rmse: the total root mean square error

  • adj.r.squared: adjusted R^2 of the linear model fit

  • total: the total sum of all new and old RNA values used for fitting

  • type: always "lm"

If Condition(data) is not NULL, the return value is a named list (named according to the levels of Condition(data)), each element containing such a structure.

Details

The start of labeling for all samples should be the same experimental time point. The fit gets more precise with multiple samples from multiple labeling durations. Also a sample without 4sU (representing time 0) is useful.

The standard mass action kinetics model of gene expression arises from the following differential equation:

$$df/dt = s - d f(t)$$

This model assumes constant synthesis and degradation rates (but not necessarily that the system is in steady state at time 0). From the solution of this differential equation, it is straight forward to derive the expected abundance of old and new RNA at time t for given parameters s (synthesis rate), d (degradation rate) and f0=f(0) (the abundance at time 0). These equations are implemented in f.old.equi (old RNA assuming steady state gene expression, i.e. f0=s/d), f.old.nonequi (old RNA without assuming steady state gene expression) and f.new (new RNA; whether or not it is steady state does not matter).

This function primarily finds d such that the squared error between the observed values of old and new RNA and their corresponding functions is minimized in log space. For that to work, data has to be properly normalized, but this is independent on any steady state assumptions. The synthesis rate is computed (under the assumption of steady state) as \(s=f0 \cdot d\)

Examples

sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
                  design=c("Condition",Design$dur.4sU,Design$Replicate))
#> Warning: Duplicate gene symbols (n=1, e.g. MATR3) present, making unique!
sars <- Normalize(sars)
FitKineticsGeneLogSpaceLinear(sars,"SRSF6")   # fit per condition
#> $Mock
#> $Mock$data
#>           Name Condition Replicate duration.4sU duration.4sU.original no4sU
#> 1 Mock.no4sU.A      Mock         A            0                 no4sU  TRUE
#> 2    Mock.1h.A      Mock         A            1                    1h FALSE
#> 3    Mock.2h.A      Mock         A            2                    2h FALSE
#> 4    Mock.2h.B      Mock         B            2                    2h FALSE
#> 5    Mock.3h.A      Mock         A            3                    3h FALSE
#> 6    Mock.4h.A      Mock         A            4                    4h FALSE
#>       Value  use time Type
#> 1 1352.9261 TRUE    0  Old
#> 2  949.1078 TRUE    1  Old
#> 3  694.7509 TRUE    2  Old
#> 4  814.7388 TRUE    2  Old
#> 5  546.2433 TRUE    3  Old
#> 6  328.4560 TRUE    4  Old
#> 
#> $Mock$Synthesis
#> [1] 474.0747
#> 
#> $Mock$Degradation
#> [1] 0.3383702
#> 
#> $Mock$`Half-life`
#> [1] 2.048488
#> 
#> $Mock$conf.lower
#>   Synthesis Degradation   Half-life 
#> 387.3778798   0.2535282   1.6378245 
#> 
#> $Mock$conf.upper
#>   Synthesis Degradation   Half-life 
#> 580.1746097   0.4232121   2.7340039 
#> 
#> $Mock$f0
#> [1] 1401.053
#> 
#> $Mock$logLik
#> 'log Lik.' 6.723828 (df=3)
#> 
#> $Mock$rmse
#> [1] 0.0788998
#> 
#> $Mock$adj.r.squared
#> [1] 0.96051
#> 
#> $Mock$total
#> [1] 4686.223
#> 
#> $Mock$type
#> [1] "lm"
#> 
#> 
#> $SARS
#> $SARS$data
#>           Name Condition Replicate duration.4sU duration.4sU.original no4sU
#> 1 SARS.no4sU.A      SARS         A            0                 no4sU  TRUE
#> 2    SARS.1h.A      SARS         A            1                    1h FALSE
#> 3    SARS.2h.A      SARS         A            2                    2h FALSE
#> 4    SARS.2h.B      SARS         B            2                    2h FALSE
#> 5    SARS.3h.A      SARS         A            3                    3h FALSE
#> 6    SARS.4h.A      SARS         A            4                    4h FALSE
#>       Value  use time Type
#> 1 2277.5191 TRUE    0  Old
#> 2 1114.9400 TRUE    1  Old
#> 3  398.9634 TRUE    2  Old
#> 4  532.4308 TRUE    2  Old
#> 5  240.0072 TRUE    3  Old
#> 6  111.2108 TRUE    4  Old
#> 
#> $SARS$Synthesis
#> [1] 1699.592
#> 
#> $SARS$Degradation
#> [1] 0.7574716
#> 
#> $SARS$`Half-life`
#> [1] 0.9150801
#> 
#> $SARS$conf.lower
#>    Synthesis  Degradation    Half-life 
#> 1325.8739025    0.6531578    0.8043153 
#> 
#> $SARS$conf.upper
#>    Synthesis  Degradation    Half-life 
#> 2178.6481814    0.8617854    1.0612246 
#> 
#> $SARS$f0
#> [1] 2243.77
#> 
#> $SARS$logLik
#> 'log Lik.' 5.48415 (df=3)
#> 
#> $SARS$rmse
#> [1] 0.09700784
#> 
#> $SARS$adj.r.squared
#> [1] 0.9878188
#> 
#> $SARS$total
#> [1] 4675.071
#> 
#> $SARS$type
#> [1] "lm"
#> 
#>