This is a test version of Biostars. For the public version, visit https://www.biostars.org.
To order list of genes

Hello, I obtained my list of genes after DESeq2 and I want to order my list of genes based on up and downregulation. Do you recommend me any command or pacakge which enables me to order my list of genes?

deg

If, let's say, you stored your full list of DEGs in a variable called res, you can simply do so:

#for UP DEGs with logFC threshold >= 1 and significant at adjusted p-value <= 0.05
degenes_up <- subset(res, res$padj <= 0.05 & res$log2FoldChange >= 1)

#for DOWN DEGs with logFC threshold <= -1 and significant at adjusted p-value <= 0.05
degenes_down <- subset(res, res$padj <= 0.05 & res$log2FoldChange <= -1)

Naturally, adjust the logFC threshold based on your preferences.

Ironically, this command is called order:

data(mtcars)
mtcars[order(mtcars$qsec),]

See ?order for details.

1 answer

i would just drop any with an adjusted p-value below some threshold (depending on how many DGE I have) then sort based on log2FC.

just do it in R:subset(dge[order(dge$log2FC, decreasing=TRUE),],p.adjust <= 0.5) for up-reg etc...

Log in to answer this question.