Question: Error in R Script
0
gravatar for 786
3.0 years ago by
78650
78650 wrote:

Hi I was retrieving differentially expressed genes through R and got an error at the very last step. Please help me out in removing following error it will be very helpful.

Error
results= topTable(fit2, adjust ='BH', number = nrow(gse32269eset))
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 54675, 22283
limma affy bioconductor R • 1.6k views
ADD COMMENTlink modified 3.0 years ago by Ar860 • written 3.0 years ago by 78650

I think It's related to selecting the number of DEGs,why you select all the prob-id in your GSE? try with a number,lets say 100, I suggest you specify log fold change for your topranked gene e.g logFC=0.05

ADD REPLYlink written 3.0 years ago by Shamim Sarhadi210
3
gravatar for Ar
3.0 years ago by
Ar860
United States
Ar860 wrote:

try using: topTable(fit2, adjust ='BH', number = Inf)

I think you are filtering some probes or aggregating the probes due to which there is a difference in the number of rows between fit2 and nrow(gse32269eset)

ADD COMMENTlink written 3.0 years ago by Ar860

I got the same error by running this command..Can you please help me more?

ADD REPLYlink written 3.0 years ago by 78650
2

I am not sure but it is working for me. I presume that you are using GSE32269

> exprs = exprs(eset) 
> dim(exprs)
[1] 22283    55
> design <- model.matrix(~ type + Tmprss2.erg + 0, as.data.frame(group))
> head(design)
  typePrimary typeMet typeNormal Tmprss2.ergPositive
1           1       0          0                   0
2           1       0          0                   0
3           1       0          0                   0
4           1       0          0                   0
5           1       0          0                   0
6           1       0          0                   0
> cont.matrix <- makeContrasts(NormalvsPrimary = typePrimary-typeNormal, levels=design)
> print(cont.matrix)
                     Contrasts
Levels                NormalvsPrimary
  typePrimary                       1
  typeMet                           0
  typeNormal                       -1
  Tmprss2.ergPositive               0
> fit1 <- lmFit(exprs, design)
> fit2 <- contrasts.fit(fit1, cont.matrix)
> fit2 <- eBayes(fit2)
> results <- topTable(fit2, "NormalvsPrimary", number=Inf)
> head(results)
                logFC   AveExpr         t      P.Value    adj.P.Val        B
201596_x_at  6.359687 10.604378  18.36430 9.175354e-25 2.044544e-20 45.75283
215054_at   -1.735632  5.432611 -17.25748 1.593483e-23 1.775379e-19 43.02282
211820_x_at -2.799107  4.629426 -16.60052 9.224250e-23 6.374164e-19 41.33593
206207_at   -4.621926  6.161970 -16.52111 1.144220e-22 6.374164e-19 41.12856
206676_at   -5.027171  4.179033 -16.01332 4.615017e-22 2.056728e-18 39.78449
204959_at   -5.102275  4.839911 -15.76017 9.351825e-22 3.473112e-18 39.10262
ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by Ar860

It worked but I need gene names too in my results how can I get them??

ADD REPLYlink written 3.0 years ago by 78650
1

You need annotation file from Affymetrix and then map it to the probes. You may also use David to convert them to gene ids/gene symbol.

ADD REPLYlink written 3.0 years ago by Ar860
1

Thank u so much for our help.

ADD REPLYlink written 3.0 years ago by 78650
1

https://biodbnet-abcc.ncifcrf.gov/db/db2db.php is a nice tool to convert prob-id to gene symbol

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by Shamim Sarhadi210

Thanx alot fr your help.

ADD REPLYlink written 3.0 years ago by 78650

Sorry I have ovary cancer samples stage 1, 2, 3 and normal samples I was going to have something like your above code resulted in P.value , adj.P.Val , logFC

I did like below

library(limma)

library(affy)

Data<-ReadAffy()

eset<-rma(Data)

exprs<-exprs(eset)

dim(exprs)

[1] 54675 4

design <- model.matrix(~ type + Tmprss2.erg + 0, as.data.frame(group))

Error in as.data.frame(group) : object 'group' not found

Actually I was going to compare normal with rest of cancers in 3 stages but I got error

how I can have your top table please?

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by F3.4k

Com'on.. you need to define the group first.. i.e. which sample belongs to which group. Read about limma first and try to understand the code. Please think and apply. I am sure you don't want yourself to be spoon-fed.

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by Ar860

It is never a good idea to ask a new unrelated question in an existing thread. Please start a new thread.

ADD REPLYlink written 3.0 years ago by genomax68k

Sorry If I ask such a question in a new thread the Admins will close my post abruptly because they supposed me as a spoon-feed OP :)

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by F3.4k
Please log in to add an answer.

Help
Access

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