namespace problem running GEOquery and justRMA in same session
1
0
Entering edit mode
Ty Thomson ▴ 100
@ty-thomson-5919
Last seen 9.5 years ago
United States

If I use getGEOSuppFiles() from the GEOquery package to download cel files directly from GEO, and in the same session try to run justRMA on those files, I sometimes get an error from justRMA:

Error in .Call("unsafe_set_slot", obj, slot, value) :
  "unsafe_set_slot" not resolved from current namespace (Biobase)

If I restart the R session, then justRMA runs fine on the files, so it appears to be caused by running getGEOSuppFiles() first.  I'm trying to automate downloading and processing lots of datasets, so it would be problematic for me to separate these things into different R sessions. 

Here is code to download two cel files and run justRMA, generating an error:

library(Biobase)
library(affy)
library(affyio)
library(GEOquery)
setwd("~")

# need to avoid IE for internet access so that GEOquery functions work
suppressWarnings(setInternet2(use = FALSE))
affy_U95Av2 <- c(paste0("GSM", 29059:29060))

dir.create("new_folder")

sapply(affy_U95Av2, getGEOSuppFiles, makeDirectory=F, baseDir="new_folder")
cur.eset <- justRMA(filenames=paste0(affy_U95Av2, '.CEL.gz'),
                    celfile.path="new_folder")

Here's the traceback of the error:

> traceback()
9: .Call("unsafe_set_slot", obj, slot, value)
8: unsafeSetSlot(object, "assayData", ad)
7: `sampleNames<-`(`*tmp*`, value = c("GSM29059.CEL.gz", "GSM29060.CEL.gz"))
6: `sampleNames<-`(`*tmp*`, value = c("GSM29059.CEL.gz", "GSM29060.CEL.gz"))
5: justRMA(filenames = paste0(affy_U95Av2, ".CEL.gz"), celfile.path = "new_folder") at .active-rstudio-document#49
4: eval(expr, envir, enclos)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("~/.active-rstudio-document")

If I restart the R session and comment getGEOSuppFiles() line, it runs without error.  Any thoughts about how I can avoid this error?

Thanks!

Ty

sessionInfo():

R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
  [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
  [1] hgu95av2cdf_2.15.0  GEOquery_2.32.0     affyio_1.34.0       affy_1.44.0         Biobase_2.26.0      BiocGenerics_0.12.1

loaded via a namespace (and not attached):
  [1] AnnotationDbi_1.28.2  BiocInstaller_1.16.5  bitops_1.0-6          DBI_0.3.1             GenomeInfoDb_1.2.5    IRanges_2.0.1        
[7] preprocessCore_1.28.0 RCurl_1.95-4.6        RSQLite_1.0.0         S4Vectors_0.4.0       stats4_3.1.2          tools_3.1.2          
[13] XML_3.98-1.1          zlibbioc_1.12.0   

affy geoquery • 1.5k views
ADD COMMENT
0
Entering edit mode

This seems very strange! In a new R session does the following work

library(Biobase)
data(sample.ExpressionSet)
sampleNames(sample.ExpressionSet) = sampleNames(sample.ExpressionSet)

? If not, can you remove and then re-install Biobase

## new session
remove.packages("Biobase")
remove.packages("Biobase")

(that second one should cause an error that there is no package called Biobase; it may be that you do not have permissions to remove the package, and then remove.packages() will not report that the removal failed).

## new session
source("http://bioconductor.org/biocLite.R")
biocLite("Biobase")

and try the sampleNames() commands again?

ADD REPLY
0
Entering edit mode

Hi Martin,

I tried sampleNames() as you suggested and it worked without error. But somehow in trying that I ended up using an R session outside of R studio.  And my code above worked!  So the problem that I'm encountering seems to be due to R studio.  I had to use setInternet2(use = FALSE) to make GEOquery work with R studio.  I found another suggestion for making GEOquery work with R studio (here:http://stackoverflow.com/questions/22721819/download-file-fails-in-rstudio), and lo-and-behold my code now works in R studio!  No idea how or why, but it works!  Thanks for you suggestions, they somehow got me to find the answer.

ADD REPLY
0
Entering edit mode
Ty Thomson ▴ 100
@ty-thomson-5919
Last seen 9.5 years ago
United States

The problem ended up being caused by R studio.  When I set R studio to no longer use IE settings it works! (Tools > Global Options > Packages, and unselect "Use Internet Explorer library/proxy for HTTP"; source: http://stackoverflow.com/questions/22721819/download-file-fails-in-rstudio)

ADD COMMENT

Login before adding your answer.

Traffic: 396 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