Skip to content

Commit

Permalink
input format check, #250
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoqing Fang authored and Zhuoqing Fang committed Dec 16, 2024
1 parent ee20565 commit 7d16d76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gseapy/gsea.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7d16d76

Please sign in to comment.