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

A TypeError of one function in chemutils.py #12

Open
limaosen0 opened this issue Jun 23, 2018 · 0 comments
Open

A TypeError of one function in chemutils.py #12

limaosen0 opened this issue Jun 23, 2018 · 0 comments

Comments

@limaosen0
Copy link

Dear Wengong:

I test some functions in your code to learn some functions of Rdkit, and I met one TypeError which cannot be solved by myself.

The run function is in chemutils.py:

def get_clique_mol(mol, atoms):
smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True)
new_mol = Chem.MolFromSmiles(smiles, sanitize=False)
new_mol = copy_edit_mol(new_mol).GetMol()
new_mol = sanitize(new_mol) #We assume this is not None
return new_mol

The line is 'smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True)'

image


TypeError Traceback (most recent call last)
in ()
----> 1 new_mol2 = chu.get_clique_mol(mol,atoms)

/DATA3_DB7/data/msli/graph_net/MolGAN/chemutils.pyc in get_clique_mol(mol, atoms)
67 def get_clique_mol(mol, atoms):
68
---> 69 smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True)
70 new_mol = Chem.MolFromSmiles(smiles, sanitize=False)
71 new_mol = copy_edit_mol(new_mol).GetMol()

TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type Atom.

I believe that it is not your mistake, but I am a new learner of RDkit, please forgive me and help me.
Thank you very much!

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