Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MIDDLEEAST\shaybe committed Oct 25, 2019
1 parent 2f8df6e commit 55d5db4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 115 deletions.
122 changes: 10 additions & 112 deletions examples/SimpleExample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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<ipython-input-3-090b8450a471>\u001b[0m in \u001b[0;36m<module>\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\"<title>Calculating Enrichment</title>\"\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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>GO term</th>\n",
" <th>Description</th>\n",
" <th>P-value</th>\n",
" <th>FDR q-value</th>\n",
" <th>Enrichment (N, B, n, b)</th>\n",
" <th>Genes</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>GO:0022402</td>\n",
" <td>cell cycle process</td>\n",
" <td>7.28E-19</td>\n",
" <td>1.06E-14</td>\n",
" <td>2.73 (9106,611,552,101)</td>\n",
" <td>\\n[+] Show genes\\n \\r\\nRFC4 - replication fa...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>GO:1903047</td>\n",
" <td>mitotic cell cycle process</td>\n",
" <td>1.04E-16</td>\n",
" <td>7.58E-13</td>\n",
" <td>3.00 (9106,399,593,78)</td>\n",
" <td>\\n[+] Show genes\\n \\r\\nDONSON - downstream n...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>GO:0007346</td>\n",
" <td>regulation of mitotic cell cycle</td>\n",
" <td>1.04E-12</td>\n",
" <td>5.06E-9</td>\n",
" <td>3.89 (9106,430,218,40)</td>\n",
" <td>\\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>GO:0010564</td>\n",
" <td>regulation of cell cycle process</td>\n",
" <td>6.64E-12</td>\n",
" <td>2.42E-8</td>\n",
" <td>3.46 (9106,512,221,43)</td>\n",
" <td>\\n[+] Show genes\\n \\r\\nPRC1 - protein regula...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>GO:1901990</td>\n",
" <td>regulation of mitotic cell cycle phase transition</td>\n",
" <td>4.44E-11</td>\n",
" <td>1.29E-7</td>\n",
" <td>4.45 (9106,284,216,30)</td>\n",
" <td>\\n[+] Show genes\\n \\r\\nPKD1 - polycystic kid...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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": [
Expand Down
2 changes: 1 addition & 1 deletion pyGOrilla/pyGOrilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<title>Calculating Enrichment</title>" not in response2.text:
poll_done = True
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 55d5db4

Please sign in to comment.