Hi,
I am trying to use topGO to do some GO term enrichment analysis.
I believe that I have everything I need to do the analysis: the full list of genes with p-values from a differential expression test, a sublist of that containing the significant genes, a map between gene IDs and GO terms.
library(GO.db)
library(topGO)
head(geneList2)
WBGene00000001 WBGene00000002 WBGene00000003 WBGene00000004 WBGene00000005 WBGene00000006
0.7425803 NA NA NA NA NA
head(topDiffGenes2)
WBGene00000608 WBGene00000609 WBGene00000657 WBGene00000668 WBGene00000677 WBGene00000680
0.013863506 0.037929727 0.004536303 0.001591211 0.019982714 0.044952727
head(idGoMap)
$WBGene00000001
[1] "GO:0019901" "GO:0040024" "GO:0008340" "GO:0046854" "GO:0005942" "GO:0016301" "GO:0008286"
[8] "GO:0043551" "GO:0046935" "GO:0035014"
$WBGene00000002
[1] "GO:0005886" "GO:0016020" "GO:0015171" "GO:0005887" "GO:0015297" "GO:1902475" "GO:0003333"
[8] "GO:1990184"
$WBGene00000003
[1] "GO:0016020" "GO:0015171" "GO:0005887" "GO:0015297" "GO:0015179" "GO:0003333"
$WBGene00000004
[1] "GO:0005886" "GO:0016020" "GO:0015171" "GO:0005887" "GO:0015297" "GO:1902475" "GO:0003333"
[8] "GO:1990184" "GO:0016021"
$WBGene00000005
[1] "GO:0016020" "GO:0015171" "GO:0005887" "GO:0015297" "GO:0015179" "GO:0003333"
$WBGene00000006
[1] "GO:0016020" "GO:0015171" "GO:0005887" "GO:0015297" "GO:0015179" "GO:0003333"
sampleGOdata2 <- new('topGOdata', description = 'Simple session', ontology = 'BP', allGenes = geneList2, geneSel = topDiffGenes2, nodeSize = 10, annot = annFUN.db, affyLib = idGoMap)
Error in (function (cl, name, valueClass) :
assignment of an object of class “numeric” is not valid for @‘geneSelectionFun’ in an object of class “topGOdata”; is(value, "function") is not TRUE
However, I am not sure how to use the new
function in R to create my topGO object. Can anybody be of any help, please?
Thanks.
Best wishes,
C.