Thanks Gordon, this worked a dream!
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)
1 answer
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.
Log in to answer this question.