I'm using topGO to get enriched GO terms from my data. I was able to succesful get the enriched GO terms, but, at the end of the pipeline, there are two commands throwing errors which I could not solve.
> tgd <- new( "topGOdata", ontology="BP", allGenes = alg, nodeSize=5,
annot=annFUN.org, mapping="org.Mm.eg.db", ID = "ensembl" )
First error, when I try to plot the distribution of the genes annotated to a GO term
> print(showGroupDensity(object = tgd, whichGO = "GO:0015980", ranks = TRUE))
Error in factor(group, labels = paste(c("complementary", whichGO), " (", :
invalid 'labels'; length 2 should be 1 or 0
>
Second error, when I try to get the genes in any GO id, I receive a error.
In the topGO manual, the chip argument is set to affyLib, but how can I use the mouse annotation instead? When I try it fails.
> gt <- printGenes(tgd, whichTerms = "GO:0015980", chip = org.Mm.eg.db, numChar = 10)
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
Anyone with experience in using the topGO can help me out?
I discovered that, in the first error, using rm.one = F, the error stop and the plot is shown. I dont know why is this though. Still would like to get an explanation. The manual does not use this after all.
Ok, in the second error, instead of org.Mm.eg.db, I should sign a variable of type character pointing to the database like:
but now, another error is shown:
This second error has to the fact that, topGO search for entrezID in the mouse.db, but I used Ensembl ID's, the question now is, I use ENTREZ_ID or change the R script for do the job?
Sorry that I am not able to help you in direct way. But I have an alternate suggestion. Since you are struggling just to perform enrichment analysis, try GeneSCF with your obtained gene list.