Ezra Bekele
Ezra Bekele

Reputation: 173

Retrieve annotation for file using GEOquery

I want to retrieve the annotation for a file using GEOquery. One way I read was using fData(), so:

geoFile<-getGEO("GSE99511")
fData(geoFile)

But then I get the error:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘fData’ for signature ‘"list"’

Any suggestions?

Upvotes: 1

Views: 303

Answers (1)

neilfws
neilfws

Reputation: 33802

EDIT: if you want the "annotation file name" (the GPL platform, presumably), the correct method is annotation().

The error tells you the problem: geoFile is a list and fData expects some other kind of object. ?fData will tell you what it expects.

If you type names(geoFile), you'll probably see:

[1] "GSE99511_series_matrix.txt.gz"

If you type str(geoFile) or better, install and load dplyr and then glimpse(geoFile), you'll see the structure of the object.

All of that tells you that you need to supply the first element of the list geoFile to fData:

head(fData(geoFile$GSE99511_series_matrix.txt.gz))

and you'll want to use head() or glimpse(), otherwise thousands of lines will print to the terminal.

Upvotes: 2

Related Questions