From 1d0b4c46684273688e53705e9b3f27dfe8d3080b Mon Sep 17 00:00:00 2001 From: quasi_deus <64697792+quasi-deus@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:23:21 +0530 Subject: [PATCH] fix: throw error for empty gene lists in enrich --- gseapy/enrichr.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gseapy/enrichr.py b/gseapy/enrichr.py index cfda38f..01b892f 100644 --- a/gseapy/enrichr.py +++ b/gseapy/enrichr.py @@ -186,6 +186,9 @@ def parse_genelists(self) -> str: for gene in f: genes.append(gene.strip()) + if not genes: + raise ValueError("Gene list cannot be empty") + self._isezid = all(map(self._is_entrez_id, genes)) if self._isezid: self._gls = set(map(int, genes))