How to extract genes from goana
1
0
Entering edit mode
3.9 years ago

Hello,

I am using goana to get enriched GO terms from my data. The problem I encounter is that I wish to find out what genes goana classes as 'up' or 'down' as the output from topGO() does not include this column.

I found a post from a number of years ago explaining how to do this with with the kegga() function and this works however I cannot find a way to alter the code for topGO(). I have included the code below from goana and topGO.

Many thanks

go <- goana(fit, 
        geneid = fit$genes$ENTREZID,
        FDR=0.05,
        trend = F)

DE_GOana <- topGO(go, 
                         ontology=c("BP"), 
                         sort = "down", 
                         number=Inf, 
                         truncate.term=50)
R rna-seq • 1.9k views
ADD COMMENT
2
Entering edit mode
3.9 years ago
Gordon Smyth ★ 7.7k

This has to be done for each GO term individually because there might be 100s or 1000s of genes associated with the term.

First, store the DE results:

tt <- topTable(fit, n=Inf)

Then see DE genes for a specifed GO term. Let's suppose you want to see the genes that goana has used for GO:0023052 (signalling):

library(org.Hs.eg.db)
x <- org.Hs.egGO2ALLEGS
Rkeys(x) <- "GO:0023052"
ID <- mappedLkeys(x)
i <- tt$ENTREZID %in% ID
tt[i,]

This gives a table of all the genes in the GO term, together with the p.adjust column used to select significant genes and the logFC column used to classify genes as up or down.

ADD COMMENT
0
Entering edit mode

Thanks Gordon, this worked a dream!

ADD REPLY

Login before adding your answer.

Traffic: 2554 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6