Skip to content

Commit

Permalink
fix gseaplot2
Browse files Browse the repository at this point in the history
  • Loading branch information
zqfang committed Feb 23, 2024
2 parents 0c2b136 + d3addfe commit 652eb44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions gseapy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,15 @@ def _load_data(self, exprs: Union[str, pd.Series, pd.DataFrame]) -> pd.DataFrame
elif isinstance(exprs, pd.Series):
# change to DataFrame
self._logger.debug("Input data is a Series with gene names")
if exprs.name is None:
# rename col if name attr is none
exprs.name = "sample1"
elif exprs.name.dtype != "O":
exprs.name = exprs.name.astype(str)
if not isinstance(exprs.name, str):
if exprs.name is None:
# rename col if name attr is none
exprs.name = "sample1"
elif hasattr(exprs.name, "dtype"):
if exprs.name.dtype != "O":
exprs.name = exprs.name.astype(str)
else:
exprs.name = str(exprs.name)
rank_metric = exprs.reset_index()
elif os.path.isfile(exprs):
rank_metric = self._read_file(exprs)
Expand Down
2 changes: 1 addition & 1 deletion gseapy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ def axes_hits(
trans2 = transforms.blended_transform_factory(ax2.transData, ax2.transAxes)
# align hits to runes
ax2.vlines(
[0, len(self.runes) - 1],
[1, len(self.runes[0])],
0,
1,
linewidth=0.5,
Expand Down

0 comments on commit 652eb44

Please sign in to comment.