Skip to content

Commit 0c72c69

Browse files
committed
fix chebi-graph propagation
1 parent 43c113a commit 0c72c69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chebifier/prediction_models/chemlog_predictor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def predict_smiles_list(self, smiles_list: list[str]) -> list:
5050
for i, res in enumerate(predictor_results):
5151
if i >= len(results):
5252
results.append(dict())
53-
results[i].update(res)
53+
if res is not None:
54+
results[i].update(res)
5455
return results
5556

5657
def explain_smiles(self, smiles):
@@ -93,7 +94,7 @@ def __init__(self, model_name: str, **kwargs):
9394
)
9495

9596
super().__init__(model_name, **kwargs)
96-
self.classifier = XMolecularEntityClassifier()
97+
self.classifier = XMolecularEntityClassifier(chebi_graph=self.chebi_graph)
9798

9899

99100
class ChemlogOrganoXCompoundPredictor(ChemlogExtraPredictor):
@@ -103,7 +104,7 @@ def __init__(self, model_name: str, **kwargs):
103104
)
104105

105106
super().__init__(model_name, **kwargs)
106-
self.classifier = OrganoXCompoundClassifier()
107+
self.classifier = OrganoXCompoundClassifier(chebi_graph=self.chebi_graph)
107108

108109

109110
class ChemlogPeptidesPredictor(BasePredictor):

0 commit comments

Comments
 (0)