I'm a computer scientist, helping with a chemistry project in python.

I have been working with the library pysmiles in order to parse SMILES into a molecule graph, and that worked fine until now. Recently, I started changing code so it will work with RDkit as well, since the RDkit library is much larger and has many other useful features.

However, I noticed that RDkit doesn't create a bond for a molecule that has a "zero-order bond", unlike pysmiles which just puts the "zero-order-bond" as a data on that edge.

For technical reasons, I would like RDkit to do the same as pysmiles, and do create a bond, writing in it that it is a "zero-order bond".

As an example, the following molecule was generated by RDkit:

enter image description here

I want the $\ce{Cl-}$ to have an edge to the $\ce{N}$, that will have the data written on it that it is a zero order bond (any other node besides $\ce{N}$ would work as well, for as long as the process of choosing that node is deterministic and depends only on the molecule).

How can I do this? I didn't manage to find an answer in their documentation. Thanks!

As a side note, any technical way of making the molecule graph connected (in a way that doesn't depend on the particular SMILES string for a certain molecule) will suffice for me.

  • $\begingroup$ Welcome to the site. Note, chemical information may be advantageously formatted using on ChemSE with mhchem. Take moment to familiarize with this. You are encouraged to use it in the body of questions, answers, and comments. Because it is something special not all web browsers understand well, do not use it in the title of questions or answers. $\endgroup$
    – Buttonwood
    Jul 28 at 16:24
  • $\begingroup$ Cool, thanks! Glad to know it exists :) $\endgroup$
    – nir shahar
    Jul 28 at 16:24
  • 1
    $\begingroup$ Chemically speaking, there is no covalent bond between the $\ce{Cl-}$ and any of the nitrogen atoms. To draw a line between $\ce{Cl-}$ and the nitrogen in the center ring would contradict that all valences (like «all hands available») are already engaged with the adjacent atoms (here: carbon). Possibly $\ce{Cl-}$ is somewhat close to the exocyclic $\ce{N+}$, because opposite charges attract each other. What may be a reasonable option to retain both the organic cation and the anionic anion is to concatenate the SMILES strings of each by the period / full stop (as e.g., in co-crystals). $\endgroup$
    – Buttonwood
    Jul 28 at 16:30
  • $\begingroup$ (continued) In the present case, one possible SMILES string about both entities altogether were CN(C)C1=CC=C2C(SC(C3=N2)=C/C(C=C3)=[N+](C)/C)=C1.[Cl-]. If you like to account for aromaticity of the rings, this equally may be expressed as CN(C)c1ccc2c(sc3-c(n2)cc/c(=[N+](/C)\C)/c3)c1.[Cl-], too. $\endgroup$
    – Buttonwood
    Jul 28 at 16:32
  • $\begingroup$ @Buttonwood I need some technical way to make the graph connected, in a deterministic process from the SMILES string, hopefully in a way that doesn't depend on which SMILES string we use to represent the same molecule $\endgroup$
    – nir shahar
    Jul 28 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.