Re: [Rdkit-discuss] Stereochemistry issue for spirocycles/pseudochiral centres(?)

2017-02-10 Thread Greg Landrum
To close the loop on this: the bug fix is now merged onto master. The ring
stereochemistry code now handles spiro centers.
Here's the little demo of that:

In [2]: print(Chem.CanonSmiles('O[C@H]1CC[C@]11CC[C@@](Cl)(Br)CC1'))
O[C@H]1CC[C@]12CC[C@@](Cl)(Br)CC2

Unlike previously (see the bug report) the stereochemistry info is no
longer being lost.

Since the stereochem info is still there it will be used in the conformer
generation/filtering.

-greg



On Wed, Feb 8, 2017 at 4:45 AM, Greg Landrum  wrote:

> Hi James,
>
> This is definitely a bug. The problem seems to be connected to the way
> what the RDKit calls "ring stereochemistry" is handled when there are spiro
> linkages.
>
> Here's the github issue: https://github.com/rdkit/rdkit/issues/1294
>
> I'll take a look.
>
> Best,
> -greg
>
>
>
> On Tue, Feb 7, 2017 at 8:32 PM, James Davidson 
> wrote:
>
>> Dear All,
>>
>>
>>
>> I have hit what I think is a problem with stereochemistry
>> perception/handling for certain types of pseudochiral and/or spirocyclic
>> systems.
>>
>> Basically I am observing that some types of input tetrahedral
>> stereochemical information gets lost when an RDKit molecule is generated.
>>
>> But I only realised this because I was wanting to generate conformers and
>> was seeing stereochemical scrambling…
>>
>>
>>
>> Anyway, an example with pictures will probably explain things better:
>>
>> https://gist.github.com/jepdavidson/fdfbf6366a17f4829de3d4de22f3b442
>>
>>
>>
>> Any help/advice appreciated.
>>
>>
>>
>> Kind regards
>>
>>
>>
>> James
>>
>> __
>> PLEASE READ: This email is confidential and may be privileged. It is
>> intended for the named addressee(s) only and access to it by anyone else is
>> unauthorised. If you are not an addressee, any disclosure or copying of the
>> contents of this email or any action taken (or not taken) in reliance on it
>> is unauthorised and may be unlawful. If you have received this email in
>> error, please notify the sender or postmas...@vernalis.com. Email is not
>> a secure method of communication and the Company cannot accept
>> responsibility for the accuracy or completeness of this message or any
>> attachment(s). Please check this email for virus infection for which the
>> Company accepts no responsibility. If verification of this email is sought
>> then please request a hard copy. Unless otherwise stated, any views or
>> opinions presented are solely those of the author and do not represent
>> those of the Company.
>>
>> The Vernalis Group of Companies
>> 100 Berkshire Place
>> Wharfedale Road
>> Winnersh, Berkshire
>> RG41 5RD, England
>> Tel: +44 (0)118 938  <+44%20118%20938%20>
>>
>> To access trading company registration and address details, please go to
>> the Vernalis website at www.vernalis.com and click on the "Company
>> address and registration details" link at the bottom of the page..
>> __
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] How to determine if atoms are part of the same ring?

2017-02-10 Thread Markus Metz
Dear Andrew:

Thank you very much for your input.
I was able to refine and correct my approach with your suggestions.

Cheers,
Markus


On Wed, Feb 8, 2017 at 12:23 PM, Andrew Dalke 
wrote:

> On Feb 8, 2017, at 19:22, Markus Metz  wrote:
> > The question to you is: Is there another more elegant way of doing it?
> May be I missed something from the python API?
>
> I don't quite follow what you are looking for, though I have managed to
> condense your code somewhat, into:
>
> updatedMapping = None
> for ring in m.GetRingInfo().AtomRings():
> if set(ring).issubset(maps):
> updatedMapping = ring
>
> if updatedMapping is not None:
> updatedMapping = sorted(updatedMapping)
> for i, atom_idx in enumerate(updatedMapping, 1):
> m.GetAtomWithIdx(atom_idx).SetProp("molAtomMapNumber", str(i))
>
>
> Is it that you do not want to number the "*" atoms? In that case you can
> ask the query structure for the atoms with atomic number 0:
>
> >>> for atom in corea.GetAtoms():
> ...print(atom.GetAtomicNum())
> ...
> 0
> 6
> 6
> 6
> 6
> 6
> 6
> 0
>
> and ignore numbering the atoms at those positions.
>
> Or that you don't want to include ring atoms which aren't ring atoms in
> the query structure?
>
> In which case you can ask the query structure for its rings:
>
> >>> corea.GetRingInfo().AtomRings()
> ((1, 6, 5, 4, 3, 2),)
>
> and use that to guide which atoms should/should not be numbered.
>
> Cheers,
>
> Andrew
> da...@dalkescientific.com
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss