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

changed nedrex api routes; fixed protein table download

parent 2c794a7b
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
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/
......
......@@ -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']
......
......@@ -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:
......
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