zqfang / GSEApy

Gene Set Enrichment Analysis in Python
http://gseapy.rtfd.io/
BSD 3-Clause "New" or "Revised" License
574 stars 119 forks source link

Use Requests library #41

Closed cthoyt closed 6 years ago

cthoyt commented 6 years ago

I have a good feeling that the python2/3 switching can be made much easier with the requests library.

https://github.com/BioNinja/GSEApy/blob/033b7b8361437847bffdb4be82d621472ee12b65/gseapy/parser.py#L154-L165

This could become:

response = requests.get('http://amp.pharm.mssm.edu/Enrichr/geneSetLibrary?mode=meta')
gmt_data = response.json()

And this already takes care of python2/3 abstraction :) I'd be happy to submit a PR!

cthoyt commented 6 years ago

Edit: It looks like I'm going blind, because you've already done this and that was commented specifically as old code 😅

zqfang commented 6 years ago

Thanks for you contribution. I should have deleted the old code to make API more clear. We could improve other parts if you'd like to contribute.