GEOquery: Error Message
2
0
Entering edit mode
alakatos ▴ 130
@alakatos-6983
Last seen 5.3 years ago
United States

Hello,

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.

Anita

My code:

library(Biobase)
library(GEOquery)

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

Error:

> gset <- getGEO("GSE8401", GSEMatrix =TRUE)
ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE8nnn/GSE8401/matrix/
Found 1 file(s)
GSE8401_series_matrix.txt.gz
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:
C:\Users\ANITAL~1\AppData\Local\Temp\RtmpMrh4oX/GPL96.soft 
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

locale:
[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 • 3.6k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
alakatos ▴ 130
@alakatos-6983
Last seen 5.3 years ago
United States

It is working now with the same code.

Thanks,

Anita

ADD COMMENT
0
Entering edit mode
@contatocarlosbau-8720
Last seen 9.3 years ago
Brazil

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!

library(Biobase)
library(GEOquery)
library(limma)

# 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 <- contrasts.fit(fit, cont.matrix)
fit2 <- eBayes(fit2, 0.01)
tT <- topTable(fit2, adjust="fdr", sort.by="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 COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 661 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6