Question: edgeR: error ih summary(decideTests(lrt))
gravatar for Pingu
4 months ago by
Pingu0 wrote:


I have followed the example reported in edgeR guideline, section "4.1 RNA-Seq of oral carcinomas vs matched normal tissue". I have 54 pairs of tumor and normal matched samples (therefore 108 samples in total).

The matrix reporting the counts in each sample is called "count_matrix".

> y <- DGEList(counts = count_matrix)
> y <- calcNormFactors(y)

I created the data frame pheno in order to obtained the design matrix:

These are the first lines of my data.frame "pheno":

> head(pheno)
     Sample Patient Tissue
7  A1FG-11B    A1FG      N
50 A1EN-11A    A1EN      N
30 A2FF-11A    A2FF      N
58 A203-01A    A203      T
41 A0AZ-11A    A0AZ      N
44 A0C3-11A    A0C3      N
> dim(pheno)
[1] 108   3

This is the definition of the design matrix:

design <- model.matrix(~pheno$Patient+pheno$Tissue)
rownames(design) <- colnames(count_matrix)
y <- estimateDisp(y design, robust=TRUE)
fit <- glmFit(y, design)
lrt <- glmLRT(fit) 

Coefficient:  pheno$TissueT 
                    logFC   logCPM       LR        PValue           FDR
ENSG00000123500  7.608219 6.781840 537.6956 5.980826e-119 9.183558e-115
ENSG00000099953  6.165488 7.402075 490.9502 8.852279e-109 6.796337e-105
ENSG00000230838  6.582381 2.203078 395.0187  6.688333e-88  3.423312e-84
ENSG00000249669 -4.607226 4.389790 366.2898  1.202373e-81  4.615609e-78
ENSG00000119771 -3.010243 4.036926 357.9115  8.023370e-80  2.463977e-76
ENSG00000122641  3.525087 5.962757 316.3896  8.857866e-71  2.266876e-67
ENSG00000106004 -3.087477 3.386670 315.5859  1.325620e-70  2.907843e-67
ENSG00000165197 -5.792541 4.231021 307.6019  7.271719e-69  1.395715e-65
ENSG00000197576 -2.819078 1.514075 300.5615  2.485681e-67  4.240848e-64
ENSG00000090889  4.159287 4.095254 299.3114  4.653633e-67  7.145653e-64

When I do the following command I get an error:

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x),  : 
  dims [product 61420] do not match the length of object [18]

What'd I do wrong?

Thank you in advance

ADD COMMENTlink modified 4 months ago by Gordon Smyth33k • written 4 months ago by Pingu0

Fix the tag (it should be edgeR) otherwise the maintainers won't get notified.

ADD REPLYlink written 4 months ago by Aaron Lun19k
gravatar for Aaron Lun
4 months ago by
Aaron Lun19k
Cambridge, United Kingdom
Aaron Lun19k wrote:

I'm afraid you haven't given us a lot of information to work with. I can't even find a line of code in edgeR or limma corresponding to the code in the error message. Are you working with the latest package versions (edgeR 3.20.7)? What does your traceback() say after you encounter the error message?

The following example works fine for me:


If I were to guess, I'd say you're using an old version of the package where decideTests on DGELRT objects was not yet supported.

ADD COMMENTlink modified 4 months ago by Gordon Smyth33k • written 4 months ago by Aaron Lun19k

I'm pretty sure your guess is correct, OP is using an old version of edgeR without a decideTests() method for DGELRT objects. I'm going to write a fuller answer myself.

ADD REPLYlink modified 4 months ago • written 4 months ago by Gordon Smyth33k
gravatar for Gordon Smyth
4 months ago by
Gordon Smyth33k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth33k wrote:

Dear Pingu,

I see you've just joined, so welcome to Bioconductor Support! First let me say that your code would almost certainly work if you used:


instead, but I'll now give a longer explanation why.

This forum has a posting guide that you should read: . The guide in particular asks people (i) to use the latest version of Bioconductor and (ii) to include the output of sessionInfo() in their post. The reason for this will soon be clear.

The edgeR package is under constant development. When you install edgeR, it also installs the User's Guide for that version of edgeR. You can read the User's Guide for your copy of edgeR by typing


at the R prompt. When we introduce a new function to edgeR, it may well be included in one of the examples in the User's Guide. Each case study in the User's Guide includes sessionInfo() output so you can see which version of edgeR was used to make the case study.

This all means that you can't read a version of the User's Guide from the internet and expect everything in the Guide to work with your version of edgeR, especially if your version of edgeR is not the latest. The Guide may include newer functions that don't work in your version of edgeR.

The decideTests() function was added to edgeR with the Bioconductor 3.5 Release in April 2017, as you can see here: . If you are using a version of edgeR older than that, from Bioconductor 3.4 or older, then decideTests will not work for you. In that case you have to user the older function, decideTestsDGE, which you will find described in your version of the User's Guide.


ADD COMMENTlink modified 4 months ago • written 4 months ago by Gordon Smyth33k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 142 users visited in the last hour