saicharan2804 commited on
Commit
ab2d2e2
·
1 Parent(s): 4081f26

Fixed error

Browse files
Files changed (1) hide show
  1. molgenevalmetric.py +27 -27
molgenevalmetric.py CHANGED
@@ -36,7 +36,7 @@ sys.path.append(os.path.join(RDConfig.RDContribDir, 'SA_Score'))
36
  import sascorer
37
  import pandas as pd
38
  from fcd_torch import FCD
39
- from syba.syba import SybaClassifier
40
 
41
  # from tdc import Evaluator
42
  # from tdc import Oracle
@@ -287,32 +287,32 @@ def fcd_metric(gen, train, n_jobs = 8, device = 'cuda:0'):
287
  fcd = FCD(device=device, n_jobs= n_jobs)
288
  return fcd(gen, train)
289
 
290
- def SYBAscore(gen):
291
- """
292
- Compute the average SYBA score for a list of SMILES strings.
293
-
294
- Parameters:
295
- - smiles_list (list of str): A list of SMILES strings representing molecules.
296
-
297
- Returns:
298
- - float: The average SYBA score for the list of molecules.
299
- """
300
- syba = SybaClassifier()
301
- syba.fitDefaultScore()
302
- scores = []
303
-
304
- for smiles in gen:
305
- try:
306
- score = syba.predict(smi=smiles)
307
- scores.append(score)
308
- except Exception as e:
309
- print(f"Error processing SMILES '{smiles}': {e}")
310
- continue
311
-
312
- if scores:
313
- return sum(scores) / len(scores)
314
- else:
315
- return None # Or handle empty list or all failed predictions as needed
316
 
317
  # def oracles(gen, train):
318
  # Result = {}
 
36
  import sascorer
37
  import pandas as pd
38
  from fcd_torch import FCD
39
+ # from syba.syba import SybaClassifier
40
 
41
  # from tdc import Evaluator
42
  # from tdc import Oracle
 
287
  fcd = FCD(device=device, n_jobs= n_jobs)
288
  return fcd(gen, train)
289
 
290
+ # def SYBAscore(gen):
291
+ # """
292
+ # Compute the average SYBA score for a list of SMILES strings.
293
+
294
+ # Parameters:
295
+ # - smiles_list (list of str): A list of SMILES strings representing molecules.
296
+
297
+ # Returns:
298
+ # - float: The average SYBA score for the list of molecules.
299
+ # """
300
+ # syba = SybaClassifier()
301
+ # syba.fitDefaultScore()
302
+ # scores = []
303
+
304
+ # for smiles in gen:
305
+ # try:
306
+ # score = syba.predict(smi=smiles)
307
+ # scores.append(score)
308
+ # except Exception as e:
309
+ # print(f"Error processing SMILES '{smiles}': {e}")
310
+ # continue
311
+
312
+ # if scores:
313
+ # return sum(scores) / len(scores)
314
+ # else:
315
+ # return None # Or handle empty list or all failed predictions as needed
316
 
317
  # def oracles(gen, train):
318
  # Result = {}