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

Inconsistent get_library_name and gp.enrichr for Yeast database #98

Closed
anfoss opened this issue May 1, 2020 · 2 comments
Closed

Inconsistent get_library_name and gp.enrichr for Yeast database #98

anfoss opened this issue May 1, 2020 · 2 comments

Comments

@anfoss
Copy link

anfoss commented May 1, 2020

Setup

I am analyzing some yeast data and I noticed a inconsistency between the libraries retrieved by get_library name() and the enrichr API.

import sys; print(sys.version)
3.7.4 (default, Aug 13 2019, 15:17:50
import platform; print(platform.python_implementation()); print(platform.platform())
CPython
Darwin-16.7.0-x86_64-i386-64bit
import gseapy; print(gseapy.__version__)
0.9.17

Expected behaviour

Raise an Exception not sys.exit(1)

Actual behaviour

Not validated Enrichr library name provided
Hint: use get_library_name() to view full list of supported names(base)
sis.exit(1)

Steps to reproduce

 nms = ['CDC28']
    for gene_libr in gp.get_library_name(database='Yeast'):
        outfile = 'test'
        enr = gp.enrichr(gene_list=nms,
                         gene_sets=gene_libr,
                         outdir=outfile,
                         cutoff=1,
                         verbose=True)

not working all the .AutoRIF. plus others.
I noticed that in line 340 of https://github.com/zqfang/GSEApy/blob/master/gseapy/enrichr.py

        if len(gss) < 1:
            sys.stderr.write("Not validated Enrichr library name provided\n")
            sys.stdout.write("Hint: use get_library_name() to view full list of supported names")
            sys.exit(1)

I propose to change it with

        if len(gss) < 1:
            sys.stderr.write("Not validated Enrichr library name provided\n")
            sys.stdout.write("Hint: use get_library_name() to view full list of supported names")
            raise LookupError

I know you could catch sys.exit() but it would be more pythonic to raise an Exception.

@zqfang
Copy link
Owner

zqfang commented May 2, 2020

@fossatiA Thanks, I think need to set

gp.enrichr( ...
                    organism='Yeast'
                   ...)

But you are right, this is not intuitive with additional keyword organism
I've add some hints if user did not use the default organism

zqfang added a commit that referenced this issue May 2, 2020
@anfoss
Copy link
Author

anfoss commented May 2, 2020

Worked like a charm, thanks. I'm closing this issue

@anfoss anfoss closed this as completed May 2, 2020
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

2 participants