fitModel is the main fitting function which wraps around the others and fit iteratively the whole model.
fitParams fits only the listed parameters and fitParamsSeparately fit gene-specific parameters having the shared parameters (e.g. normalisation factors).
fitNormFactors fits the normalisation factors having fixed all other parameters.

fitParams(pulseData, par, namesToOptimise, options)

fitParamsSeparately(pulseData, par, knownGenePars, namesToOptimise, options,
  indexes = seq_len(dim(pulseData$counts)[1]))

fitNormFactors(pulseData, par, options)

fitModel(pulseData, par, options)

Arguments

pulseData

the PulseData object

par

a list with an initial parameters values. Names correspond to the parameter names used in formulas. size corresponds to the size parameter, normFactors stands for the list with normalistion factors (in spike-in free design, see details). There are following parameter types:

  • gene-specific parameters must be set as vectors of the length equal to the gene number. The function initParameters may simplify the process of initial values randomisation.

  • shared parameters. These are prersented by single numeric values, which are assumed to be equal between all genes, e.g. additional normalisation fator.

  • the size parameter for the negative binomial distribution and a list with the normalisation factors, if no spike-ins are used in the experiment.

  • normalisation factors (in case of spike-in free design).

namesToOptimise

a vector of names of parameters, which values need be optimised

options

a list of options. For more details, see setBoundaries, setTolerance, setFittingOptions

knownGenePars

a vectors of names of the gene-specific parameters, which are assumed to be fixed during optimisation.

indexes

indexes of genes to fit. By default includes all the genes.

Value

a list with fitted parameters (only which were optimized)

Details

If no spike-ins are used, relations between samples are inferred during the model fitting. In this case, the initial parameter list must containg a field named normFactors. The normalistion factors are accepted as a named list, e.g.

par$normFactors <- list(total_fraction = 1,
      pull_down.4 = c(1, 0.01),
      pull_down.8 = c(1, 0.01))

This will define the initial values for the normalisation factors. The very first value is always equal 1 irregardless of the user input. This has to be done because the normalisation factors are known only up to some scaling coefficient, because they appear in a multiplication with the expression level or synthesis rate.

The structure of the normFactors list is identical to the pulseData$interSampleCoeffs. This structure is defined by the formulaIndexes and conditions argumenta in the PulseData, see PulseData for more.

fitParamsSeparately is same as fitParams, but performs optimisation for gene-specific parameters only. Every set of parameters is fitted individually for every gene.