I am using clusterProfiler for differential gene expression using this code: https://yulab-smu.top/biomedical-knowledge-mining-book/enrichplot.html

I have a question about the third line of code:

 de <- names(geneList)[abs(geneList) > 2]

Here all gene names are taken with absolute fold change >2. As an example, if in a hypothetical extreme case you have 100 downregulated genes (log2 fold change <-2) and zero upregulated genes (log2 fold change >2), then you may incorrectly think that identified pathways are activated, but they are actually repressed. How is this accounted for? Thank you.

  • 1
    $\begingroup$ Hypothetical scenarios don't make the best questions, but this question's ok. Do keep in mind this is differential gene expression rather than explicitly being repression (don't always intersect). $\endgroup$
    – M__
    Aug 6, 2023 at 22:08
  • 1
    $\begingroup$ I agree with you :) $\endgroup$ Aug 6, 2023 at 22:26

1 Answer 1


The scenario you described would be reported by the code because:

... [abs(geneList) > 2]

The abs will change any negative value to positive and retain all positive values as positive. Therefore values <-2 will be reported as well as values >2. abs = absolute and to take the absolute value of a number is exactly the operation just described.

From comments. Just remove abs

negative <- names(geneList)[geneList < -2]
positive <- names(geneList)[geneList > 2]
  • $\begingroup$ Thank you for your feedback M__. Yes, this operation selects all genes with >2 and all genes with <-2 fold change in expression. However, none of the values are themselves retained. It is only the names of the genes that are taken forward to the next step. Therefore, the direction (- or +) is lost after this step. In other words, if you have gene A +8 fold change, gene B +3 and gene C +2.4, then the end result is the same if gene A had been -6.2 fold change, gene B -2.4 and gene C +2.1. I suppose I conclude that we are looking at representation, rather than at up/downregulated pathways? $\endgroup$ Aug 6, 2023 at 22:25
  • $\begingroup$ @SylviaRodriguez addressed in the comments $\endgroup$
    – M__
    Aug 7, 2023 at 3:02
  • 1
    $\begingroup$ Thank you. I like that solution. Two separate analyses. $\endgroup$ Aug 8, 2023 at 21:38
  • 1
    $\begingroup$ Thanks @SylviaRodriguez I'm glad its resolved. $\endgroup$
    – M__
    Aug 8, 2023 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.