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.
Hi,
based on your post, I did this:
do you think it's correct now?
Thanks. Best, C.
Yes, not you seem to have created the object correctly. Now you can use it to test the enrichment with runTest...
Thanks, I am back on track with the tutorial now.
Hi,
I run into another problem now:
Do you know what it could be?
C.
Error messages are sometimes difficult to interpret. I assume something is still wrong with sampleGOdata2 Could you post the output of
There is something wrong: there should be some significant genes instead of NA. Possible explanations:
Starting to look better, I imagine the NA's arise from genes with zero expression?? In any case, replacing them by 1 seems like a reasonable idea. Thanks. Best, C.
Yes, it looks ok now. Thank you for accepting my answer.