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))