<p>I guess it is too late to answer this now, but I think you can use <code>gseapy</code>. Its a <code>python</code> module for performing enrichment analysis. Just install it with:</p>
<blockquote>
<p><code>pip install gseapy</code></p>
</blockquote>
<p>There is also a tutorial of sorts on <code>Medium</code>
<a href="https://medium.com/omics-diary/how-to-use-gseapy-for-pathway-enrichment-analysis-67a1aab1002d" rel="nofollow noreferrer">https://medium.com/omics-diary/how-to-use-gseapy-for-pathway-enrichment-analysis-67a1aab1002d</a>.</p>

CC BY-SA 4.0
2024-07-17T17:24:37.270Z
2024-07-17T17:24:37.270Z
Eshaan IITM
<p>I want to do pathway enrichment analysis in python using <code>scipy.stats.hypergeom.sf function</code> to select pathways that are significantly enriched in at least one tissue.</p>
<p>my data:</p>
<pre><code>Enrichment  CANCER_TYPE PATHWAY
11.6    Breast Carcinoma    Cell cycle/DNA replication
2   Breast Carcinoma    Protein stability and degradation/DNA replication
2.8 Breast Carcinoma    EGFR signaling/DNA replication
4   Breast Carcinoma    p53 pathway/DNA replication
0   Breast Carcinoma    PI3K/MTOR signaling/DNA replication
1.2 Pancreatic Carcinoma    Mitosis/RTK signaling
3.3 Pancreatic Carcinoma    EGFR signaling/RTK signaling
</code></pre>

CC BY-SA 4.0
2022-04-18T20:41:34.580Z
what is "Enrichment"? usually this kind of data comes in the form of a list of genes with annotations and some sort of background set of annotations for genes in a genome. At a minimum, we would expect some count of genes/gene annotations, which is necessary to get the numbers to plug into a hypergeometric test. Different tools will count annotations differently, perhaps tell us more about where your data table comes from?
Maximilian Press
CC BY-SA 4.0
2022-04-19T03:21:07.297Z
Could you please add some more detail to your question? Context helps a lot. It's great that you've included input data, but we don't know how that data is generated, or what the 'Enrichment' field means.
gringer
<python><r><scipy>
How to do enrichment analysis with scipy.stats.hypergeom.sf function
# How to do enrichment analysis with scipy.stats.hypergeom.sf function

(Asked by: username_0 on 2022-04-18)

I want to do pathway enrichment analysis in python using scipy.stats.hypergeom.sf function to select pathways that are significantly enriched in at least one tissue.
my data:
Enrichment  CANCER_TYPE PATHWAY
11.6    Breast Carcinoma    Cell cycle/DNA replication
2   Breast Carcinoma    Protein stability and degradation/DNA replication
2.8 Breast Carcinoma    EGFR signaling/DNA replication
4   Breast Carcinoma    p53 pathway/DNA replication
0   Breast Carcinoma    PI3K/MTOR signaling/DNA replication
1.2 Pancreatic Carcinoma    Mitosis/RTK signaling
3.3 Pancreatic Carcinoma    EGFR signaling/RTK signaling

**Tags:** python, r, scipy
> **Comments:**
> **username_1**: what is "Enrichment"? usually this kind of data comes in the form of a list of genes with annotations and some sort of background set of annotations for genes in a genome. At a minimum, we would expect some count of genes/gene annotations, which is necessary to get the numbers to plug into a hypergeometric test. Different tools will count annotations differently, perhaps tell us more about where your data table comes from?  
> **username_2**: Could you please add some more detail to your question? Context helps a lot. It's great that you've included input data, but we don't know how that data is generated, or what the 'Enrichment' field means.  

---

## 1 answers

### Answer by username_3 on 2024-07-17. Score: 1

I guess it is too late to answer this now, but I think you can use `gseapy`. Its a `python` module for performing enrichment analysis. Just install it with:

> `pip install gseapy`

There is also a tutorial of sorts on `Medium`
<https://medium.com/omics-diary/how-to-use-gseapy-for-pathway-enrichment-analysis-67a1aab1002d>.


---

