Skip to content

Commit

Permalink
Change fnc name to more accurately descriptive: print_summary->print_…
Browse files Browse the repository at this point in the history
…date.
  • Loading branch information
dvklopfenstein committed Oct 13, 2018
1 parent 5e1f05c commit 329dadb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion goatools/cli/find_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def _prt_results(self, goea_results):
if min_ratio is not None:
assert 1 <= min_ratio <= 2
# print("MMMMMMMMMMMMMMMMMMMMMM", min_ratio)
self.objgoea.print_summary(min_ratio=min_ratio, pval=self.args.pval)
self.objgoea.print_date(min_ratio=min_ratio, pval=self.args.pval)
results_adj = self.objgoea.get_adj_records(goea_results, min_ratio, self.args.pval)
if results_adj:
#### kws = {'indent':self.args.indent, 'itemid2name':self.itemid2name}
Expand Down
4 changes: 2 additions & 2 deletions goatools/go_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def get_prtflds_default(results):
return []

@staticmethod
def print_summary(min_ratio=None, pval=0.05):
"""Print summary."""
def print_date(min_ratio=None, pval=0.05):
"""Print GOATOOLS version and the date the GOEA was run."""
import goatools

# Header contains provenance and parameters
Expand Down
4 changes: 4 additions & 0 deletions goatools/ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def is_ratio_different(min_ratio, study_go, study_n, pop_go, pop_n):
return True
stu_ratio = float(study_go) / study_n
pop_ratio = float(pop_go) / pop_n
if stu_ratio == 0.0:
stu_ratio = 0.0000001
if pop_ratio == 0.0:
pop_ratio = 0.0000001
if stu_ratio > pop_ratio:
return stu_ratio / pop_ratio > min_ratio
return pop_ratio / stu_ratio > min_ratio
Expand Down
3 changes: 2 additions & 1 deletion tests/test_goea_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def test_goea_fdr_dflt():
study_fin = "{REPO}/tests/data/small_study".format(REPO=REPO)
study_ids = [line.rstrip() for line in open(study_fin)]
goea_results = goeaobj.run_study(study_ids)
goeaobj.print_summary(goea_results)
goeaobj.print_results(goea_results)
goeaobj.print_date()

def test_goea_local(log=sys.stdout):
"""Test GOEA with local multipletest correction methods for local."""
Expand Down
1 change: 1 addition & 0 deletions tests/test_print_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_example():
goea_results_sig = [r for r in goea_results_all if r.p_fdr_bh < 0.05]
#goea_results_nt = MgrNtGOEAs(goea_results_sig).get_goea_nts_all()
goeaobj.print_results(goea_results_sig)
goeaobj.print_date()


if __name__ == '__main__':
Expand Down

0 comments on commit 329dadb

Please sign in to comment.