Hi Bruno,

there are a couple of issues with your code.

First, the problem stands in the way 'probbe2GO' is formatted. It should be
a named list, where the names are the probe ID and a list entry is a
character string of GO IDs (the ones to which a probe ID is annotated).
However, your 'probe2GO' object is different and this results in a faulty
topGOdata object. For example:

> str(head(probe2GO, 2))
List of 2
 $ 7896742:List of 5
  ..$ GO:0007049:List of 3
  .. ..$ GOID    : chr "GO:0007049"
  .. ..$ Evidence: chr "IEA"
  .. ..$ Ontology: chr "BP"
  ..$ GO:0051301:List of 3
  .. ..$ GOID    : chr "GO:0051301"
  .. ..$ Evidence: chr "IEA"
  .. ..$ Ontology: chr "BP"
  ..$ GO:0031105:List of 3
  .. ..$ GOID    : chr "GO:0031105"
  .. ..$ Evidence: chr "IEA"
  .. ..$ Ontology: chr "CC"
  ..$ GO:0005515:List of 3
  .. ..$ GOID    : chr "GO:0005515"
  .. ..$ Evidence: chr "IPI"
  .. ..$ Ontology: chr "MF"
  ..$ GO:0005525:List of 3
  .. ..$ GOID    : chr "GO:0005525"
  .. ..$ Evidence: chr "IEA"
  .. ..$ Ontology: chr "MF"
 $ 7896779:List of 13
  ..$ GO:0030036:List of 3
  .. ..$ GOID    : chr "GO:0030036"
  .. ..$ Evidence: chr "ISS"
  .. ..$ Ontology: chr "BP"
..............................................

what you need is something like this:

> probe2GO <- lapply(probe2GO, names)
> str(head(probe2GO, 2))
List of 2
 $ 7896742: chr [1:5] "GO:0007049" "GO:0051301" "GO:0031105" "GO:0005515"
...
 $ 7896779: chr [1:13] "GO:0030036" "GO:0016567" "GO:0007420" "GO:0005886"
...

With this, you can instantiate a topGOData instance and perform the
statistical test.

> intgenes <- sample(probekeys, 1000)
> geneList<-factor(as.integer(probekeys %in% intgenes)) # intgenes= my list
of interesting probeIDs
> names(geneList)<-probekeys
> str(geneList)
 Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 2 1 1 ...
 - attr(*, "names")= chr [1:33295] "7892501" "7892502" "7892503" "7892504"
...
> GOdata<-new("topGOdata", ontology="BP", allGenes= geneList, annot =
annFUN.gene2GO, gene2GO=probe2GO)

Building most specific GOs .....    ( 8788 GO terms found. )

Build GO DAG topology ..........    ( 11951 GO terms and 27203 relations. )

Annotating nodes ...............    ( 15500 genes annotated to the GO
terms. )
> test.stat <- new("classicCount", testStatistic = GOFisherTest, name =
"Fisher test")
> resultFisher <- getSigGroups(GOdata, test.stat)

             -- Classic Algorithm --

         the algorithm is scoring 4097 nontrivial nodes
         parameters:
             test statistic:  Fisher test
> resultFisher

Description:
Ontology: BP
'classic' algorithm with the 'Fisher test' test
11951 GO terms scored: 59 terms with p < 0.01
Annotation data:
    Annotated genes: 15500
    Significant genes: 469
    Min. no. of genes annotated to a GO: 1
    Nontrivial nodes: 4097



So add the ' probe2GO <- lapply(probe2GO, names)' line before building the
topGOData object.

Now, all the above can be done a lot easier. You don't need to build the
probe-to-GO mapping yourself. There are a few annotation functions provided
by topGO which will do that for you. Please read the help of 'annFUN' and
Section 4 of the package vignette. So, you can get the same results by
doing something like:

## gene universe (probeset IDs)
probekeys <- Lkeys(hugene11sttranscriptclusterENTREZID)

intgenes <- sample(probekeys, 1000)
geneList <- factor(as.integer(probekeys %in% intgenes)) # intgenes= my list
of interesting probeIDs
names(geneList) <- probekeys

## use the annFUN.db for a Bioconductor annotation package
GOdata <- new("topGOdata", ontology = "BP", allGenes = geneList,
              annot = annFUN.db, affyLib = "hugene11sttranscriptcluster")
GOdata

## you can use runTest() instead of the new("classicCount", ...) and
getSigGroups(...)
resultFisher <- runTest(GOdata, algorithm = "classic", statistic = "fisher")



Hope this helps.

Best regards,
Adrian

	[[alternative HTML version deleted]]

