Question: Errors when extracting significant genes per GO.id from topgo data
0
gravatar for tiago211287
2.1 years ago by
tiago2112871.1k
USA
tiago2112871.1k wrote:

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?

rna-seq topgo bioconductor R • 1.2k views
ADD COMMENTlink modified 2.1 years ago • written 2.1 years ago by tiago2112871.1k

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.

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by tiago2112871.1k

Ok, in the second error, instead of org.Mm.eg.db, I should sign a variable of type character pointing to the database like:

mouse<-"org.Mm.eg"

but now, another error is shown:

Error in get(paste(chip, "ENTREZ", sep = "")) : 
  object 'org.Mm.egENTREZ' not found

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?

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by tiago2112871.1k

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.

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by EagleEye6.2k
1
gravatar for tiago211287
2.1 years ago by
tiago2112871.1k
USA
tiago2112871.1k wrote:

Answering my own question...

The first error can be solved by simple adding rm.one = F to the command,still not sure why.

The second problem was more confusing. And then I realize that I just want the gene ID for each GO, and not that fancy table from topGO. We can get that information by using:

#####get genes/GO######

  allGO = genesInTerm(tgd) ##get all GOs and their genes from the topgo result.
  ANOTATION = lapply(allGO,function(x) x[x %in% deseq_result_DEGS_only$ensembl_gene_id] ) ##get only my Differentially expressed genes in allGO

  tableGO.genes <- ANOTATION[tab$GO.ID] ## get only the GO's located in the result of topGO
  LS.df = as.data.frame(do.call(rbind, tableGO.genes)) ## Transform it to a data frame.
ADD COMMENTlink modified 2.1 years ago • written 2.1 years ago by tiago2112871.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 929 users visited in the last hour