Skip to content

Commit

Permalink
print the params into header (from dvklopfenstein)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Mar 19, 2015
1 parent 66ba804 commit d611c25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 5 additions & 3 deletions goatools/go_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ def run_study(self, study):

pop_n, study_n = len(self.pop), len(study)

#Uncomment these to cause tests/test_enrichment_fdr.py to pass:
#study_count = 0
#pop_count = 0
# Init study_count and pop_count to handle empty sets
study_count = pop_count = 0
for term, study_count in list(term_study.items()):
pop_count = self.term_pop[term]
p = fisher.pvalue_population(study_count, study_n,
Expand Down Expand Up @@ -160,6 +159,9 @@ def update_results(self, method, corrected_pvals):
rec.__setattr__("p_"+method, val)

def print_summary(self, min_ratio=None, indent=False, pval=0.05):
# Header contains parameters
print("# min_ratio={0} pval={1}".format(min_ratio, pval))

# field names for output
print("\t".join(GOEnrichmentRecord()._fields))

Expand Down
2 changes: 1 addition & 1 deletion goatools/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.3"
__version__ = "0.5.4"
2 changes: 0 additions & 2 deletions scripts/find_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,3 @@ def check_bad_args(args):
g = GOEnrichmentStudy(pop, assoc, obo_dag, alpha=opts.alpha,
study=study, methods=methods)
g.print_summary(min_ratio=min_ratio, indent=opts.indent, pval=opts.pval)
print('pval={}'.format(opts.pval))
print('min_ratio={}'.format(min_ratio))

0 comments on commit d611c25

Please sign in to comment.