# [Bioc-sig-seq] Questions on the edgeR package

Jason Lu jasonlu68 at gmail.com
Wed Feb 9 19:41:25 CET 2011

```Hi,

I have two questions on the edgeR package, and hope someone here could help.

Question-1. The calculation of the effective library size for the
two-library case has been a mystery to me. In the Genome Biology
(2010) paper, it was mentioned that "the effective library sizes are
calculated by multiplying/dividing the square root of the estimated
normalization factor with the original library size.". When I use the
edgeR to compute the norm.factors, it actually comes up two
norm.factors. From what I read from other posts, for the
multiple-library case the effective library sizes are the
original.lib.size * norm.factors. My question is how to compute the
effective lib.sizes for the two-lib case ( used by the sage.test in
the next step).
> d = calcNormFactors(d)
> d
An object of class "DGEList"
\$samples
group lib.size norm.factors
c1     1  5248721        0.979
c2     0  6352217        1.021

Question-2. I encountered a strange error when I try to run
"estimateTagwiseDisp" (below). It works fine with "estimateCommonDisp"
though.

> library(edgeR)
>
> grp = rep(c('cancer','normal'),each=3)
> d = DGEList(counts = ctab[,1:6], group = grp)
Calculating library sizes from column totals.
> d = calcNormFactors(d)
>
> setwd("~/samplerun/seqf/comp")
>
> options(digits = 4)
> d = d[rowSums(d\$counts)>5,]
> d.2 <- estimateTagwiseDisp(d, prior.n = 15)
Error in t.default(object\$counts) : argument is not a matrix
> class(d\$counts)
[1] "matrix"
> d\$counts[1:2,]
c1 c2 c3  n1 n2  n3
1  25 32 40 100 96 102
10  1  0  0   7  2   0
> d\$samples
group lib.size norm.factors
c1 cancer  5248721       0.9049
c2 cancer  6352217       0.9388
c3 cancer 12012184       0.9409
n1 normal  7477196       1.2217
n2 normal  8012616       1.1123
n3 normal  6691637       0.9206
> sessionInfo()
R version 2.13.0 Under development (unstable) (2011-01-20 r54055)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

other attached packages:
[1] edgeR_2.1.10

loaded via a namespace (and not attached):
[1] limma_3.7.22

Thanks for help.

Jason

```