Spirocycle regioisomer canonical SMILES issue

49 views
Skip to first unread message

Chris Empson

unread,
Feb 11, 2016, 6:19:14 AM2/11/16
to indigo-bugs
Hi there,

I'm having an issue with Indigo's canonical SMILES generator. I'm trying to get Indigo to output the canonical SMILES for all regioisomers of a spirocycle with a single chlorine atom attached. There are 7 chemically distinct regioisomers, and Indigo correctly outputs the 7 non-canonical SMILES strings:

ClC1CC2(CCCC2)OC1
ClC1OC2(CCCC2)CC1
ClC1CCOC21CCCC2
ClC1CCCC21CCCO2
ClC1CCC2(C1)CCCO2
ClC1CC2(CC1)CCCO2
ClC1C2(CCC1)CCCO2

but when I output the canonical SMILES strings of the same molecules there are duplicates, even though all of the structures are chemically unique:

ClC1CC2(CCCO2)CC1 (x2)
ClC1CCC2(CCCC2)O1
ClC1CCCC21CCCO2 (x2)
ClC1CCOC21CCCC2
ClC1COC2(C1)CCCC2

Can anyone shed any light on whether this is a bug or a feature? Is there any way that I can obtain distinct canonical SMILES strings for all of these chemically distinct species?

Kind regards and thanks in advance,
Chris Empson

University of Leeds, UK

Yuriy Puzanov

unread,
Feb 11, 2016, 9:50:10 AM2/11/16
to indigo-bugs


Hi Chris,

   It looks like you need to specify stereo configuration to build different canonical SMILES in two described cases.

ClC1C[C@]2(CCCO2)CC1
ClC1C[C@@]2(CCCO2)CC1

and

ClC1CCC[C@]21CCCO2
ClC1CCC[C@@]21CCCO2

In you current input (without stereocenters configuration) two isomers can't be distinguished and Indigo generates the same canonical SMILES.

Best Regards!
Yuriy




Chris Empson

unread,
Feb 11, 2016, 10:44:35 AM2/11/16
to indigo-bugs
Hi Yuriy,

Many thanks for your quick reply! I agree that specifying the stereochemistry does give the correct result. I will add this workaround to my software.

Best wishes,
Chris

Chris Empson

unread,
Feb 12, 2016, 5:25:34 AM2/12/16
to indigo-bugs
Hello again Yuriy,

I'm having a bit of trouble and I wonder whether you can offer any advice. 

For ease of use, I would prefer users of my software to be able to draw spirocycles in their non-stereo form, and for the software to handle the addition of the stereocentre. 

I have written the code that adds the stereocentre to the correct atom using atom.addStereocenter(Indigo.ABS, i[0], i[1], i[2], i[3]). This successfully adds a stereocentre because mol.countStereocenters() returns the correct result. However, when I print the canonical SMILES nothing has changed, presumably because I haven't specified any of the bonds as Indigo.UP or Indigo.DOWN. I can't find a method in the documentation that allows me to do this though. I've been through the source code of the Python library on Github and I can't see any undocumented functions that might allow me to set a bond's stereo configuration. 

Do you have any suggestions?

Kind regards,
Chris

Yuriy Puzanov

unread,
Feb 12, 2016, 6:50:09 AM2/12/16
to indigo-bugs
Hello Chris,

    You need to use markStereoBons() method for assigning UP and DOWN directions in accordance with specified stereocenters.

Best Regards!
Yuriy.

Yuriy Puzanov

unread,
Feb 12, 2016, 6:51:14 AM2/12/16
to indigo-bugs
Sorry,  markStereoBonds()  :-)

Chris Empson

unread,
Feb 12, 2016, 6:59:45 AM2/12/16
to indigo-bugs
Thanks again, Yuriy!.

This API function isn't documented in the API reference at http://lifescience.opensource.epam.com/indigo/api/index.html so it might be a good idea to add some documentation. Is this a method of the stereocentre or of a bond, and what are the method's parameters?

Best wishes,
Chris



Yuriy Puzanov

unread,
Feb 12, 2016, 8:58:44 AM2/12/16
to indigo-bugs
Hello Chris,

    Thank you very much for using Indigo!
We definitely update documentation with description of this method as soon as possible.
This method is the method of molecule object and it is used to mark all bonds in
the molecule in accordance with specified stereocenters and it has no
parameters. Usage is similar this (for Python e.g.)

    mol.markStereobonds()

Best Regards!
Yuriy

Chris Empson

unread,
Feb 12, 2016, 9:41:16 AM2/12/16
to indigo-bugs
Thanks for your help with this, Yuriy.

When I call mol.markStereobonds() an IndigoException is raised. Here is some Python code that shows this. I'm using Indigo-python 1.2.1.


# Code to show mol.markStereobonds() raising an IndigoException.
from indigo import *

try:
    indigo=Indigo()
    mol=indigo.loadMolecule('ClC1COC2(C1)CCCC2')

    idx=[] # List to hold the neighbouring atom indices.
    for atom in mol.iterateAtoms():
        if atom.degree() == 4:
            # The atom with degree 4 is common to both rings.
            stereo_atom_id = atom.index()
            print "stereo_atom_id = %s" % (stereo_atom_id)
            # Copy the neighbouring atom indices into idx[]
            for nei in atom.iterateNeighbors():
                idx.append(nei.index())
            print "Neighbouring atoms = %s" % (idx)
    # Create the stereocentre
    mol.getAtom(stereo_atom_id).addStereocenter(indigo.ABS, idx[0], idx[1], idx[2], idx[3])
    # Mark the stereo bonds
    mol.markStereobonds() # <- This call raises an IndigoException
    print mol.canonicalSmiles()

except IndigoException as e:
    print("IndigoException: %s" % (e))


Am I doing something wrong?

Best wishes,
Chris

Yuriy Puzanov

unread,
Feb 12, 2016, 10:20:21 AM2/12/16
to indigo-bugs
Hello Chris,

    It looks like the reason of the issue is the absence of coordinates for molecule loaded from SMILES.
So to resolve this issue you need to generate some appropriate layout for the structure, e.g. by using
corresponding layout() method from Indigo library. And only after that use markStereobonds() method.
One additional point is that in your example the selected carbon atom is not a valid stereocenter at all.

Best Regards!
Yuriy.

Chris Empson

unread,
Feb 12, 2016, 10:33:14 AM2/12/16
to indigo-bugs
Thanks, adding mol.layout() after the indigo.loadMolecule() call resolves the IndigoException issue.

I see what you mean about the central carbon atom not being a valid stereocentre. However I am unsure how else I can add a directional bond to convince Indigo to recognise that there are 7 unique regioisomers of the spirocycle, rather than 5! Do you have any ideas how I could manipulate the molecule to achieve this?

Best wishes,
Chris


Dmitry Lushnikov

unread,
Feb 12, 2016, 11:13:07 AM2/12/16
to indig...@googlegroups.com

Chris,

 

In the molecule  ClC1COC2(C1)CCCC2 it is possible to draw a symmetry plane through the spiro atom, therefore  the spiro atom is not chiral and is not a valid stereocenter. Would the chlorine be a substituent in different (all-carbon) ring, the stereocenter does exist.

 

Hope this helps.

 

Dmitry Lushnikov

--
You received this message because you are subscribed to the Google Groups "indigo-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to indigo-bugs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Empson

unread,
Feb 12, 2016, 11:38:57 AM2/12/16
to indigo-bugs
Hi Dmitry,

Thanks for your reply. I understand what you mean; I see that there's mirror plane in the plane of the two rings.

I suppose I'm just confused about why Indigo interprets the stereo information in Yuriy's SMILES string ClC1C[C@]2(CCCO2)CC1 as containing a valid stereocentre, but Indigo doesn't allow me to input the SMILES string ClC1COC2(C1)CCCC2 and then add the stereo character afterwards using API calls.

Surely I should be able to manipulate the non-stereo molecule to arrive at the same configuration? After all, Indigo is able to achieve this as part of the loadMolecule() function!

Kind regards,
Chris

Yuriy Puzanov

unread,
Feb 12, 2016, 12:29:20 PM2/12/16
to indigo-bugs
Hello Chris,

   Actually SMILES string is used as input/output representation of the molecule.
Internal representation is more complex and includes more features which absent in
SMILES. So you have not possibility to manipulate with SMILES representation itself,
but you need to change structure with available methods (add or remove atoms, bonds,
stereo information and etc.) When all manipulations made you can save the result in SMILES
or some other appropriate format.

Best Regards!
Yuriy
Reply all
Reply to author
Forward
0 new messages