I've been using the getGEO() function of Bioconductor. I noticed that, instead of downloading the GEO archive every time you run the script, you can set a filename parameter where the script will read in the GEO file.
My original code:
gset <- getGEO("GSE59867", GSEMatrix =TRUE, getGPL=FALSE)
My new code:
GSE59867_filename <- "GSE59867_series_matrix.txt.gz" gsetFromFile <- getGEO("GSE59867", filename=GSE59867_filename)
I tried to do that, but my script does not work anymore in the subsequent steps. I checked the getGEO() online webpage, and I read:
Note that since a single file is being parsed, the return value is not a list of esets, but a single eset when GSE matrix files are parsed.
Okay, here's the diagnosis, now I need the cure. How can I convert my my single eset of GSE matrix files to a list of esets?
EDIT: Sorry if I was unclear: the above piece of code works, but I have a problem later when I use the function
getBM(). Here's the complete piece of code:
GSE59867_filename <- "GSE59867_series_matrix.txt.gz" gset <- getGEO("GSE59867", GSEMatrix =FALSE, filename=GSE59867_filename) if (length(gset) > 1) idx <- grep("GPL570", attr(gset, "names")) else idx <- 1 gset <- gset[[idx]] mart <- useMart("ENSEMBL_MART_ENSEMBL") mart <- useDataset("hsapiens_gene_ensembl", mart) annotLookup <- getBM(mart=mart, attributes=c("affy_hugene_1_0_st_v1", "ensembl_gene_id", "gene_biotype", "external_gene_name"), filter="affy_hugene_1_0_st_v1", values=rownames(exprs(gset))[1:50], uniqueRows=TRUE)
And here's the error I get:
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘exprs’ for signature ‘"character"’ Calls: getBM -> rownames -> exprs -> <anonymous> Execution halted
Any idea on how to solve it? Thanks!