Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add kws for quiet printing throughout the library #133

Closed
AoifeHughes opened this issue Jul 25, 2019 · 6 comments
Closed

Enhancement: Add kws for quiet printing throughout the library #133

AoifeHughes opened this issue Jul 25, 2019 · 6 comments

Comments

@AoifeHughes
Copy link

AoifeHughes commented Jul 25, 2019

Hi,

Minor issue, if encorperating goatools into other pipelines it can get quite messy with the large volumes of printing. I propose a key-word argument to disable them.

For example insertion of one line (and 1 indent) would be sufficient at each command which outputs: forked example of 1 particularly verbose output

if this is something which would be considered I can properly implement and make a pull request.

@dvklopfenstein
Copy link
Collaborator

dvklopfenstein commented Jul 25, 2019

Having a quiet option is a terrific idea!

Please do implement the code, if you are comfortable doing so. Before doing the pull request, please be sure that all the files that you edited pass pylint on the lines that you edited and run all the tests using:

$ make pytest

Thank you for your interest in GOATOOLS, for taking the time to write us, and for tackling the task of adding this code.

dvklopfenstein added a commit that referenced this issue Sep 30, 2019
@dvklopfenstein
Copy link
Collaborator

dvklopfenstein commented Sep 30, 2019

I have submitted some changes to address this issue (not in the enrichment area yet). These changes are preliminary with more to follow. I don't currently have time to modify the code in all places at once, but will attack it piece by piece as it comes up with current tests and functionality. Thank you so much for the great idea. If you have any further feedback, please feel free to leave specific details.

@BenjaSanchez
Copy link

BenjaSanchez commented Mar 12, 2020

Just wanted to support this issue: I'm using run_study in a jupyter notebook within a Github repo, and it's virtually impossible to track changes with so much output. Also some lines of the output keep changing in format like in here, not sure if that is intended behavior.

In the meantime I switched to the forked version of @SirSharpest and after adding an additional commit to enable **kvargs when calling run_study with the GOEnrichmentStudyNS object (see my fork) works like a charm, thank you!

@dvklopfenstein
Copy link
Collaborator

@BenjaSanchez,

Thank you so much for your interest in GOATOOLS and taking the time to write us to vote for expanding quiet mode to the run_goea function.

By default, we are verbose to prevent missing anything, but we wholeheartedly support quiet modes to be run upon user request.

I have added quiet mode to the run_goea function and added a new section, 5a. Quietly Run a GOEA, to the Jupyter notebook which shows that run_goea can be run quietly by adding the prt=None argument as follows:

run_study(geneids_study, prt=None)

rather than:

run_study(geneids_study)

See the Jupyter notebook for the full example. But for more context:

# Run a Gene Ontology Enrichment Analysis
goeaobj = GOEnrichmentStudyNS( ..., methods=['fdr_bh'])
goea_quiet_all = goeaobj.run_study(geneids_study, prt=None)

# Extract the significant GOEA results
goea_quiet_sig = [r for r in goea_results_all if r.p_fdr_bh < 0.05]

Since the run_goea is so quiet, I have also added examples in the Jupyter notebook under the 5a section in Print customized results summaries so that researchers can choose to print their own more succinct GOEA summary.

@tanghaibao, can you release a new version of GOATOOLS once the regression tests have passed? Many people have been asking for this, so it would be helpful to release it ASAP.

@tanghaibao
Copy link
Owner

@dvklopfenstein

Updated to v1.0.3 and released on PyPI.

@BenjaSanchez
Copy link

@dvklopfenstein prt=None works perfectly, thanks for adding the feature! My notebooks appreciate it a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants