diff --git a/gseapy/gsea.py b/gseapy/gsea.py index b910eba..80817c5 100644 --- a/gseapy/gsea.py +++ b/gseapy/gsea.py @@ -518,6 +518,12 @@ def load_ranking(self): parse rnk input """ rank_metric = self._load_data(self.rnk) # gene id is the first column + # only two column dataframe is accepted + if rank_metric.shape[1] > 2: + raise ValueError( + "Input gene rankings should be a two column dataframe, " + + "with the first column as gene names and the second column as prerank values." + ) if rank_metric.select_dtypes(np.number).shape[1] == 1: # return series return self._load_ranking(rank_metric)