Re: [Rdkit-discuss] Making Morgan Fingerprints more SMILES-like

2020-01-12 Thread Kramer, Christian via Rdkit-discuss
Hi Greg,

thanks a lot for the fast and comprehensive answer. I will give it a try,
this looks simple enough.

To your point about local vs nonlocal information: You are of course
absolutely right about the apparent contradiction. My goal is to build a
system where I can visualize the Fingerprints using SMILES. In my first
attempts, I got weird results where the SMILES did not fully correspond to
the molecular subgraphs that were really used for the Fingerprints.

Bests,
Christian

*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD)


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/4.92

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.


On Thu, Jan 9, 2020 at 2:13 PM Greg Landrum  wrote:

> Hi Christian,
>
> The topic of how to specify atom invariants came up recently on the list
> here:
>
> https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg09400.html
>
> Here's a gist that shows how to specify your own atom invariants based
> solely upon atomic number and, optionally, aromaticity:
> https://gist.github.com/greglandrum/d31ae7618cc5b7322a7121a529bf8190
> The key function is here:
>
> def get_simple_morgan(m,radius,includeAromaticity=False,**kwargs):
> if not includeAromaticity:
> invars = [x.GetAtomicNum() for x in m.GetAtoms()]
> else:
> invars = [x.GetAtomicNum()|(1000+x.GetIsAromatic()) for x in
> m.GetAtoms()]
> return
> rdMolDescriptors.GetMorganFingerprint(m,radius,invariants=invars,**kwargs)
>
>
>
> The gist also shows how to use the SMARTS for each atom as its atom
> invariant:
>
> import hashlib
> def get_smiles_morgan(m,radius,**kwargs):
> smis = [Chem.Atom.GetSmarts(x) for x in m.GetAtoms()]
> invars = []
> for x in m.GetAtoms():
> # there's almost certainly a more performant way to do this,
> but
> h = hashlib.md5()
> h.update(x.GetSmarts().encode())
> invars.append(int.from_bytes(h.digest()[:4],'little'))
> return
> rdMolDescriptors.GetMorganFingerprint(m,radius,invariants=invars,**kwargs)
>
>
>  Note that this is sensitive to things like atom map numbers (as shown in
> the gist).
>
> I am compelled to point out that, at least based on the way you phrase the
> question you are asking for two mutually contradictory things here:
> The first question asks about including information about aromaticity,
> which is determined by the properties of an entire ring system and is thus
> definitely *not* local. The second question wants things to be super local
> and not affected by atoms that aren't included in the radius being
> considered.
>
> -greg
>
>
>
>
> On Thu, Jan 9, 2020 at 11:06 AM Kramer, Christian via Rdkit-discuss <
> rdkit-discuss@lists.sourceforge.net> wrote:
>
>> Dear RDKit community,
>>
>> Happy new year!
>>
>> I am looking for a way to make the circular Morgen Fingerprints more
>> SMILES like. The background is that with the default definition of atom
>> invariants in the RDKit implementation, Morgan Fingerprints do not
>> explicitly take into account aromaticity, and use more information from
>> higher radii than what would be expected when sketching the substructures
>> indexed by the fingerprint. This becomes an issue when drawing the
>> substructures, or encoding them as SMILES. Here are two examples that
>> illustrate the points:
>>
>> 1.) Aromaticity:
>> At radius 1, the atoms in phenyl and the sp2 atoms in cyclohexene yield
>> exactly the same fingerprint, whereas the SMILES for those atoms is
>> different:
>>
>> In [1]: import rdkit
>> In [2]: from rdkit import Chem
>> In [3]: from rdkit.Chem import AllChem
>> In [4]: phenyl = "[*:1]c1c1"
>> In [5]: cyclohexyl = "[*:1]C1=C1"
>> In [6]: mol1 = Chem.MolFromSmiles(phenyl)
>> In [7]: mol2 = Chem.MolFromSmiles(cyclohexyl)
>> In [8]: fp1 = AllChem.GetMorganFingerprint(mol1, 1, fromAtoms=[0])
>> In [9]: fp2 = AllChem.GetMorganFingerprint(mol2, 1, fromAtoms=[0])
>> In [10]: fp1==fp2
>> Out[10]: True
>>
>> Now in many cases there probably is a good reason why those atoms can be
>> considered identical, but then there are still other cases when aromaticity
>> makes a difference. For example, when encoding the substructure as a
>> SMILES, the two atoms are d

[Rdkit-discuss] Making Morgan Fingerprints more SMILES-like

2020-01-09 Thread Kramer, Christian via Rdkit-discuss
Dear RDKit community,

Happy new year!

I am looking for a way to make the circular Morgen Fingerprints more SMILES
like. The background is that with the default definition of atom invariants
in the RDKit implementation, Morgan Fingerprints do not explicitly take
into account aromaticity, and use more information from higher radii than
what would be expected when sketching the substructures indexed by the
fingerprint. This becomes an issue when drawing the substructures, or
encoding them as SMILES. Here are two examples that illustrate the points:

1.) Aromaticity:
At radius 1, the atoms in phenyl and the sp2 atoms in cyclohexene yield
exactly the same fingerprint, whereas the SMILES for those atoms is
different:

In [1]: import rdkit
In [2]: from rdkit import Chem
In [3]: from rdkit.Chem import AllChem
In [4]: phenyl = "[*:1]c1c1"
In [5]: cyclohexyl = "[*:1]C1=C1"
In [6]: mol1 = Chem.MolFromSmiles(phenyl)
In [7]: mol2 = Chem.MolFromSmiles(cyclohexyl)
In [8]: fp1 = AllChem.GetMorganFingerprint(mol1, 1, fromAtoms=[0])
In [9]: fp2 = AllChem.GetMorganFingerprint(mol2, 1, fromAtoms=[0])
In [10]: fp1==fp2
Out[10]: True

Now in many cases there probably is a good reason why those atoms can be
considered identical, but then there are still other cases when aromaticity
makes a difference. For example, when encoding the substructure as a
SMILES, the two atoms are different ("c" and "C"), which can create
confusion when comparing to the fingerprint.


2.) Information from higher radii
The Morgan Fingerprint has the concept of radius. For a radius of 2, I
would naively expect that only atom environments up to 2 atoms away from
the rooted atom are taken into account. However, this is not fully true, as
shown below:

In [11]: toluene = "[*:1]c1c1C"
In [12]: mol3 = Chem.MolFromSmiles(toluene)
In [13]: fp1 = AllChem.GetMorganFingerprint(mol1, 2, fromAtoms=[0])
In [14]: fp3 = AllChem.GetMorganFingerprint(mol3, 2, fromAtoms=[0])
In [15]: fp1==fp3
Out[15]: False

Toluene and Phenyl differ in the one C ortho to the star atom. This C is 3
bonds away from the star atom. Therefore, when calculating the
MorganFingerprint with radius 2 rooted on the star atom, I would expect the
two fingerprints derived from phenyl and toluene to be the same. I assume
this is not the case because the connectivity makes a difference between a
bond to a heavy atom and to a hydrogen.


It would be very helpful to get suggestions or even code snippets for how
to change the default behaviour of the Morgan Fingerprinter such that the
representation is closer to what one draws or encodes in SMILES for the
atoms in a given radius. The documentation says that atom invariants can be
defined, which I hope help here. If someone did this before, it would be
cool if you could share how to do it exactly.

Thanks a lot,
Christian


*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD)


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/4.92

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MMPDB V2.2 update

2019-02-05 Thread Kramer, Christian
Dear RDKitters,

To those of you who are interested in Matched Pairs analysis:

mmpdb, a library for doing large-scale MMP analysis, has been updated to
version 2.2. This update introduces three new features that enable reducing
the size of the database created.

These are:

--min-heavies-per-const-frag: During fragmentation, double- and triple cuts
where one of the constant parts has less heavy atoms than this number will
be discarded. This removes a lot of pseudo-multiple cuts where one of the
constant parts is very small, like only a halogen or a methoxy.

--smallest-transformation-only: If set on during indexing, only the
smallest transformation per pair will be indexed. If for example a
transformation is p-F-phenyl >> p-Cl-phenyl, only the F>>Cl transformation
will be indexed. Note that the phenyl environment is still encoded as part
of the environment fingerprint.

--max-radius: The maximum radius up to which environments are enumerated
can now be set on the command line during indexing.

In my tests, the using --min-heavies-per-const-frag 3 and
--smallest-transformation-only reduces the size of the database by ~70%. A
smaller max-radius can have another dramatic effect on the database size.

The latest version of mmpdb is now available for download on
https://github.com/rdkit/mmpdb. If you are interested in it, please check
it out and let me know if you find it useful or if you have problems with
it.

Best regards,
Christian

*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD)


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/8.56 C

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKIT 2018.3 and MMPDB problem

2018-05-09 Thread Kramer, Christian
Dear all,

Andrew's fix for the wildcard atom representation in RDKit 2018.3 has just
been incorporated into the main mmpdb branch. If you download the latest
version of mmpdb, it should now work with with the current version and also
with previous RDKit versions.

Note that you have to rebuild your mmp database if you switch from a pre
2018 version of RDKit to a 2018+ version.

Bests,
Christian

*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Senior Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/8.56 C

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.

On Tue, May 8, 2018 at 4:04 PM, Andrew Dalke 
wrote:

> Dear Marco,
>
> > On May 7, 2018, at 23:59, Marco Stenta  wrote:
> > I had some time to set an environment for it and test it: it works fine,
> as far as my tests go. I will switch to this version and to the latest
> RDKIT now.
>
> Thanks for the feedback. Someone else sent me a private email also saying
> it worked. I'll put together the final changes for a 2.1 release, and see
> about making it accessible from PyPI so "pip install mmpdb" will work.
>
> > some questions:
> > Is there any plan to:
> > include MCS as a fragmentation method?
> > extend to matched series?
> > include "fuzzy" environment definitions based on pharmacophores (as BI
> people did)?
>
> I know of no plans for that.
>
> As a consultant, my answer is more along the lines of "are you willing to
> pay for it?" :)
>
> It won't be cheap.
>
> Speaking of which, many thanks to Roche because they funded this work,
> just like that previously funded me to develop the MCS code that is now in
> RDKit.
>
>
> > I am currently using the database file to explore the rules mainly via
> visual inspection through spotfire by means of a series of joins to
> generate suitable tables: would anybody be interested in this (also helping
> improving it)?
>
> I hope you find others and are able to get this out there.
>
> One of the reasons for developing what eventually became mmpdb 2.0 is to
> make this sort of viewer possible.
>
> That is, the unreleased mmpdb 1.0 didn't have canonical attachment point
> assignment, resulting in up to 6 different ways to represent a 3-cut
> fragment. This made it technically challenging to the simple sorts of
> analyses that mmpdb 2.0 does now, and impossible to visualize meaningfully.
>
> 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


Re: [Rdkit-discuss] sanifix

2017-10-10 Thread Kramer, Christian
Hi Mei,

I do not have an answer to your question about sanifix4.py, but with your
test molecule I do not get a "Can't kekulize mol" problem when
reading/writing it with RDKit. Standard RDKit seems to be doing its job:

In [1]: import rdkit

In [2]: from rdkit import Chem

In [3]: mol = Chem.MolFromSmiles("CCC(N)Cc1cc(=O)[nH]nc1c2ccco2")

In [4]: Chem.MolToSmiles(mol)

Out[4]: 'CCC(N)Cc1cc(=O)[nH]nc1-c1ccco1'

In [5]: Chem.Kekulize(mol)

In [6]: Chem.MolToSmiles(mol)

Out[6]: 'CCC(N)Cc1cc(=O)[nH]nc1-c1ccco1'

In [7]: Chem.MolToSmiles(mol,kekuleSmiles=True)

Out[7]: 'CCC(N)CC1=CC(=O)[NH]N=C1C1=CC=CO1'

In [8]: rdkit.__version__

Out[8]: '2017.03.1'

For your test compound, there is only one valid solution for where the
hydrogens/ double bonds have to be. Can you provide an example where
standard RDKit fails?

Bests,
Christian


*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Senior Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/3.56 C

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.

On Mon, Oct 9, 2017 at 11:22 PM, Mew Woo  wrote:

> Hi All,
>
> I have been trying to use sanifix4.py to get around the "Can't kekulize
> mol" problem but without success. I have a library of compounds with
> O=c1cccnn1 fragment unable to kekulize 
> (example:CCC(N)Cc1cc(=O)[nH]nc1c2ccco2).
> It has been a few years since this script came ut. I just wonder if anyone
> has further develop this script to enable application to more nitrogen
> aromatics?
>
> Previous discussions:
> http://www.mail-archive.com/rdkit-discuss@lists.
> sourceforge.net/msg01185.html
> http://www.mail-archive.com/rdkit-discuss@lists.
> sourceforge.net/msg01162.html
> http://www.mail-archive.com/rdkit-discuss@lists.
> sourceforge.net/msg01900.html
>
> Regards,
> Mei Woo
>
> 
> --
> 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] mmpdb installation on windows using mingw

2017-09-22 Thread Kramer, Christian
Hi Markus,

thanks for pointing this out. The reason for that error message is that
signal.SIGPIPE is not available under windows. This seems to have slipped
below our radar, since we developed the code on Linux.

There is a simple solution to this: In the mmpdb file, one needs to
import os

and then change the error-causing line to:
if not os.name=="nt": signal.signal(signal.SIGPIPE, signal.SIG_DFL)

That solves the problem on my window laptop.

I will add this and update mmpdb in the repo asap.

Bests,
Christian


*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/3.56 C

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.

On Fri, Sep 22, 2017 at 2:01 PM, Peter Gedeck 
wrote:

> Here is a relevant stackoverflow question.
>
> https://stackoverflow.com/questions/1948862/is-the-
> python-3-x-signal-library-for-windows-incomplete
>
> What happens if you comment out the code if you run on windows?
>
> Best
>
> Peter
> On Fri, Sep 22, 2017 at 7:25 AM Markus Metz  wrote:
>
>> Hello Christian:
>>
>> I am trying to install your program and get the following error message:
>>
>> $ mmpdb help-analysis
>> Traceback (most recent call last):
>>   File "C:/Users/---/Anaconda3/envs/my-rdkit-env/Scripts/mmpdb", line 8,
>> in 
>> signal.signal(signal.SIGPIPE, signal.SIG_DFL) # Allow the output pipe
>> to be closed
>> AttributeError: module 'signal' has no attribute 'SIGPIPE'
>>
>> Not sure what to do about it. Any input would be greatly appreciated.
>>
>> Cheers,
>> Markus
>>
>> 
>> --
>> 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
>
>
--
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


[Rdkit-discuss] mmpdb 2.0 - a package for MMP database generation and analysis

2017-08-15 Thread Kramer, Christian
Dear RDKit users,

we would like to announce an open-source MMP package, designed to create
and query MMP databases for big-pharma sized ADMET datasets:

mmpdb 2.0 - matched molecular pair database generation and analysis

The package has been developed during the last two years by Roche and
Andrew Dalke. The source code is now available from the RDKit github under
https://github.com/rdkit/mmpdb

The package is built based on RDKit and other open python modules like
scipy and numpy. It is licensed under the 3-clause BSD license.

Documentation to get you started is available from the project page. We
anticipate that this will grow over time, as the package gets used and
extended. We hope that this package provides the ground for developing a
standard for MMP across the field. As such, we are looking forward to your
questions, bug reports, and enhancement requests.

Andrew and I will give a talk on the package and be available for
discussion at the upcoming RDKit UGM in Berlin end of September.

Cheers,
Christian



*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/3.56 C

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.
--
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] Chirality conservation during atom replacement

2016-06-22 Thread Kramer, Christian
Hi Andrew and Greg,

thanks a lot for the quick replies.

I tested Greg's suggested solution, and it works ... but only with the
RDKit version 2016.03.1. With Version 2015.09.2, I still get the wrong
stereochemistry after fragmentation (maybe relevant for people working with
older versions).

Bests,
Christian


*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/2.56

CH-4070 Basel


Phone +41 61 682 2471

mailto: christian.kra...@roche.com


*Confidentiality Note: *This message is intended only for the use of the
named recipient(s) and may contain confidential and/or proprietary
information. If you are not the intended recipient, please contact the
sender and delete this message. Any unauthorized use of the information
contained in this message is prohibited.

On Tue, Jun 21, 2016 at 5:54 PM, Andrew Dalke <da...@dalkescientific.com>
wrote:

> On Jun 21, 2016, at 5:26 PM, Greg Landrum wrote:
> > Because chirality is represented relative to the ordering of the bonds
> around an atom, it's pretty difficult to do this if you want to actually
> break and add bonds on your own. This would probably be somewhat easier if
> there were an RWMol.ReplaceBond() method analogous to the
> RWMol.ReplaceAtom() method, but that's not available at the moment.
>...
> > p.s. this all reminds me that there's a long email from Andrew on this
> topic that I still haven't worked my way all the way through. 
>
> I pretty much had to give up with working in molecule space and switch to
> working in SMILES space.
>
> That is, I did a SMARTS match or whatever to get the atom to change,
> backtracked to the original SMILES, which I tokenized to find the
> corresponding term, then at the token level substituted in the new group.
>
> What made it relatively simple was that I wanted to fragment R-groups
> along non-ring single bonds. In that case, I find the pair of atoms (i, j),
> along the bond, find the token corresponding to atom j, insert "*.*" before
> that token, and reparse the modified SMILES.
>
> On Jun 21, 2016, at 4:50 PM, Kramer, Christian wrote:
> > Is there a simple way of preserving chirality during splits on chiral
> atoms?
>
> To preserve chirality, I had to map from the new molecule space back to
> the original molecule space, bearing in mind the newly added atom. Then
> figure out which chiralities were missing in the "*.*"-inserted molecule
> (since an asymmetric molecule with chirality in the core might have a
> symmetric core after fragmentation, causing chirality information to
> disappear), and determine which chirality terms to put back.
>
> It's very tricky.
>
> I was hoping to present this as the RDKit User's Group Meeting, but I
> won't be able to make it. :(
>
>
> Andrew
> da...@dalkescientific.com
>
>
>
> --
> Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Chirality conservation during atom replacement

2016-06-21 Thread Kramer, Christian
Hi RDKitters,

I am having trouble with chirality conservation during fragmentation of
molecules. Is there a simple way of preserving chirality during splits on
chiral atoms? Am I missing a simple function? Andrew has brought this topic
has come up on the mailing list before, but so far there has not been a
simple answer...

Here is an example where chirality is not preserved:

---
> import rdkit
> rdkit.__version__
Out[2]: '2016.03.1'

> from rdkit import Chem
> mol = Chem.MolFromSmiles("F[C@](Cl)(Br)I")
> Chem.MolToSmiles(mol,isomericSmiles=True)
Out[5]: 'F[C@](Cl)(Br)I'

> emol = Chem.EditableMol(mol)
> emol.RemoveBond(1,0)
> emol.AddAtom(Chem.Atom(0))
Out[8]: 5

> emol.AddAtom(Chem.Atom(0))
Out[9]: 6

> emol.AddBond(0,5,Chem.BondType.SINGLE)
Out[10]: 4

> emol.AddBond(1,6,Chem.BondType.SINGLE)
Out[11]: 5

> new_mol = emol.GetMol()
> Chem.MolToSmiles(new_mol,isomericSmiles=True)
Out[13]: '[*]F.[*][C@@](Cl)(Br)I'
-

Best regards,
Christian


*Dr. Christian Kramer*

Computer-Aided Drug Design (CADD) Scientist


F. Hoffmann-La Roche Ltd

Pharma Research and Early Development
Bldg. 092/2.56

CH-4070 Basel.
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss