Entering edit mode
14 months ago
Jen
▴
80
I am trying to run Enrichr in python using a background gene list as per https://gseapy.readthedocs.io/en/latest/gseapy_example.html (2.3.2.2. Enrichr Web Service (with background input)). I got the following to work without specifying a background:
enr_bg = gp.enrichr(gene_list="3383CCGs.txt",
gene_sets=['KEGG_2019_Mouse'],
outdir=None
)
But then I try add the background argument to the script and it doesn't work:
enr_bg_back_KEGG = gp.enrichr(gene_list="3383CCGs.txt",
gene_sets=['KEGG_2019_Mouse'],
background="Background13569.txt",
outdir=None,
)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [23], in <cell line: 1>()
----> 1 enr_bg_back_KEGG = gp.enrichr(gene_list="3383CCGs.txt",
2 gene_sets=['KEGG_2019_Mouse'],
3 background="Background13569.txt",
4 outdir=None,
5 )
TypeError: enrichr() got an unexpected keyword argument 'background'
Any ideas on how to input the background list into the command??
Paths are correct. I have no idea why it's not working. Very strange. Maybe it's something to do with it being mouse? Don't know why that should make a difference.
It should work no matter what species it is. I saw your corresponding R code in other POST. Please so spend some time in basic R and Python; you will get there.
Selecting MOUSE gene set libraries in Enrichr
The reason it was not working is because I had a previous version of gseapy installed (0.9.5) which does not allow use of background gene list. I upgraded gseapy to version '1.0.6' and it worked to solve my issue.