diff --git a/gseapy/gsea.py b/gseapy/gsea.py index 1e450a7..3610d55 100644 --- a/gseapy/gsea.py +++ b/gseapy/gsea.py @@ -410,6 +410,10 @@ def run(self): self._heatmat(df=dat.iloc[gsum.indices[0]], classes=self.groups) # write output and plotting self.to_df(gsum.summaries, gmt, self.ranking) + if self._outdir is not None: + self.ranking.to_csv( + os.path.join(self.outdir, "gsea_data.rnk"), sep="\t", header=False + ) self._logger.info("Congratulations. GSEApy ran successfully.................\n") return @@ -582,8 +586,8 @@ def run(self): indices=gsum.indices if isinstance(dat2, pd.DataFrame) else None, ) if self._outdir is not None: - self._logger.info( - "Start to generate gseapy reports, and produce figures..." + self.ranking.to_csv( + os.path.join(self.outdir, "prerank_data.rnk"), sep="\t", header=False ) self._logger.info("Congratulations. GSEApy runs successfully................\n")