-
Notifications
You must be signed in to change notification settings - Fork 122
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
JSONDecodeError when using a small background list #300
Comments
I can't reproduce the bug on my end. Can you re-run the code and try again ? I use macOS M3 chip |
I'm still able to reproduce the same error when I swap the gene set to
Another way to reproduce a similar JSONDecodeError is be to replace background with the original
You should run into the same mathematical error FWIW I'm on Apple M3 Max chip. Thanks! |
Huh did you find the following record from your output? And I suppose the json module in python doesn't support decoding infinity
|
We are on the same version. How about simplejson?
|
Thanks for checking! Would you be able to support simplejson as well? According to this, |
simplejson is an optional dependency for requests. I think you can submit an issue for simplejson/requests team to fix this |
Thanks for the quick reply! The simplejson module recently updated the default value of allow_nan from True to False in its latest version. Supporting Looking at the documentation for both simplejson and the built-in json module, we can simply add |
thanks. but allow_nan break my codebase. I revert it back to default
|
Does the following work?
|
I think the better solution is this: data = json.loads(response.content) I prefer to use the build-in library instead of testing the new |
Setup
I am reporting a problem with GSEApy version, Python version, and operating
system as follows:
Expected behaviour
The above is directly copied from the gseapy documentation using the same gene_list and background as provided. However, it raises an error when I switched to
gene_set=['MGI_Mammalian_Phenotype_2017']
(see below).Actual behaviour
Steps to reproduce
Just switch out the
gene_sets
param from the above example and it should hit theJSONDecodeError
.Looking at the response.text object, some results apparently look like this:
I think the two
Infinity
values are the offending ones here. I think they represent the odds ratio and combined scores here? Presumably, this happens because the background gene list does not contain any of the genes in the given gene set.This becomes a much bigger problem when analyzing gene sets from proteomics experiments, which typically detect far fewer than 10k genes.
Thanks!
The text was updated successfully, but these errors were encountered: