8

I have downloaded GSE16146 dataset from GEO using GEOquery R package.

I would like to extract "Data table" from downloaded GSE16146.

>library("GEOquery")
>GSE16146 <- getGEO("GSE16146")
>Table(GSE16146)[1:5,]

This returns the following error:

> Table(GSE16146)[1:5,]
Error in (function (classes, fdef, mtable)  :
unable to find an inherited method for function ‘Table’ for signature ‘"list"’

Can anyone help?

aechchiki
  • 2,676
  • 11
  • 34
panbar
  • 81
  • 1
  • 4
  • Have you tried the function getGSEDataTables to access GSE Data Tables from GEO, as reported in this tutorial? Also, what version of R/GEOquery are you using? – aechchiki Aug 30 '17 at 07:48
  • GEOquery version 2.42.0, R version 3.4.0 > getGSEDataTables(gset) Error in as.character.default(<S4 object of class "GSE">) : no method for coercing this S4 class to a vector – panbar Aug 30 '17 at 08:51
  • The error is telling you that you can't calculate a Table for a list. Also you might have tried to use table instead of Table. – llrs Aug 30 '17 at 18:26

1 Answers1

8

According to the manual, all you need to do is:

library('GEOquery')
gseGSE16146 <- getGEO('GSE16146', GSEMatrix=FALSE)

As explanation, getGEO() outputs by default to GSEMatrix=TRUE and returns a list of ExpressionSet objects. You should get what you were looking for with:

Table(GSMList(gseGSE16146)[[1]])[1:5,]

The manual has also a paragraph about this:

The GSE has a metadata section, just like the other classes. However, it doesn’t have a GEODataTable. Instead, it contains two lists, accessible using GPLList and GSMList, that are each lists of GPL and GSM objects.

I tested the code I posted on R 3.3.2 and I get access to the Data Table just fine.

update:

Answering how to extract the actual expression data (not what asked in the original question):

library(GEOquery) 
data = getGEO("GSE16146") 
datExpr = exprs (data[[1]])
aechchiki
  • 2,676
  • 11
  • 34
  • Thanks. It works. Would you suggest how can I extract all the expression matrix for 80 samples (list) from the gseGSE16146? – panbar Aug 30 '17 at 09:59
  • Hi thanks for your answer! What I didn't get is how do I access the actual expression data? – Tapper Oct 26 '18 at 18:20
  • 1
    @Tapper I updated my answer above with how to extract the expression data from the experiment. hope it helps? – aechchiki Oct 27 '18 at 10:29
  • @aechchiki Thank you! The snippet does not contain the data but a list in my case though: GSM4446615 GSM4446616 GSM4446617 GSM4446618. The file getGEO() got was anyway to small to contain the dataset imho. I finally got the data by downloading the big data file myself and processing it with: gse = read.table("GSE123456.txt", sep = "\t"); data=CreateSeuratObject(raw.data = gse, ..) -- What do you think? – Tapper Oct 29 '18 at 19:30