View source: R/estDispersion.R
estDispersion | R Documentation |
This function first estimate tag-specific dipsersions using a method of moment estimator. Then the dipsersions are shrunk based a penalized likelihood approach. The function works for general experimental designs.
## S4 method for signature 'SeqCountSet'
estDispersion(seqData, trend=FALSE)
seqData |
An object of SeqCountSet class. |
trend |
A binary indicator for modeling the dispersion~expression trend. |
The function takes and object of seqCountData class and return the same oject with “dispersion” field filled.
With “trend=TRUE” the dependence of dispersion on mean expressions will be modeled. In that case the shrinkage will be performed conditional on mean expressions.
The function works for multiple factor designs. But option “trend=TRUE” only applicable for single factor experiment.
Hao Wu <hao.wu@emory.edu>
data(seqData)
seqData=estNormFactors(seqData)
seqData=estDispersion(seqData)
head(dispersion(seqData))
## For multiple factor design
data(seqData)
Y=exprs(seqData)
design=data.frame(gender=c(rep("M",4), rep("F",4)), strain=rep(c("WT", "Mutant"),4))
X=as.data.frame(model.matrix(~gender+strain, data=design))
seqData=newSeqCountSet(Y, X)
seqData=estDispersion(seqData)
head(dispersion(seqData))
## the hypothesis testing for multifactor experiments can be performed
## using edgeR function, with DSS estimated dispersions
## Not run:
library(edgeR)
fit.edgeR <- glmFit(Y, X, lib.size=normalizationFactor(seqData), dispersion=dispersion(seqData))
lrt.edgeR <- glmLRT(fit.edgeR, coef=2)
head(lrt.edgeR$table)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.