Commit 6f43989a authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

discard "Kd ratio" compound activities from "best activity"

this complements work in a075f990
related to #204
parent dd172263
Pipeline #28891 passed with stages
in 14 minutes and 32 seconds
......@@ -1038,9 +1038,7 @@ class TestActivityDescription(models.Model):
nb_active_compounds = models.IntegerField(
verbose_name="Total number of active compounds"
)
cell_line = models.ForeignKey(
CellLine, on_delete=models.SET_NULL, null=True
)
cell_line = models.ForeignKey(CellLine, on_delete=models.SET_NULL, null=True)
def get_complexes(self):
"""
......@@ -1326,7 +1324,12 @@ def update_compound_cached_properties(compounds_queryset=None):
),
best_activity=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(_best_activity=Max("compoundactivityresult__activity"))
.annotate(
_best_activity=Max(
"compoundactivityresult__activity",
filter=~Q(compoundactivityresult__activity_type="KdRat"),
)
)
.values("_best_activity")[:1]
),
le=Subquery(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment