Spaces:
Sleeping
Sleeping
jannisborn
commited on
Commit
•
4b5d582
1
Parent(s):
e83e5dc
update
Browse files- app.py +1 -0
- model_cards/examples.csv +3 -1
- utils.py +9 -6
app.py
CHANGED
@@ -21,6 +21,7 @@ logger.addHandler(logging.NullHandler())
|
|
21 |
|
22 |
|
23 |
MINIMIZATION_FUNCTIONS.pop("callable", None)
|
|
|
24 |
|
25 |
|
26 |
def run_inference(
|
|
|
21 |
|
22 |
|
23 |
MINIMIZATION_FUNCTIONS.pop("callable", None)
|
24 |
+
MINIMIZATION_FUNCTIONS.pop("molwt", None)
|
25 |
|
26 |
|
27 |
def run_inference(
|
model_cards/examples.csv
CHANGED
@@ -1 +1,3 @@
|
|
1 |
-
v0|["qed"]||1.2|100|10|4|8|4|1|0.1|3|4|42
|
|
|
|
|
|
1 |
+
v0|["qed"]||1.2|100|10|4|8|4|1|0.1|3|4|42
|
2 |
+
v0|["qed","sa"]||1.2|100|10|4|8|4|1|0.1|3|4|42
|
3 |
+
v0|["affinity"]|MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTT|1.2|100|10|4|8|4|1|0.1|3|4|42
|
utils.py
CHANGED
@@ -3,7 +3,7 @@ from collections import defaultdict
|
|
3 |
from typing import List, Callable
|
4 |
from gt4sd.properties import PropertyPredictorRegistry
|
5 |
from gt4sd.algorithms.prediction.paccmann.core import PaccMann, AffinityPredictor
|
6 |
-
|
7 |
|
8 |
import mols2grid
|
9 |
import pandas as pd
|
@@ -13,15 +13,18 @@ logger.addHandler(logging.NullHandler())
|
|
13 |
|
14 |
|
15 |
def get_affinity_function(target: str) -> Callable:
|
16 |
-
return lambda mols:
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
EVAL_DICT = {
|
22 |
"qed": PropertyPredictorRegistry.get_property_predictor("qed"),
|
23 |
-
"
|
24 |
-
"molwt": PropertyPredictorRegistry.get_property_predictor("molecular_weight"),
|
25 |
}
|
26 |
|
27 |
|
|
|
3 |
from typing import List, Callable
|
4 |
from gt4sd.properties import PropertyPredictorRegistry
|
5 |
from gt4sd.algorithms.prediction.paccmann.core import PaccMann, AffinityPredictor
|
6 |
+
import torch
|
7 |
|
8 |
import mols2grid
|
9 |
import pandas as pd
|
|
|
13 |
|
14 |
|
15 |
def get_affinity_function(target: str) -> Callable:
|
16 |
+
return lambda mols: torch.stack(
|
17 |
+
list(
|
18 |
+
PaccMann(
|
19 |
+
AffinityPredictor(protein_targets=[target] * len(mols), ligands=mols)
|
20 |
+
).sample(len(mols))
|
21 |
+
)
|
22 |
+
).tolist()
|
23 |
|
24 |
|
25 |
EVAL_DICT = {
|
26 |
"qed": PropertyPredictorRegistry.get_property_predictor("qed"),
|
27 |
+
"sa": PropertyPredictorRegistry.get_property_predictor("sas"),
|
|
|
28 |
}
|
29 |
|
30 |
|