MaayanLab / enrichr_issues

5 stars 3 forks source link

EnrichR server and libraries not working #80

Closed karenlawwc closed 8 months ago

karenlawwc commented 8 months ago

Hi, I have been encountering an error when trying to run gseapy.enrichr on python.

I keep getting this bug "Exception: Error getting the Enrichr libraries" when trying to run gseapy.enrichr(degs_up.names, gene_sets='MSigDB_Hallmark_2020', outdir=None) and also just to get the libraries gseapy.get_library_name()

Please help to get the server and libraries up again. Thanks!

madhavmantri commented 8 months ago

I am also getting the following error when calling enrichr from gseapy:

File ~/.local/lib/python3.9/site-packages/gseapy/__init__.py:554, in enrichr(gene_list, gene_sets, organism, outdir, background, cutoff, format, figsize, top_term, no_plot, verbose)
    552 # set organism
    553 enr.set_organism()
--> 554 enr.run()
    556 return enr

File ~/.local/lib/python3.9/site-packages/gseapy/enrichr.py:570, in Enrichr.run(self)
    567 genes_list = self.parse_genelists()
    569 # self._logger.info("Connecting to Enrichr Server to get latest library names")
--> 570 gss = self.parse_genesets()
    571 if len(gss) < 1:
    572     self._logger.error(
    573         "None of your input gene set matched ! %s" % self.gene_sets
    574     )

File ~/.local/lib/python3.9/site-packages/gseapy/enrichr.py:141, in Enrichr.parse_genesets(self, gene_sets)
    139 # if all local gmts (local mode), skip connect to enrichr server
    140 if not all([isinstance(g, dict) for g in gss]):
--> 141     enrichr_library = self.get_libraries()
    143 # check enrichr libraries are valid
    144 for n, g in zip(self._gs_name, gss):

File ~/.local/lib/python3.9/site-packages/gseapy/enrichr.py:368, in Enrichr.get_libraries(self)
    366 response = s.get(lib_url, verify=True)
    367 if not response.ok:
--> 368     raise Exception("Error getting the Enrichr libraries")
    369 libs_json = json.loads(response.text)
    370 libs = [lib["libraryName"] for lib in libs_json["statistics"]]

Exception: Error getting the Enrichr libraries
AviMaayan commented 8 months ago

It should be fixed. Thank you for letting us know.

karenlawwc commented 8 months ago

Thanks for the quick fix!

madhavmantri commented 8 months ago

Thank you!