<p>The scenario you described would be reported by the code because:</p>
<pre><code>... [abs(geneList) &gt; 2]
</code></pre>
<p>The <code>abs</code> will change any negative value to positive and retain all positive values as positive. Therefore values &lt;-2 will be reported as well as values &gt;2. <code>abs</code> = absolute and to take the absolute value of a number is exactly the operation just described.</p>
<hr />
<p>From comments. Just remove <code>abs</code></p>
<pre><code>negative &lt;- names(geneList)[geneList &lt; -2]
positive &lt;- names(geneList)[geneList &gt; 2]
</code></pre>

CC BY-SA 4.0
2023-08-06T22:25:34.013Z
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?
Sylvia Rodriguez
CC BY-SA 4.0
2023-08-07T03:02:40.107Z
@SylviaRodriguez addressed in the comments
M__
CC BY-SA 4.0
2023-08-08T21:38:35.727Z
Thank you. I like that solution. Two separate analyses.
Sylvia Rodriguez
CC BY-SA 4.0
2023-08-08T21:45:08.433Z
Thanks @SylviaRodriguez I'm glad its resolved.
M__
CC BY-SA 4.0
2023-08-06T22:10:33.040Z
2023-08-07T03:02:23.450Z
2023-08-07T03:02:23.450Z
M__
<p>I am using clusterProfiler for differential gene expression using this code:
<a href="https://yulab-smu.top/biomedical-knowledge-mining-book/enrichplot.html" rel="nofollow noreferrer">https://yulab-smu.top/biomedical-knowledge-mining-book/enrichplot.html</a></p>
<p>I have a question about the third line of code:</p>
<pre><code> de &lt;- names(geneList)[abs(geneList) &gt; 2]
</code></pre>
<p>Here all gene names are taken with absolute fold change &gt;2. As an example, if in a hypothetical extreme case you have 100 downregulated genes (log2 fold change &lt;-2) and zero upregulated genes (log2 fold change &gt;2), then you may incorrectly think that identified pathways are activated, but they are actually repressed. How is this accounted for? Thank you.</p>

CC BY-SA 4.0
2023-08-06T22:08:34.790Z
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).
M__
CC BY-SA 4.0
2023-08-06T22:26:44.880Z
I agree with you :)
Sylvia Rodriguez
<r><differential-expression><gene-expression><pathway><clusterprofiler>
Interpretation of clusterProfiler results
# Interpretation of clusterProfiler results

(Asked by: username_0 on 2023-08-06)

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.

**Tags:** r, differential-expression, gene-expression, pathway, clusterprofiler
> **Comments:**
> **username_1**: 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).  
> **username_0**: I agree with you :)  

---

## 1 answers

### Answer by username_1 on 2023-08-06. Score: 1 | Accepted answer

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]

> **Comments:**
> **username_0**: 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?  
> **username_1**: @SylviaRodriguez addressed in the comments  
> **username_0**: Thank you. I like that solution. Two separate analyses.  
> **username_1**: Thanks @SylviaRodriguez I'm glad its resolved.  

---

