On Feb 19, 2008 11:36 AM, John Lande <john.lande77 at="" gmail.com="">
wrote:
> dear Bioc,
>
>
> I want to use GEOquery to get a GSE dataset corresponding to two
GPL. when I
> use the following code I retrive an incompleate expression set, how
can i
> solve the problem?
>
> >library(GEOquery)
> >gse <- getGEO("GSE3494", GSEMatrix = FALSE)
> >if (.Platform$OS.type != "windows") {
> > gse <- getGEO("GSE3494", GSEMatrix = TRUE)
> > show(gse)
> > show(pData(phenoData(gse[[1]]))[1:5, c(1, 6, 8)])
> >}
> >gsmplatforms <- lapply(GSMList(gse), function(x) {
> > Meta(x)$platform
> >})
> >probsets <- Table(GPLList(gse)[[1]])$ID
> > data.matrix <- log2(do.call("cbind", lapply(GSMList(gse),
function(x) {
> > tab <- Table(x)
> > mymatch <- match(probesets, tab$ID_REF)
> > return(tab$VALUE[mymatch])
> >})))
> >data.matrix[1:5, ]
> >require(Biobase)
> >rownames(data.matrix) <- probesets
> >colnames(data.matrix) <- names(GSMList(gse))
> >pdata <- data.frame(samples = names(GSMList(gse)))
> >rownames(pdata) <- names(GSMList(gse))
> >pheno <- as(pdata, "AnnotatedDataFrame")
> >eset2 <- new("ExpressionSet", exprs = data.matrix, phenoData =
pheno)
> >eset2
Hi, John. Since there are two GPLs in this GSE, one needs to pay
particular attention to the platform associated with each GSM; this
can be a bit tedious, so I don't recommend it if you can help it (and
it looks like from your code you can).
You didn't send the output of sessionInfo(), so I'm not sure what
version of R you are using. I would suggest upgrading to the newest
version of GEOquery and the newest version of R (if you aren't using
R-2.6). Due to a relatively recent change to the code (that I patched
back to the release because it is so useful), you can do:
esets <- getGEO('GSE3494',GSEMatrix=TRUE)
esets will be a list of length two with an ExpressionSet in each
member of the list. Each ExpressionSet will contain the information
associated with a single GPL. I imagine that is what you ultimately
were aiming for.
Hope that helps,
Sean