inmoose.deseq2.estimateDispersionsGeneEst

inmoose.deseq2.estimateDispersionsGeneEst(obj, minDisp=1e-08, kappa_0=1, dispTol=1e-06, maxit=100, useCR=True, weightThreshold=0.01, quiet=False, modelMatrix=None, niter=1, linearMu=None, minmu=None, alphaInit=None, type_='DESeq2')

Low-level function to fit dispersion estimates

Normal users should instead use DESeqDataSet.estimateDispersions(). This low-level function is called by DESeqDataSet.estimateDispersions(), but is exported and documented for non-standard usage. For instance, it is possible to replace fitted values with a custom fit and continue with the maximum a posteriori dispersion estimate.

Parameters:
  • obj (DESeqDataSet) – the input dataset

  • minDisp (float) – small value for the minimum dispersion, to allow for calculations in log scale, one order of magnitude above this value is used as a test for inclusion in mean-dispersion fitting

  • kappa_0 (float) – parameter used in setting the initial proposal in backtracking search, higher kappa_0 results in larger steps

  • dispTol (float) – parameter to test for convergence of log dispersion, stop when increase in log posterior is less than dispTol

  • maxit (int) – maximum number of iterations to allow for convergence

  • useCR (bool) – whether to use Cox-Reid adjustment

  • weightThreshold (float) – threshold for subsetting the design matrix and GLM weights for calculating the Cox-Reid correction

  • quiet (bool) – whether to print messages at each step

  • modelMatrix (array-like) – for advanced use only, a substitute model matrix for gene-wise and MAP dispersion estimation

  • niter (int) – number of times to iterate between estimation of means and estimation of dispersion

  • linearMu – estimate the expected counts matrix using a linear model. Defaults to None, in which case a linear model is used if the number of groups defined by the model matrix is equal to the number of columns of the model matrix.

  • minmu (float) – lower bound on the estimated count for fitting gene-wise dispersion

  • alphaInit (array-like) – initial guess for the dispersion estimates

  • type ("DESeq2" or "glmGamPoi") – specify if the glmGamPoi package is used to calculate the dispersion. This can be significantly faster if there are many replicates with small counts.

Returns:

the input obj with gene-wise dispersion estimates

Return type:

DESeqDataSet