Search
Question: goana limma- extract list of DE genes and genes in the enriched GO terms?
1
gravatar for carl.mann
2.8 years ago by
carl.mann10
France
carl.mann10 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 2.8 years ago by Gordon Smyth33k • written 2.8 years ago by carl.mann10
5
gravatar for Aaron Lun
2.8 years ago by
Aaron Lun19k
Cambridge, United Kingdom
Aaron Lun19k 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 2.8 years ago • written 2.8 years ago by Aaron Lun19k

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 2.8 years ago by carl.mann10
4
gravatar for Gordon Smyth
2.8 years ago by
Gordon Smyth33k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth33k 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 2.8 years ago • written 2.8 years ago by Gordon Smyth33k
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: 190 users visited in the last hour