This is a test version of Biostars. For the public version, visit https://www.biostars.org.
load csv file to edgeR

Hi, I have a differential gene expression file created by edgeR and i wonder how i can import this csv file back to use goana() in the edgeR package?

Best,

enter image description here

rnaseq edger

What have you tried?

`?goana` indicates that the function needs `an DGELRT or DGEExact object`, so that you cannot easily rebuild (if at all) from that table. Start over and be sure to save your critical elements or the entire environment after analysis, e.g. via `saveRDS` or `save.image` to always have it accessable if needed. sorry, my bad

I think you're reading ?goana.DGELRT rather than ?goana. Type methods(goana) to see the methods available. The default method supports an atomic vector of gene IDs.

In general, when I can, I try to write R code that has an entry point using base R objects as well as an object-orientated entry point.

1 answer

I assume that the differential results table is complete and contains all expressed genes rather than just the 12 genes shown in your post. I also assume that there are some significantly DE genes and that FDR < 0.05 is an appropriate DE cutoff.

If you don't want to separate DE genes by direction of change then

library(limma)
Results <- read.csv("mycsvfile.csv")
Universe <- as.character(Results$ENTREZID)
DE <- Universe[ Results$FDR < 0.05 ]
g <- goana(DE, Universe)
topGO(g)

If you do want to separate genes by direction of change (recommended) then

library(limma)
Results <- read.csv("mycsvfile.csv")
Universe <- as.character(Results$ENTREZID)
Up <- Universe[ Results$logFC > 0 & Results$FDR < 0.05 ]
Dn <- Universe[ Results$logFC < 0 & Results$FDR < 0.05 ]
g <- goana(list(Up=Up,Dn=Dn), Universe)
topGO(g)

Log in to answer this question.