fitSigmoidGene: Fit a sigmoidal model to a single gene

View source: R/srcImpulseDE2_fitSigmoid.R

fitSigmoidGeneR Documentation

Fit a sigmoidal model to a single gene

Description

[Model fitting function hierarchy: 2 out of 3] This secondary fitting wrapper calls the optimisation wrappers for the individual fitting operations to be performed on the observations of this gene. Structure of this function:

  • Fit sigmoidal model

    • Initialise sigmoidal model parameters (up and down)

    • Fit sigmoidal model (up initialisation)

    • Fit sigmoidal model (down initialisation)

  • Select best sigmoidal model fit from initialisations,

Usage

fitSigmoidGene(vecCounts, scaDisp, vecSizeFactors, vecTimepointsUnique,
  vecidxTimepoint, lsvecidxBatch, MAXIT = 1000)

Arguments

vecCounts

(numeric vector number of samples) Read count data.

scaDisp

(scalar) Gene-wise negative binomial dispersion hyper-parameter.

vecSizeFactors

(numeric vector number of samples) Model scaling factors for each sample which take sequencing depth into account (size factors).

vecTimepointsUnique

(numeric vector length number of unique timepoints) Vector of unique time coordinates observed in this condition.

vecidxTimepoint

(idx vector length number of samples) Index of the time coordinates of each sample (reference is vecTimepointsUnique).

lsvecidxBatch

(idx list length number of confounding variables) List of vectors. One vector per confounding variable. Each vector has one entry per sample with the index of the batch ID within the given confounding variable of the given sample. Reference is the list of unique batch ids for each confounding variable.

MAXIT

(scalar) [Default 1000] Maximum number of BFGS iterations for model fitting with optim.

Value

(list) List of sigmoidal fit parameters and results.

  • vecSigmoidParam (numeric vector length 4) {beta, h0, h1, t} Maximum likelihood estimators of sigmoidal model parameters.

  • vecSigmoidValue (numeric vector length number of time points) Values of sigmoid model fit at time points used for fit.

  • lsvecBatchFactors (list length number of confounders) List of vectors of scalar batch correction factors for each sample. These are also maximum likelihood estimators. NULL if no confounders given.

  • scaDispParam (scalar) Dispersion parameter estimate used in fitting (hyper-parameter).

  • scaLL (scalar) Loglikelihood of data under maximum likelihood estimator model.

  • scaConvergence (scalar) Convergence status of optim on sigmoidal model.

Author(s)

David Sebastian Fischer

See Also

Called by fitSigmoidModels to fit sigmoidal model to samples of one condition and one gene. Calls sigmoidal parameter initialisation function estimateSigmoidParam and optimisation wrapper fitSigmoidModel.


YosefLab/ImpulseDE2 documentation built on Sept. 17, 2022, 2:45 a.m.