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

changed nedrex api routes; fixed protein table download

Former-commit-id: 060e468aae542e362615637a985d035f5e550b9d [formerly 71267798c6c0dbf6f3c68e69a834066dc54bc782]
Former-commit-id: 3e5884f855c73eb9db534a3792e9ec971934d00b
parent 2a238c34
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.
Please register or to comment