diff --git a/Dockerfile b/Dockerfile index eb9ebfffb77c09b84161efdf55f95991221d3c07..6abc552ed463399196d426fb23663921f759c811 100755 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ COPY ./requirements.txt /usr/src/drugstone/requirements.txt RUN pip install -r /usr/src/drugstone/requirements.txt 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/ diff --git a/drugstone/management/commands/populate_db.py b/drugstone/management/commands/populate_db.py index 429cf6fc97b2fbc0ba07ec9b1051188b227ae9c0..94f64ce26a18c2afff81b2c5ef2e754a40f8aa25 100755 --- a/drugstone/management/commands/populate_db.py +++ b/drugstone/management/commands/populate_db.py @@ -86,8 +86,8 @@ class Command(BaseCommand): def populate(kwargs): - nedrex_api_url_unlicenced= "http://82.148.225.92:7123/" - nedrex_api_url_licenced = "http://82.148.225.92:8123/" + nedrex_api_url_unlicenced= "https://nedrex-api-open.zbh.uni-hamburg.de/" + nedrex_api_url_licenced = "https://nedrex-api-licenced.zbh.uni-hamburg.de/" data_dir = kwargs['data_dir'] diff --git a/drugstone/views.py b/drugstone/views.py index c053ff45f4c00efe29df261b511c86bb97071bae..fdae12328b8349b0c532bcb071208f719a32365b 100755 --- a/drugstone/views.py +++ b/drugstone/views.py @@ -4,6 +4,7 @@ import string import time import uuid from collections import defaultdict +from functools import reduce import pandas as pd @@ -414,18 +415,21 @@ def result_view(request) -> Response: return Response(result) else: if view == 'proteins': + proteins = list( + filter(lambda n: 'drugstone_type' in n and n['drugstone_type'] == 'protein', node_details.values())) if fmt == 'csv': items = [] for i in proteins: new_i = { - 'uniprot_ac': i['uniprot_ac'], - 'gene': i['symbol'], - 'name': i['protein_name'], - 'ensg': i['ensg'], - 'entrez': i['entrez'], - 'seed': is_seed[i[node_name_attribute]], + 'id': i['id'], + 'uniprot_ac': i['uniprot_ac'] if 'uniprot_ac' in i else [], + 'gene': i['symbol'] if 'symbol' in i else [], + 'name': i['protein_name'] if 'protein_name' in i else [], + 'ensembl': i['ensg'] if 'ensg' in i else [], + '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'] items.append(new_i) else: