Skip to content

Commit

Permalink
added small eps to np.log
Browse files Browse the repository at this point in the history
  • Loading branch information
artemy-bakulin authored Apr 30, 2024
1 parent 8b436f6 commit 1867251
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypage/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ def _gather_results(self) -> pd.DataFrame:
"""Gathers the results from the experiment into a single dataframe
"""
# estimate sign
self.log_overrep_pvals = np.log10(self.overrep_pvals)
self.log_underrep_pvals = np.log10(self.underrep_pvals)
self.log_overrep_pvals = np.log10(self.overrep_pvals + 1e-8)
self.log_underrep_pvals = np.log10(self.underrep_pvals + 1e-8)
self.graphical_ar = np.minimum(self.log_overrep_pvals, self.log_underrep_pvals)
self.graphical_ar[self.log_overrep_pvals < self.log_underrep_pvals] *= -1 # make overrepresented positive
n_bins = self.graphical_ar.shape[1]
Expand Down Expand Up @@ -455,4 +455,4 @@ def get_es_matrix(self):
return pd.DataFrame(
hm._subset_and_sort_pathways()[1],
index=hm._subset_and_sort_pathways()[0]
)
)

0 comments on commit 1867251

Please sign in to comment.