diff --git a/examples/SimpleExample.ipynb b/examples/SimpleExample.ipynb index 72a0776..4da31e2 100644 --- a/examples/SimpleExample.ipynb +++ b/examples/SimpleExample.ipynb @@ -28,119 +28,17 @@ "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "INFO:root:Running on single file input\n", - "INFO:root:polling results\n", - "INFO:root: elapsed {12.717187881469727}\n" + "ename": "TypeError", + "evalue": "_auto_retry() missing 1 required positional argument: 'uri'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtest\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mevaluate_file_folder\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mr'VantVeerMoreLess5.txt'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mtest\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mhead\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\pyGOrilla\\pyGOrilla.py\u001b[0m in \u001b[0;36mevaluate_file_folder\u001b[1;34m(self, filein, outfilename)\u001b[0m\n\u001b[0;32m 76\u001b[0m \u001b[1;32mexcept\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 77\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'Failed reading input file!'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 78\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mevaluate_list\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtargets\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moutfilename\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 79\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 80\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexists\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32mC:\\ProgramData\\Anaconda3\\lib\\site-packages\\pyGOrilla\\pyGOrilla.py\u001b[0m in \u001b[0;36mevaluate_list\u001b[1;34m(self, targets, outfilename)\u001b[0m\n\u001b[0;32m 43\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlogger\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minfo\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'polling results'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 44\u001b[0m \u001b[1;32mwhile\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mpoll_done\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 45\u001b[1;33m \u001b[0mresponse2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mGOrillaEvaluator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_auto_retry\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murl\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 46\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mresponse2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstatus_code\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;36m200\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 47\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;34m\"Calculating Enrichment\"\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mresponse2\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mTypeError\u001b[0m: _auto_retry() missing 1 required positional argument: 'uri'" ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
GO termDescriptionP-valueFDR q-valueEnrichment (N, B, n, b)Genes
1GO:0022402cell cycle process7.28E-191.06E-142.73 (9106,611,552,101)\\n[+] Show genes\\n \\r\\nRFC4 - replication fa...
2GO:1903047mitotic cell cycle process1.04E-167.58E-133.00 (9106,399,593,78)\\n[+] Show genes\\n \\r\\nDONSON - downstream n...
3GO:0007346regulation of mitotic cell cycle1.04E-125.06E-93.89 (9106,430,218,40)\\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid...
4GO:0010564regulation of cell cycle process6.64E-122.42E-83.46 (9106,512,221,43)\\n[+] Show genes\\n \\r\\nPRC1 - protein regula...
5GO:1901990regulation of mitotic cell cycle phase transition4.44E-111.29E-74.45 (9106,284,216,30)\\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid...
\n", - "
" - ], - "text/plain": [ - " GO term Description P-value \\\n", - "1 GO:0022402 cell cycle process 7.28E-19 \n", - "2 GO:1903047 mitotic cell cycle process 1.04E-16 \n", - "3 GO:0007346 regulation of mitotic cell cycle 1.04E-12 \n", - "4 GO:0010564 regulation of cell cycle process 6.64E-12 \n", - "5 GO:1901990 regulation of mitotic cell cycle phase transition 4.44E-11 \n", - "\n", - " FDR q-value Enrichment (N, B, n, b) \\\n", - "1 1.06E-14 2.73 (9106,611,552,101) \n", - "2 7.58E-13 3.00 (9106,399,593,78) \n", - "3 5.06E-9 3.89 (9106,430,218,40) \n", - "4 2.42E-8 3.46 (9106,512,221,43) \n", - "5 1.29E-7 4.45 (9106,284,216,30) \n", - "\n", - " Genes \n", - "1 \\n[+] Show genes\\n \\r\\nRFC4 - replication fa... \n", - "2 \\n[+] Show genes\\n \\r\\nDONSON - downstream n... \n", - "3 \\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid... \n", - "4 \\n[+] Show genes\\n \\r\\nPRC1 - protein regula... \n", - "5 \\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid... " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ diff --git a/pyGOrilla/pyGOrilla.py b/pyGOrilla/pyGOrilla.py index ca5f463..11c115e 100644 --- a/pyGOrilla/pyGOrilla.py +++ b/pyGOrilla/pyGOrilla.py @@ -42,7 +42,7 @@ def evaluate_list(self, targets, outfilename=None): if response.status_code == 200: self.logger.info('polling results') while not poll_done: - response2 = GOrillaEvaluator._auto_retry(response.url) + response2 = self._auto_retry(response.url) if response2.status_code == 200: if "Calculating Enrichment" not in response2.text: poll_done = True diff --git a/setup.py b/setup.py index eaf02bb..d6fefea 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,13 @@ setup( name = 'pyGOrilla', # How you named your package folder (MyLib) packages = ['pyGOrilla'], # Chose the same as "name" - version = '0.1.4', # Start with a small number and increase it with every change you make + version = '0.1.5', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository description = 'Python wrapper for GOrilla - gene ontology enrichment for ranked gene lists', # Give a short description about your library author = 'Shay Ben-Elazar', # Type in your name author_email = 'shaybenelazar@hotmail.com', # Type in your E-Mail url = 'https://github.com/YakhiniGroup/PyGOrilla', # Provide either the link to your github or to your website - download_url = 'https://github.com/YakhiniGroup/PyGOrilla/archive/v1.4.tar.gz', # I explain this later on + download_url = 'https://github.com/YakhiniGroup/PyGOrilla/archive/v1.5.tar.gz', # I explain this later on keywords = ['mHG', 'GOrilla', 'Gene Ontology'], # Keywords that define your package best install_requires=[ # I get to this in a second 'requests',