saicharan2804 commited on
Commit
614c0d4
·
1 Parent(s): 996ea1d

Adding synthetic_complexity_score

Browse files
Files changed (1) hide show
  1. molgenevalmetric.py +4 -4
molgenevalmetric.py CHANGED
@@ -38,7 +38,7 @@ import pandas as pd
38
  from fcd_torch import FCD
39
  # from syba.syba import SybaClassifier
40
 
41
- from scscore.scscore.standalone_model_numpy import SCScorer
42
 
43
 
44
  def get_mol(smiles_or_mol):
@@ -196,7 +196,7 @@ def novelty(gen, train, n_jobs=1):
196
  # return None
197
 
198
 
199
- def SCScore(gen):
200
  """
201
  Calculate the average Synthetic Complexity Score (SCScore) for a list of molecules represented by their SMILES strings.
202
 
@@ -207,7 +207,7 @@ def SCScore(gen):
207
  - float: The average Synthetic Accessibility Score for the valid molecules in the list. Returns None if no valid molecules are found.
208
  """
209
 
210
- model = SCScore()
211
  average_score = model.get_avg_score(gen)
212
  return average_score
213
 
@@ -525,7 +525,7 @@ class molgenevalmetric(evaluate.Metric):
525
  # metrics['Oracles'] = oracles(gen = gensmi, train = trainsmi)
526
 
527
  # metrics['SA'] = SAscore(gen=gensmi)
528
- metrics['SCS'] = SCScore(gen=gensmi)
529
 
530
  return metrics
531
 
 
38
  from fcd_torch import FCD
39
  # from syba.syba import SybaClassifier
40
 
41
+ from SCScore import SCScorer
42
 
43
 
44
  def get_mol(smiles_or_mol):
 
196
  # return None
197
 
198
 
199
+ def synthetic_complexity_score(gen):
200
  """
201
  Calculate the average Synthetic Complexity Score (SCScore) for a list of molecules represented by their SMILES strings.
202
 
 
207
  - float: The average Synthetic Accessibility Score for the valid molecules in the list. Returns None if no valid molecules are found.
208
  """
209
 
210
+ model = SCScorer()
211
  average_score = model.get_avg_score(gen)
212
  return average_score
213
 
 
525
  # metrics['Oracles'] = oracles(gen = gensmi, train = trainsmi)
526
 
527
  # metrics['SA'] = SAscore(gen=gensmi)
528
+ metrics['SCS'] = synthetic_complexity_score(gen=gensmi)
529
 
530
  return metrics
531