Commit c7980e01 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

use best_activity to compute compound LE and LLE

thereby discarding Kd ratio, which isn't a
valid type activity to compute these

FIX #244
parent efdcae52
Pipeline #38205 passed with stages
in 19 minutes and 22 seconds
......@@ -1556,11 +1556,6 @@ def update_compound_cached_properties(compounds_queryset=None):
)
c.save()
compounds_queryset.update(
pubs=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(_pubs=Count("refcompoundbiblio", distinct=True))
.values("_pubs")[:1]
),
best_activity=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(
......@@ -1571,11 +1566,18 @@ def update_compound_cached_properties(compounds_queryset=None):
)
.values("_best_activity")[:1]
),
)
compounds_queryset.update(
pubs=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(_pubs=Count("refcompoundbiblio", distinct=True))
.values("_pubs")[:1]
),
le=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(
_le=Cast(
1.37 * Max("compoundactivityresult__activity") / F("nb_atom_non_h"),
1.37 * F("best_activity") / F("nb_atom_non_h"),
FloatField(),
)
)
......@@ -1585,7 +1587,7 @@ def update_compound_cached_properties(compounds_queryset=None):
compounds_queryset.filter(id=OuterRef("id"))
.annotate(
_lle=Cast(
Max("compoundactivityresult__activity") - F("a_log_p"), FloatField()
F("best_activity") - F("a_log_p"), FloatField()
)
)
.values("_lle")[:1]
......
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