Skip to content
Snippets Groups Projects
Commit 2f7fd432 authored by AndiMajore's avatar AndiMajore
Browse files

changed nedrex api routes; fixed protein table download

Former-commit-id: c1069d98
parent a82ff2e0
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ COPY ./requirements.txt /usr/src/drugstone/requirements.txt ...@@ -21,7 +21,7 @@ COPY ./requirements.txt /usr/src/drugstone/requirements.txt
RUN pip install -r /usr/src/drugstone/requirements.txt RUN pip install -r /usr/src/drugstone/requirements.txt
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple nedrex==0.1.4 RUN pip install nedrex
COPY . /usr/src/drugstone/ COPY . /usr/src/drugstone/
......
...@@ -86,8 +86,8 @@ class Command(BaseCommand): ...@@ -86,8 +86,8 @@ class Command(BaseCommand):
def populate(kwargs): def populate(kwargs):
nedrex_api_url_unlicenced= "http://82.148.225.92:7123/" nedrex_api_url_unlicenced= "https://nedrex-api-open.zbh.uni-hamburg.de/"
nedrex_api_url_licenced = "http://82.148.225.92:8123/" nedrex_api_url_licenced = "https://nedrex-api-licenced.zbh.uni-hamburg.de/"
data_dir = kwargs['data_dir'] data_dir = kwargs['data_dir']
......
...@@ -4,6 +4,7 @@ import string ...@@ -4,6 +4,7 @@ import string
import time import time
import uuid import uuid
from collections import defaultdict from collections import defaultdict
from functools import reduce
import pandas as pd import pandas as pd
...@@ -414,18 +415,21 @@ def result_view(request) -> Response: ...@@ -414,18 +415,21 @@ def result_view(request) -> Response:
return Response(result) return Response(result)
else: else:
if view == 'proteins': if view == 'proteins':
proteins = list(
filter(lambda n: 'drugstone_type' in n and n['drugstone_type'] == 'protein', node_details.values()))
if fmt == 'csv': if fmt == 'csv':
items = [] items = []
for i in proteins: for i in proteins:
new_i = { new_i = {
'uniprot_ac': i['uniprot_ac'], 'id': i['id'],
'gene': i['symbol'], 'uniprot_ac': i['uniprot_ac'] if 'uniprot_ac' in i else [],
'name': i['protein_name'], 'gene': i['symbol'] if 'symbol' in i else [],
'ensg': i['ensg'], 'name': i['protein_name'] if 'protein_name' in i else [],
'entrez': i['entrez'], 'ensembl': i['ensg'] if 'ensg' in i else [],
'seed': is_seed[i[node_name_attribute]], 'entrez': i['entrez'] if 'entrez' in i else [],
'seed': is_seed[i['id']],
} }
if i.get('score'): if 'score' in i:
new_i['score'] = i['score'] new_i['score'] = i['score']
items.append(new_i) items.append(new_i)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment