molgenevalmetric / syba_test.py
saicharan2804
Fixed error
2225f77
raw
history blame
952 Bytes
# from syba.syba import SybaClassifier
# def SYBAscore(smiles_list):
# """
# Compute the average SYBA score for a list of SMILES strings.
# Parameters:
# - smiles_list (list of str): A list of SMILES strings representing molecules.
# Returns:
# - float: The average SYBA score for the list of molecules.
# """
# syba = SybaClassifier()
# syba.fitDefaultScore()
# scores = []
# for smiles in smiles_list:
# try:
# score = syba.predict(smi=smiles)
# scores.append(score)
# except Exception as e:
# print(f"Error processing SMILES '{smiles}': {e}")
# continue
# if scores:
# return sum(scores) / len(scores)
# else:
# return None # Or handle empty list or all failed predictions as needed
# syba = SybaClassifier()
# syba.fitDefaultScore()
# smi = "O=C(C)Oc1ccccc1C(=O)O"
# print(syba.predict(smi))
import sascorer