Learn R Programming

SingleCellAssay (version 0.80)

zlm.SingleCellAssay: zlm.SingleCellAssay

Description

zero-inflated regression for SingleCellAssay

Usage

zlm.SingleCellAssay(formula, sca, lm.fun = glm, hypothesis.matrix, hypo.terms,
  hypo.contrasts, type = "Wald", keep.zlm = FALSE, .parallel = FALSE,
  .drop = TRUE, .inform = FALSE, silent = TRUE, ...)

Arguments

formula

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

sca

SingleCellAssay object

lm.fun

a function accepting lm-style arguments and a family argument

hypothesis.matrix

Deprecated

hypo.terms

character vector giving terms to drop from model

hypo.contrasts

specific contrasts to test in form expected by lht

type

type of test to run, one of 'Wald' or 'LRT'

keep.zlm

should the model objects be kept?

.parallel

run fits using parallel processing. must have doParallel

.drop

see ldply

.inform

see ldply

silent

Silence common problems with fitting some genes

...

passed to lm.fun

Value

either an array of tests (one per primer) or a list

Details

For each gene in sca, fits the hurdle model in formula (linear for et>0), logistic for et==0 vs et>0. Conducts tests using hypothesis.matrix.

When keep.zlm is FALSE, a 3D array with first dimension being the genes, next dimension giving information about the test (the degrees of freedom, Chisq statistic, and P value), and final dimension being the value of these quantities on the discrete, continuous and hurdle (combined) levels.

When keep.zlm is TRUE, a list of length two is returned. Component "tests" gives the above 3-D array. Component "models" is a list giving the model fit for each gene.

See Also

zlm

test.zlm

Examples

Run this code
# NOT RUN {
data(vbeta)
vbeta <- computeEtFromCt(vbeta)
vbeta.sc <- FluidigmAssay(vbeta, idvars='Sample.ID', primerid='Gene', measurement='Et', ncells='Number.of.Cells', cellvars='Stim.Condition')
testsByGene <- zlm.SingleCellAssay(Et ~ Stim.Condition, vbeta.sc, hypothesis.matrix='Stim.ConditionUnstim')
# genes X metric X test type
dimnames(testsByGene)

modelsAndTestsByGene <- zlm.SingleCellAssay(Et ~ Stim.Condition, vbeta.sc, hypothesis.matrix='Stim.ConditionUnstim', keep.zlm=TRUE)
names(modelsAndTestsByGene$models)
summary(modelsAndTestsByGene$models[['IL13']]$disc)
summary(modelsAndTestsByGene$models[['IL13']]$cont)
# }

Run the code above in your browser using DataLab