Question: GEOquery: Error Message
gravatar for alakatos
4.3 years ago by
United States
alakatos110 wrote:


I tried to download a gene expression dataset from GEO site. My code worked perfectly in the past but now suddenly I am receiving error messages. I double-checked the GEO Analyze with GEO2R R script and it looks exactly  just like mine. I tried it on both PC and Mac. No luck.

Any suggestions are highly appreciated.


My code:


gset <- getGEO("GSE8401", GSEMatrix =TRUE)
if (length(gset) > 1) idx <- grep("GPL96", attr(gset, "names")) else idx <- 1
gset <- gset[[idx]]


> gset <- getGEO("GSE8401", GSEMatrix =TRUE)
Found 1 file(s)
Using locally cached version: C:\Users\ANITAL~1\AppData\Local\Temp\RtmpMrh4oX/GSE8401_series_matrix.txt.gz
Using locally cached version of GPL96 found here:
Error in xj[i] : only 0's may be mixed with negative subscripts
In addition: Warning message:
closing unused connection 3 (C:\Users\ANITAL~1\AppData\Local\Temp\RtmpMrh4oX/GPL96.soft) 
> if (length(gset) > 1) idx <- grep("GPL96", attr(gset, "names")) else idx <- 1
Error: object 'gset' not found
> gset <- gset[[idx]]
Error: object 'gset' not found
>  sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] XML_3.98-1.3         RCurl_1.95-4.7       bitops_1.0-6         limma_3.24.12        GEOquery_2.34.0     
[6] BiocInstaller_1.18.3 Biobase_2.28.0       BiocGenerics_0.14.0 

loaded via a namespace (and not attached):
[1] tools_3.2.0


geoquery error • 1.4k views
ADD COMMENTlink modified 4.1 years ago by contato.carlosbau10 • written 4.3 years ago by alakatos110

I think this was an NCBI problem, as other users reported problems yesterday.  I'm glad it worked itself out for you.

ADD REPLYlink written 4.3 years ago by Sean Davis21k
Answer: GEOquery: Error Message
gravatar for alakatos
4.3 years ago by
United States
alakatos110 wrote:

It is working now with the same code.



ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by alakatos110
Answer: GEOquery: Error Message
gravatar for contato.carlosbau
4.1 years ago by
contato.carlosbau10 wrote:

I have the same problem!

I tried to run the R script in my PC and comes with an error after gset, I already emailed GEO to check the code or something.

The R script above is the exact copy of the generated script in GEO2R, but only works a few commands, if somebody has the same problem and could solve it, it will be very good if people share ir!


# load series and platform data from GEO

gset <- getGEO("GSE7696", GSEMatrix =TRUE)
if (length(gset) > 1) idx <- grep("GPL570", attr(gset, "names")) else idx <- 1
gset <- gset[[idx]]

# make proper column names to match toptable
fvarLabels(gset) <- make.names(fvarLabels(gset))

# group names for all samples
sml <- c("X","X","X","G1","X","X","X","X","X","X","X","X","X","X","X","X","G0","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X","X");

# eliminate samples marked as "X"
sel <- which(sml != "X")
sml <- sml[sel]
gset <- gset[ ,sel]

# log2 transform
ex <- exprs(gset)
qx <- as.numeric(quantile(ex, c(0., 0.25, 0.5, 0.75, 0.99, 1.0), na.rm=T))
LogC <- (qx[5] > 100) ||
          (qx[6]-qx[1] > 50 && qx[2] > 0) ||
          (qx[2] > 0 && qx[2] < 1 && qx[4] > 1 && qx[4] < 2)
if (LogC) { ex[which(ex <= 0)] <- NaN
  exprs(gset) <- log2(ex) }

--------------------------------------------------------------- until here It was working a few days ago, and the next code doesnt work

# set up the data and proceed with analysis
fl <- as.factor(sml)
gset$description <- fl
design <- model.matrix(~ description + 0, gset)
colnames(design) <- levels(fl)
fit <- lmFit(gset, design)
cont.matrix <- makeContrasts(G1-G0, levels=design)
fit2 <-, cont.matrix)
fit2 <- eBayes(fit2, 0.01)
tT <- topTable(fit2, adjust="fdr","B", number=250)

# load NCBI platform annotation
gpl <- annotation(gset)
platf <- getGEO(gpl, AnnotGPL=TRUE)
ncbifd <- data.frame(attr(dataTable(platf), "table"))

# replace original platform annotation
tT <- tT[setdiff(colnames(tT), setdiff(fvarLabels(gset), "ID"))]
tT <- merge(tT, ncbifd, by="ID")
tT <- tT[order(tT$P.Value), ]  # restore correct order

tT <- subset(tT, select=c("ID","adj.P.Val","P.Value","t","B","logFC","Gene.symbol","Gene.title"))
write.table(tT, file=stdout(), row.names=F, sep="\t")



ADD COMMENTlink written 4.1 years ago by contato.carlosbau10

Please ask as a new question.  If you are getting error messages, you'll need to tell us what those messages are.  "It doesn't work" is quite difficult to diagnose.  Finally, please include the output of sessionInfo() when asking questions about code.

ADD REPLYlink written 4.1 years ago by Sean Davis21k
Please log in to add an answer.


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