lib.size
component of the samples
component of DGEList object multiplied by the norm.factors
componentgetPriorN(y, design=NULL, prior.df=20)
DGEList
object with (at least) elements counts
(table of unadjusted counts) and samples
(data frame containing information about experimental group, library size and normalization factor for the library size)design
is used to determine the number of parameters to be fit in the statistical model and therefore the residual degrees of freedom. If left as the default (NULL
) then the y$samples$group
element of the DGEList
object is used to determine the residual degrees of freedom.estimateTagwiseDisp
or estimateGLMTagwiseDisp
we need to decide how much weight to give to the common parameter likelihood in order to smooth (or stabilize) the dispersion estimates. The best choice of value for the prior.n
parameter varies between datasets depending on the number of samples in the dataset and the complexity of the model to be fit. The value of prior.n
should be inversely proportional to the residual degrees of freedom. We have found that choosing a value for prior.n
that is equivalent to giving the common parameter likelihood 20 degrees of freedom generally gives a good amount of smoothing for the genewise dispersion estimates. This function simply recommends an appropriate value for prior.n
---to be used as an argument for estimateTagwiseDisp
or estimateGLMTagwiseDisp
---given the experimental design at hand and the chosen prior degrees of freedom.
DGEList
for more information about the DGEList
class.
as.matrix.DGEList
.
# generate raw counts from NB, create list object
y<-matrix(rnbinom(20,size=1,mu=10),nrow=5)
d<-DGEList(counts=y,group=rep(1:2,each=2),lib.size=rep(c(1000:1001),2))
getPriorN(d)
Run the code above in your browser using DataLab