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

Bad Conformers returned by model.predict #17

Open
PatWalters opened this issue Dec 16, 2024 · 0 comments · May be fixed by #18
Open

Bad Conformers returned by model.predict #17

PatWalters opened this issue Dec 16, 2024 · 0 comments · May be fixed by #18

Comments

@PatWalters
Copy link

I used the code below to request 10 confomers. Only the first one is valid.

from rdkit import Chem
from etflow import BaseFlow

smiles = 'NS(=O)(=O)c1ccc2c(c1)C[NH2+]CC2'
model=BaseFlow.from_default(model="drugs-o3")
pred_dict = model.predict([smiles], num_samples=10, as_mol=True)
out_mol = pred_dict[smiles]
for conf_idx in range(0,out_mol.GetNumConformers()):
    print(conf_idx)
    conf = out_mol.GetConformer(conf_idx)

When the second confomer is reached, I get an error. I think this is because conformer ids are not being correctly assigned (see below)

0
1
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 10
      8 for conf_idx in range(0,out_mol.GetNumConformers()):
      9     print(conf_idx)
---> 10     conf = out_mol.GetConformer(conf_idx)

ValueError: Bad Conformer Id

When I run the code below, every conformer has id 0. These ids should range between 0 and 9.

for conf in out_mol.GetConformers():
    print(conf.GetId())

I think you can fix this by changing line 81 in eval_prop.py to

mol_copy.AddConformer(build_conformer(pos),assignId=True)
@shenoynikhil shenoynikhil linked a pull request Dec 17, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant