Learn R Programming

MAST (version 0.931)

zlm.SingleCellAssay: Zero-inflated regression for SingleCellAssay

Description

For each gene in sca, fits the hurdle model in formula (linear for et>0), logistic for et==0 vs et>0. Return an object of class ZlmFit containing slots giving the coefficients, variance-covariance matrices, etc. After each gene, optionally run the function on the fit named by 'hook'

Usage

zlm.SingleCellAssay(formula, sca, method = "glm", silent = TRUE,
  ebayes = FALSE, ebayesControl = NULL, force = FALSE, hook = NULL,
  parallel = TRUE, LMlike, onlyCoef = FALSE, ...)

Arguments

formula

a formula with the measurement variable on the LHS and predictors present in cData on the RHS

sca

SingleCellAssay object

method

character vector, either 'glm', 'glmer' or 'bayesglm'

silent

Silence common problems with fitting some genes

ebayes

if TRUE, regularize variance using empirical bayes method

ebayesControl

list with parameters for empirical bayes procedure. See ebayes.

force

Should we continue testing genes even after many errors have occurred?

hook

a function called on the fit after each gene.

parallel

If TRUE and option(mc.cores)>1 then multiple cores will be used in fitting.

LMlike

if provided, then the model defined in this object will be used, rather than following the formulas. This is intended for internal use.

onlyCoef

If TRUE then only an array of model coefficients will be returned (probably only useful for bootstrapping).

...

arguments passed to the S4 model object upon construction. For example, fitArgsC and fitArgsD, or coefPrior.

Value

a object of class ZlmFit with methods to extract coefficients, etc.

Details

The empirical bayes regularization of the gene variance assumes that the precision (1/variance) is drawn from a gamma distribution with unknown parameters. These parameters are estimated by considering the distribution of sample variances over all genes. The procedure used for this is determined from ebayesControl, a named list with components 'method' (one of 'MOM' or 'MLE') and 'model' (one of 'H0' or 'H1') method MOM uses a method-of-moments estimator, while MLE using the marginal likelihood. H0 model estimates the precisions using the intercept alone in each gene, while H1 fits the full model specified by formula

See Also

ebayes, glmlike-class, ZlmFit-class

Examples

Run this code
# NOT RUN {
data(vbetaFA)
zlmVbeta <- zlm.SingleCellAssay(~ Stim.Condition, subset(vbetaFA, ncells==1))
slotNames(zlmVbeta)
coef(zlmVbeta, 'D')['CD27',]

vcov(zlmVbeta, 'D')[,,'CD27']
waldTest(zlmVbeta, CoefficientHypothesis('Stim.ConditionUnstim'))
# }

Run the code above in your browser using DataLab