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

Merge branch 'development' into production

Former-commit-id: 897792337eec1edf41625c36b9209b0452a734bd [formerly f05671f8579a368f06aa57f5b94e2b3116692704]
Former-commit-id: 43793317a13b531e3c9cd68b8c0137332e372698
parents cfed08b9 0c6780fe
No related branches found
No related tags found
No related merge requests found
FROM andimajore/miniconda3_lunar FROM andimajore/miniconda3_mantic
WORKDIR /usr/src/drugstone/ WORKDIR /usr/src/drugstone/
...@@ -10,8 +10,8 @@ ENV LANG=C.UTF-8 ...@@ -10,8 +10,8 @@ ENV LANG=C.UTF-8
RUN apt update && apt upgrade -y RUN apt update && apt upgrade -y
RUN apt install -y supervisor nginx libgtk-3-dev RUN apt install -y supervisor nginx libgtk-3-dev
RUN conda install -y conda python=3.8 RUN conda install -y conda python=3.9
#RUN conda install -c conda-forge -y graph-tool=2.46
RUN conda install -c conda-forge -y graph-tool=2.55 RUN conda install -c conda-forge -y graph-tool=2.55
RUN pip install gunicorn RUN pip install gunicorn
......
...@@ -317,10 +317,14 @@ class ProteinProteinInteraction(models.Model): ...@@ -317,10 +317,14 @@ class ProteinProteinInteraction(models.Model):
class ProteinDrugInteraction(models.Model): class ProteinDrugInteraction(models.Model):
id = models.BigAutoField(primary_key=True) id = models.BigAutoField(primary_key=True)
pdi_dataset = models.ForeignKey( pdi_dataset = models.ForeignKey(
PDIDataset, null=True, on_delete=models.CASCADE, related_name='pdi_dataset_relation') PDIDataset,
protein = models.ForeignKey('Protein', on_delete=models.CASCADE) null=True,
drug = models.ForeignKey('Drug', on_delete=models.CASCADE) on_delete=models.CASCADE,
actions = models.CharField(max_length=255, default='[]') 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: class Meta:
unique_together = ("pdi_dataset", "protein", "drug") unique_together = ("pdi_dataset", "protein", "drug")
...@@ -329,7 +333,12 @@ class ProteinDrugInteraction(models.Model): ...@@ -329,7 +333,12 @@ class ProteinDrugInteraction(models.Model):
return f"{self.pdi_dataset}-{self.protein}-{self.drug}" return f"{self.pdi_dataset}-{self.protein}-{self.drug}"
def __eq__(self, other): 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): def __ne__(self, other):
return not self.__eq__(other) return not self.__eq__(other)
......
...@@ -2,20 +2,31 @@ ...@@ -2,20 +2,31 @@
import json import json
from rest_framework import serializers from rest_framework import serializers
from drugstone import models from drugstone import models
from drugstone.models import Protein, Task, Drug, ProteinDrugInteraction, \ from drugstone.models import (
Tissue, ProteinProteinInteraction, Network, ProteinDisorderAssociation, Disorder, DrugDisorderIndication Protein,
Task,
Drug,
ProteinDrugInteraction,
Tissue,
ProteinProteinInteraction,
Network,
ProteinDisorderAssociation,
Disorder,
DrugDisorderIndication,
)
class PDIDatasetSerializer(serializers.ModelSerializer): class PDIDatasetSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.PDIDataset model = models.PDIDataset
fields = '__all__' fields = "__all__"
class PPIDatasetSerializer(serializers.ModelSerializer): class PPIDatasetSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.PPIDataset model = models.PPIDataset
fields = '__all__' fields = "__all__"
class PDisDatasetSerializer(serializers.ModelSerializer): class PDisDatasetSerializer(serializers.ModelSerializer):
...@@ -177,7 +188,7 @@ class ProteinDrugInteractionSerializer(serializers.ModelSerializer): ...@@ -177,7 +188,7 @@ class ProteinDrugInteractionSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = ProteinDrugInteraction model = ProteinDrugInteraction
fields = ['dataset', 'protein', 'drug', 'actions'] fields = ["dataset", "protein", "drug", "actions"]
class ProteinDisorderAssociationSerializer(serializers.ModelSerializer): class ProteinDisorderAssociationSerializer(serializers.ModelSerializer):
......
...@@ -30,6 +30,7 @@ ALLOWED_HOSTS = [ ...@@ -30,6 +30,7 @@ ALLOWED_HOSTS = [
"localhost", "localhost",
"127.0.0.1", "127.0.0.1",
"drugstone-backend.zbh.uni-hamburg.de", "drugstone-backend.zbh.uni-hamburg.de",
"drugstone-dev-api.zbh.uni-hamburg.de",
"drugst.one", "drugst.one",
] ]
......
...@@ -26,7 +26,6 @@ pyflakes==3.0.1 ...@@ -26,7 +26,6 @@ pyflakes==3.0.1
python-dateutil==2.8.1 python-dateutil==2.8.1
pytz==2021.3 pytz==2021.3
redis==4.3.6 redis==4.3.6
requests==2.28.1
rq==1.11.1 rq==1.11.1
six==1.15.0 six==1.15.0
sqlalchemy==1.3.23 sqlalchemy==1.3.23
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment