Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the validity check of smiles in moses the same as RDKit? #99

Open
amine179 opened this issue Jan 14, 2022 · 0 comments
Open

Is the validity check of smiles in moses the same as RDKit? #99

amine179 opened this issue Jan 14, 2022 · 0 comments

Comments

@amine179
Copy link

I have this function to check the validity of smiles that is based on RDKit :

from rdkit import Chem
def checksmi(smi):
    m = Chem.MolFromSmiles(smi,sanitize=False)
    if m is None:
        #print('invalid SMILES')
        v = 0
    else:
        #print("valid smiles.")
        v = 1
        try:
            Chem.SanitizeMol(m)
        except:
            #print('invalid chemistry')
            v = 0
     return v

is this the same as the validity given by moses when we type the below code, does moses validity checks for valid smiles (grammar) or also valid chemistry:

import moses
metrics = moses.get_all_metrics(list_to_evaluate)
print(metrics)
{'valid': 0.8571428571428572,
 'unique@1000': 1.0,
 'unique@10000': 1.0,
 'FCD/Test': 52.710485508527654,
 'SNN/Test': 0.2737954681118329,
 'Frag/Test': 0.26661035762724716,
 'Scaf/Test': nan,
 'FCD/TestSF': 54.30007202575979,
 'SNN/TestSF': 0.23380156854788461,
 'Frag/TestSF': 0.3777161249748274,
 'Scaf/TestSF': nan,
 'IntDiv': 0.7468284898334079,
 'IntDiv2': 0.578859979666881,
 'Filters': 0.6666666666666666,
 'logP': 3.048971913797608,
 'SA': 0.8860967344024802,
 'QED': 0.3780715536953819,
 'weight': 184.10358258270205,
 'Novelty': 1.0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant