Skip to content

Trouble with loading SMILES to QED module #7158

Answered by ptosco
ShirosakiK asked this question in Q&A
Discussion options

You must be logged in to vote

@ShirosakiK
An option to preserve the integrity of the complex while avoiding to exceed the valences of carbon, nitrogen and oxygen atom involved in such complexes is to convert those single bonds into zero-order bonds:

from rdkit import Chem

m = Chem.MolFromSmiles('CC(C)C12=C3C4=C5(C)C6=C1[Ru]143625(Cl)O=C(CC(=O1)/C=C/c1ccc(OC)c(OC)c1)/C=C/c1ccc(O)c(OC)c1', sanitize=False)

for b in m.GetBonds():
    ru = None
    if b.GetBeginAtom().GetAtomicNum() == 44:
        ru = b.GetBeginAtom()
    elif b.GetEndAtom().GetAtomicNum() == 44:
        ru = b.GetEndAtom()
    if ru is None:
        continue
    other_atom = b.GetOtherAtom(ru)
    if other_atom.GetAtomicNum() in (6, 7, 8):
        b.Se…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ShirosakiK
Comment options

Comment options

You must be logged in to vote
1 reply
@ShirosakiK
Comment options

Answer selected by ShirosakiK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants