Finding significant up-regulated and down-regulated genes given a log2FoldChange threshold

I have a result from which I want to get significant genes (pvalue-threshold=0.1, log2FoldChange threshold 1.5), and divide them into up-regulated and down-regulated.

From the vignette, I found the following on down-regulation and up-regulation:

subset the results table to these genes and then sort it by the log2
fold change estimate to get the significant genes with the strongest
down-regulation:

resSig <- subset(res, padj < 0.1)     
head(resSig[order(resSig$log2FoldChange), ])

…and with the strongest up-regulation:

head(resSig[ order(resSig$log2FoldChange, decreasing = TRUE), ])

So, based on this, I wanted to ask whether I can achieve correctly what I have mentioned above by the following or not:

resSig <- subset(res, padj < 0.1)
up_regulated <- subset(resSig, log2FoldChange > 1.5)
down_regulated <- subset(resSig, log2FoldChange < 1.5)

Kindly guide if this is a wrong approach.

Read more here: Source link