Skip to content
Snippets Groups Projects
Commit 8b4b8a9c authored by Hartung, Michael's avatar Hartung, Michael
Browse files

merge

Former-commit-id: ebe8d703
parents c0c0c6f2 873495d8
No related branches found
No related tags found
No related merge requests found
deploy_dev.sh 100644 → 100755
File mode changed from 100644 to 100755
#!/bin/bash
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" == "production" ]; then
docker build -t gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod -f ./Dockerfile .
docker push gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod
else
echo "DENIED: Your are not in the production branch. Do not push to production from the ${branch} branch."
fi
version: '3.3'
services:
frontend:
container_name: drugstone_frontend
image: gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/website:prod
restart: always
ports:
- 8031:80
networks:
- drugstone
labels:
- "com.centurylinklabs.watchtower.enable=true"
backend:
image: gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod
container_name: drugstone_backend
command:
- "sh"
- "scripts/docker-entrypoint.sh"
env_file:
- 'docker-django.env'
restart: always
volumes:
- drugstone_db_schema_volume:/usr/src/drugstone/drugstone/migrations
- drugstone_data_volume:/usr/src/drugstone/data
ports:
- 8032:8000
networks:
- drugstone
depends_on:
- db
- redis
labels:
- "com.centurylinklabs.watchtower.enable=true"
db:
image: postgres
container_name: drugstone_postgres
restart: always
hostname: drugstone_postgres
# ports:
# - 5432:5432
networks:
- drugstone
volumes:
- drugstone_db_volume:/var/lib/postgresql/data
environment:
- POSTGRES_DB=drugstone
- POSTGRES_USER=drugstone
- POSTGRES_PASSWORD=t6278yczAH7rPKVMxaDD
command:
- "postgres"
- "-c"
- "max_connections=10000"
- "-c"
- "shared_buffers=2GB"
redis:
image: redis
container_name: drugstone_redis
restart: always
command: ["redis-server"]
networks:
- drugstone
# ports:
# - 6379:6379
celery:
image: gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod
command:
- "sh"
- "scripts/start_celery_worker.sh"
restart: always
container_name: drugstone_celery
hostname: drugstone_celery
volumes:
- drugstone_data_volume:/usr/src/drugstone/data
env_file:
- './docker-django.env'
depends_on:
- redis
- db
networks:
- drugstone
labels:
- "com.centurylinklabs.watchtower.enable=true"
celery-beat:
image: gitlab.rrz.uni-hamburg.de:4567/cosy-bio/drugst.one/backend:prod
command:
- "sh"
- "scripts/start_celery_beat.sh"
container_name: drugstone_celery_beat
hostname: drugstone_celery_beat
restart: always
env_file:
- './docker-django.env'
depends_on:
- redis
- db
networks:
- drugstone
labels:
- "com.centurylinklabs.watchtower.enable=true"
cdn:
build: cdn
image: drugstone_cdn
container_name: drugstone_cdn
restart: always
volumes:
- drugstone_cdn_volume:/app/files
ports:
- 8033:80
networks:
drugstone:
volumes:
drugstone_db_volume:
external: true
drugstone_db_schema_volume:
external: true
drugstone_data_volume:
external: true
drugstone_cdn_volume:
external: true
\ No newline at end of file
version: '3.3'
services:
app:
backend:
image: drugstone_backend
container_name: drugstone_backend
command:
......@@ -72,6 +72,7 @@ services:
command:
- "sh"
- "scripts/start_celery_beat.sh"
restart: always
image: drugstone_backend
container_name: drugstone_celery_beat
hostname: drugstone_celery_beat
......
......@@ -11,3 +11,5 @@ SQL_PORT=5432
REDIS_HOST=redis
REDIS_PORT=6379
GT_THREADS=16
DJANGO_SETTINGS_MODULE=drugstone.settings
CELERY_BROKER_URL=redis://redis:6379/0
\ No newline at end of file
......@@ -146,7 +146,7 @@ def get_drug_target_drugbank():
name='DrugBank',
link='https://go.drugbank.com/',
version='5.1.7',
licenced=False
licenced=True
)
return dataset
......
......@@ -375,7 +375,9 @@ def result_view(request) -> Response:
detail['ensg'] = list(set(detail['ensg']))
edges = parameters['input_network']['edges']
edge_endpoint_ids = set()
# TODO check for custom edges when working again with ensemble gene ids
for edge in edges:
edge_endpoint_ids.add(edge['from'])
......@@ -383,11 +385,10 @@ def result_view(request) -> Response:
nodes_mapped, id_key = query_proteins_by_identifier(edge_endpoint_ids, identifier)
if 'autofill_edges' in parameters['config'] and parameters['config']['autofill_edges']:
prots = list(filter(lambda n: n['drugstone_type'] == 'protein',
filter(lambda n: 'drugstone_type' in n and node_name_attribute in n, parameters['input_network']['nodes'])))
filter(lambda n: 'drugstone_type' in n and node_name_attribute in n,
parameters['input_network']['nodes'])))
proteins = {node_name[1:] for node in prots for node_name in node[node_name_attribute]}
dataset = DEFAULTS['ppi'] if 'interaction_protein_protein' not in parameters['config'] else \
......@@ -400,7 +401,6 @@ def result_view(request) -> Response:
interaction_objects))
edges.extend(auto_edges)
result['network']['edges'].extend(edges)
uniq_edges = dict()
for edge in result['network']['edges']:
......@@ -530,10 +530,10 @@ def adjacent_disorders(request) -> Response:
data = request.data
if 'proteins' in data:
drugstone_ids = data.get('proteins', [])
pdi_dataset = get_pdis_ds(data.get('dataset', DEFAULTS['pdis']), data.get('licenced', False))
pdis_dataset = get_pdis_ds(data.get('dataset', DEFAULTS['pdis']), data.get('licenced', False))
# find adjacent drugs by looking at drug-protein edges
pdis_objects = ProteinDisorderAssociation.objects.filter(protein__id__in=drugstone_ids,
pdis_dataset_id=pdi_dataset.id)
pdis_dataset_id=pdis_dataset.id)
disorders = {e.disorder for e in pdis_objects}
# serialize
edges = ProteinDisorderAssociationSerializer(many=True).to_representation(pdis_objects)
......
......@@ -4,7 +4,7 @@ python3 manage.py makemigrations drugstone
python3 manage.py migrate
python3 manage.py createfixtures
python3 manage.py cleanuptasks
#python3 manage.py populate_db --update -a
#python3 manage.py make_graphs
python3 manage.py populate_db --update -a
python3 manage.py make_graphs
/usr/bin/supervisord -c "/etc/supervisor/conf.d/supervisord.conf"
......@@ -208,7 +208,6 @@ def trust_rank(task_hook: TaskHook):
if ppi_dataset['licenced'] or pdi_dataset['licenced']:
filename += "_licenced"
filename = os.path.join(task_hook.data_directory, filename+".gt")
print(filename)
g, seed_ids, drug_ids = read_graph_tool_graph(filename, seeds, id_space, max_deg, include_indirect_drugs, include_non_approved_drugs, search_target)
if custom_edges:
......
......@@ -125,11 +125,6 @@ def read_graph_tool_graph(file_path, seeds, id_space, max_deg, include_indirect_
for edge in deleted_edges:
g.remove_edge(edge)
g.set_fast_edge_removal(fast=False)
# vertices = 0
# for _ in g.vertices():
# vertices += 1
# edges = 0
# for _ in g.edges():
# edges += 1
# Return the graph and the indices of the seed_ids and the seeds.
return g, list(seed_ids.keys()), drug_ids
......@@ -45,7 +45,7 @@ def scores_to_results(
drug_in_path = False
for vertex in vertices:
if g.vertex_properties["type"][int(vertex)] == "Drug" and vertex != candidate:
if g.vertex_properties["type"][int(vertex)] == "drug" and vertex != candidate:
drug_in_path = True
break
if drug_in_path:
......@@ -67,7 +67,7 @@ def scores_to_results(
drug_in_path = False
for vertex in vertices:
if g.vertex_properties["type"][int(vertex)] == "Drug" and vertex != candidate:
if g.vertex_properties["type"][int(vertex)] == "drug" and vertex != candidate:
drug_in_path = True
break
if drug_in_path:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment