diff --git a/Dockerfile b/Dockerfile index 350a5f006977a167848d9e1a700d97dd381f73be..4da796c0028f092aeb6396d9f9f94ec1a0217dec 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM andimajore/miniconda3_lunar +FROM andimajore/miniconda3_mantic WORKDIR /usr/src/drugstone/ @@ -10,8 +10,8 @@ ENV LANG=C.UTF-8 RUN apt update && apt upgrade -y RUN apt install -y supervisor nginx libgtk-3-dev -RUN conda install -y conda python=3.8 -#RUN conda install -c conda-forge -y graph-tool=2.46 +RUN conda install -y conda python=3.9 + RUN conda install -c conda-forge -y graph-tool=2.55 RUN pip install gunicorn diff --git a/drugstone/models.py b/drugstone/models.py index 703f0039be94ce77c94cad908bab83ed307547f5..c7a2dcc8870cad9128da80a2311622b61322fff7 100755 --- a/drugstone/models.py +++ b/drugstone/models.py @@ -317,10 +317,14 @@ class ProteinProteinInteraction(models.Model): class ProteinDrugInteraction(models.Model): id = models.BigAutoField(primary_key=True) pdi_dataset = models.ForeignKey( - PDIDataset, null=True, on_delete=models.CASCADE, related_name='pdi_dataset_relation') - protein = models.ForeignKey('Protein', on_delete=models.CASCADE) - drug = models.ForeignKey('Drug', on_delete=models.CASCADE) - actions = models.CharField(max_length=255, default='[]') + PDIDataset, + null=True, + on_delete=models.CASCADE, + related_name="pdi_dataset_relation", + ) + protein = models.ForeignKey("Protein", on_delete=models.CASCADE) + drug = models.ForeignKey("Drug", on_delete=models.CASCADE) + actions = models.CharField(max_length=255, default="[]") class Meta: unique_together = ("pdi_dataset", "protein", "drug") @@ -329,7 +333,12 @@ class ProteinDrugInteraction(models.Model): return f"{self.pdi_dataset}-{self.protein}-{self.drug}" def __eq__(self, other): - return self.pdi_dataset_id == other.pdi_dataset_id and self.protein_id == other.protein_id and self.drug_id == other.drug_id and self.actions == other.actions + return ( + self.pdi_dataset_id == other.pdi_dataset_id + and self.protein_id == other.protein_id + and self.drug_id == other.drug_id + and self.actions == other.actions + ) def __ne__(self, other): return not self.__eq__(other) diff --git a/drugstone/serializers.py b/drugstone/serializers.py index 66fc31a12a3727196b6fff2d970ee2f148200689..061cef1f8b6dc0ee137a5d3fde1241db6ccf3b36 100755 --- a/drugstone/serializers.py +++ b/drugstone/serializers.py @@ -2,20 +2,31 @@ import json from rest_framework import serializers from drugstone import models -from drugstone.models import Protein, Task, Drug, ProteinDrugInteraction, \ - Tissue, ProteinProteinInteraction, Network, ProteinDisorderAssociation, Disorder, DrugDisorderIndication +from drugstone.models import ( + Protein, + Task, + Drug, + ProteinDrugInteraction, + Tissue, + ProteinProteinInteraction, + Network, + ProteinDisorderAssociation, + Disorder, + DrugDisorderIndication, +) class PDIDatasetSerializer(serializers.ModelSerializer): class Meta: model = models.PDIDataset - fields = '__all__' + fields = "__all__" class PPIDatasetSerializer(serializers.ModelSerializer): class Meta: model = models.PPIDataset - fields = '__all__' + fields = "__all__" + class PDisDatasetSerializer(serializers.ModelSerializer): @@ -177,7 +188,7 @@ class ProteinDrugInteractionSerializer(serializers.ModelSerializer): class Meta: model = ProteinDrugInteraction - fields = ['dataset', 'protein', 'drug', 'actions'] + fields = ["dataset", "protein", "drug", "actions"] class ProteinDisorderAssociationSerializer(serializers.ModelSerializer): diff --git a/drugstone/settings/settings.py b/drugstone/settings/settings.py index 460dba97ebad82e1c25e45fcc55eebf8d92ade82..b162f709677757031f4bfb101895ff296031aeab 100755 --- a/drugstone/settings/settings.py +++ b/drugstone/settings/settings.py @@ -30,6 +30,7 @@ ALLOWED_HOSTS = [ "localhost", "127.0.0.1", "drugstone-backend.zbh.uni-hamburg.de", + "drugstone-dev-api.zbh.uni-hamburg.de", "drugst.one", ] diff --git a/requirements.txt b/requirements.txt index d3299f3444ede01f4d07274f14858891bbcaf0ed..695ae5b662b51d652872d2a6f3cd81966cb0aa55 100755 --- a/requirements.txt +++ b/requirements.txt @@ -26,7 +26,6 @@ pyflakes==3.0.1 python-dateutil==2.8.1 pytz==2021.3 redis==4.3.6 -requests==2.28.1 rq==1.11.1 six==1.15.0 sqlalchemy==1.3.23