Search
Question: goana limma- extract list of DE genes and genes in the enriched GO terms?
2
gravatar for carl.mann
3.4 years ago by
carl.mann20
France
carl.mann20 wrote:

From the S3 object returned by the goana() function in limma, is it possible to extract the list of DE genes that are enriched for each GO term (gene lists corresponding to N and DE in the returned data.frame)?

ADD COMMENTlink modified 3.4 years ago by Gordon Smyth35k • written 3.4 years ago by carl.mann20
6
gravatar for Aaron Lun
3.4 years ago by
Aaron Lun21k
Cambridge, United Kingdom
Aaron Lun21k wrote:

No, I'm pretty sure that information isn't stored in the output. To get it, you'll have to do something like this:

# Basic set-up:
DB <- paste("org", species, "eg", "db", sep = ".")
require(DB, character.only = TRUE)
GO2ALLEGS <- paste("org", species, "egGO2ALLEGS", sep = ".")
EG.GO <- AnnotationDbi::toTable(get(GO2ALLEGS))
d <- duplicated(EG.GO[, c("gene_id", "go_id", "Ontology")])
EG.GO <- EG.GO[!d, ]

# Now choosing DE genes for each GO ID/Ontology combination:
de.by.go <- split(EG.GO$gene_id, paste(EG.GO$go_id, EG.GO$Ontology, sep="."))
de.by.go <- lapply(de.by.go, FUN=function(x) { x[x %in% de] })

I'm assuming you have some species identifier in species, and a vector of Entrez Gene IDs in de. I'm also assuming that you haven't set universe in your original call to goana.

ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by Aaron Lun21k

Hello Aaron- yes, species = H.s., vector of Entrez Gene IDs for de, and universe not set in call to goana. I'll give your code a try. Thanks for your prompt help! Carl.

ADD REPLYlink written 3.4 years ago by carl.mann20

Hi Aaron,

I am also trying to extract a list of DE genes from my GO term analysis. However, I am quite new to using R and I don't completely follow your code/ cannot make it work. Would it be possible to break it down a bit more?

Really hope you can help me out!

Thanks, Lotte

ADD REPLYlink written 5 months ago by Lotte0
  1. This post is 3 years old. Start a new post if you have a new question.
  2. Try reading the documentation. ?duplicated, ?toTable, ?split, etc.
  3. I'm not psychic, I can't know what you don't understand if you don't mention it.
ADD REPLYlink written 5 months ago by Aaron Lun21k

Hi Aaron,

Thank you for your very kind answer. 

ADD REPLYlink written 5 months ago by Lotte0
5
gravatar for Gordon Smyth
3.4 years ago by
Gordon Smyth35k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth35k wrote:

Here's another way if you're only interested in a few GO Terms. Suppose you're interested in GO:0001516. Then

> library(org.Hs.eg.db)
> x <- org.Hs.egGO2ALLEGS
> Rkeys(x) <- "GO:0001516"
> EG <- mappedLkeys(x)
> EG
 [1] "301"    "551"    "552"    "873"    "972"    "1906"   "1907"   "3248"  
 [9] "4282"   "5601"   "5730"   "5740"   "5742"   "5743"   "6916"   "8644"  
[17] "8877"   "9536"   "10728"  "22949"  "23411"  "27306"  "50640"  "80142" 
[25] "127281" "255189"

gives you the Entrez Gene IDs corresponding to N and

> intersect(EG, your.de.list)

gives you Entrez Gene IDs corresponding to DE.

 

ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by Gordon Smyth35k
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.2.0
Traffic: 165 users visited in the last hour