Re: [Rdkit-discuss] Handling reaction stereochemistry

2013-04-02 Thread Greg Landrum
Hi James,

Thanks for the feedback.

On Tue, Apr 2, 2013 at 10:15 PM, James Davidson  wrote:
>
>> So... the question to you guys: How should stereochemistry
>> inversion/retention/loss be indicated in Reaction SMARTS?
>
> Good question – and let me be the first to jump in, feet first, without
> thinking enough!  : )

It's great to have engaged users. :-)

>
> Instinctively, I would say it would be good to (a) scramble stereochemistry
> if not otherwise specified – at least this way we default to losing
> information rather than risking keeping incorrect information; (b) use a
> flag at each centre if we want to retain stereochemistry (what about ‘@’?);
> (c) use another flag if we want to invert (and, inventive I know, what about
> ‘@@’?).
>
>
>
> So in the above example, let’s say I want to always invert (eg to represent
> an SN2 reaction) – the rSMARTS could then be something like
> [C:1]-O>>[C:1@@]-S, and the example input above would give F[C@@H](S)Cl out.
>
> The same output with no specification could give FC(H)(S)Cl and, of course,
> achiral input would always give achiral output – regardless of the flag in
> the rSMARTS.
>

I should have provided a bit more context around what the current
behavior is, or at least what it's supposed to be. Sorry I forgot
that.

Currently, when creating a reaction from rxnSMARTS,
inversion/retention is handled by looking at the relative
stereochemistry of atoms in the reactants and products.

If they're different you get inversion (apologies for the extremely
bogus example "reaction"):

In [13]: rxn = AllChem.ReactionFromSmarts("[C@:1]>>[C@@:1]")

In [14]: ps = rxn.RunReactants((Chem.MolFromSmiles('F[C@](Cl)(Br)I'),))

In [15]: Chem.MolToSmiles(ps[0][0],True)
Out[15]: 'F[C@@](Cl)(Br)I'

In [16]: ps = rxn.RunReactants((Chem.MolFromSmiles('F[C@@](Cl)(Br)I'),))

In [17]: Chem.MolToSmiles(ps[0][0],True)
Out[17]: 'F[C@](Cl)(Br)I'

and if they're the same you get retention:

In [7]: rxn2 = AllChem.ReactionFromSmarts("[C@:1]>>[C@:1]")

In [8]: ps = rxn2.RunReactants((Chem.MolFromSmiles('F[C@](Cl)(Br)I'),))

In [9]: Chem.MolToSmiles(ps[0][0],True)
Out[9]: 'F[C@](Cl)(Br)I'

In [10]: rxn3 = AllChem.ReactionFromSmarts("[C@@:1]>>[C@@:1]")

In [11]: ps = rxn3.RunReactants((Chem.MolFromSmiles('F[C@](Cl)(Br)I'),))

In [12]: Chem.MolToSmiles(ps[0][0],True)
Out[12]: 'F[C@](Cl)(Br)I'


This much feels logical to me, though of course it can be changed if
there's disagreement.

If you call the reaction with non-chiral starting material, you get
non-chiral ouput:

In [20]: rxn3 = AllChem.ReactionFromSmarts("[C@@:1]>>[C@@:1]")

In [21]: ps = rxn3.RunReactants((Chem.MolFromSmiles('FC(Cl)(Br)I'),))

In [22]: Chem.MolToSmiles(ps[0][0],True)
Out[22]: 'FC(Cl)(Br)I'

This is probably also ok; it certainly reflects what would happen in
the lab (er, at least I think it does).

So far so good. We've got inversion of stereochemistry and retention
of stereochemistry. There are two cases left: resolution/creation and
scrambling.

One obvious thing to do here would be:

  [C@:1]>>[C:1]   scrambling
  [C:1]>>[C@:1]   resolution/induction

This is where my extremely bogus example starts to make things more
difficult to understand, so here's a more real example of the
induction case:
   [#6:1]/[C:2]=[C:3](/[#6:4])>>[#6:1][C@H:2](Br)[C@H:3](Br)[#6:4]

Seem right?

>
>> Bonus points to anyone who can explain to me how the inversion/retention
>> flags in RXN files should be handled. At the moment the RDKit uses what's in
>> the products and ignores them in the reactants.
>
>
>
> Something like the above? (I told you I hadn’t thought about it enough!)

Do you have access to any tools that would let you check this? It
would be very good to know if other software uses the specification in
the reactants, products, or both.

-greg

--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Any interest in an RDKit get together in Boston/Cambridge next week?

2013-04-02 Thread Greg Landrum
I'm going to be in Cambridge next week and think it would be great to
meet up with some of the Boston-area RDKit users. I know it's not the
best timing since it's the same week as the ACS in New Orleans, but I
figured I'd give it a try.

I'm free Thursday evening starting at around 6pm and would be happy to
just meet for a beer, do a Q&A/tutorial session (assuming someone can
organize a venue), or whatever. Anywhere in the vicinity of MIT,
Harvard, or BU should work. Let me know if there's interest.

-greg

--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Handling reaction stereochemistry

2013-04-02 Thread James Davidson
Hi Greg,

 

> I've got a question for the community about how chirality should be
handled in reactions.

> This morning I managed to fix one of the outstanding reaction
stereochemistry problems in the RDKit: the loss of chirality when one
bond to a stereocenter is to an unmapped atom. Here's a quick demo of
the new behavior (not yet checked in; there are still a couple things to
be cleaned up):

> 

> In [7]: rxn = AllChem.ReactionFromSmarts('[C:1]-O>>[C:1]-S')

> In [8]: ps = rxn.RunReactants((Chem.MolFromSmiles('F[C@H](O)Cl'),))

> In [9]: Chem.MolToSmiles(ps[0][0],True)

> Out[9]: 'F[C@H](S)Cl'

> 

> It seems nice to be able to preserve chirality in these cases.

> The question that comes up is: "*Should* we be preserving chirality in
these cases?". The change makes it impossible to indicate a reaction
that scrambles stereochemistry. That doesn't seem right.

> So... the question to you guys: How should stereochemistry
inversion/retention/loss be indicated in Reaction SMARTS?

 

 

Good question - and let me be the first to jump in, feet first, without
thinking enough!  : )

Instinctively, I would say it would be good to (a) scramble
stereochemistry if not otherwise specified - at least this way we
default to losing information rather than risking keeping incorrect
information; (b) use a flag at each centre if we want to retain
stereochemistry (what about '@'?); (c) use another flag if we want to
invert (and, inventive I know, what about '@@'?).

 

So in the above example, let's say I want to always invert (eg to
represent an SN2 reaction) - the rSMARTS could then be something like
[C:1]-O>>[C:1@@]-S, and the example input above would give F[C@@H](S)Cl
out.

The same output with no specification could give FC(H)(S)Cl and, of
course, achiral input would always give achiral output - regardless of
the flag in the rSMARTS.

 

 

> Bonus points to anyone who can explain to me how the
inversion/retention flags in RXN files should be handled. At the moment
the RDKit uses what's in the products and ignores them in the reactants.

 

Something like the above? (I told you I hadn't thought about it enough!)

 

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 

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..
__--
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Parallel conformer optimization

2013-04-02 Thread Quentin Delettre

Hi,

I wanted to know if it was possible to do the same thing as in the 
cookbook (1) but for conformer optimization : optimize each conformer 
generated but in parallel.


I want to optimize conformer generation for one molecule, because it 
will be a one molecule job script on a webserver.


I tried with that (part of ) code :

|def optimize(mol, id):||
||AllChem.UFFOptimizeMolecule(mol, confId=id)||
||
||def main ():||
||
||global options, args||
||
||max_workers=4||
||
||input_file = args.input||
||sdf_output_file = args.output||
||
||n = args.nbconf||
||
||writer = Chem.SDWriter(sdf_output_file)||
||
||suppl = Chem.SDMolSupplier(input_file)||
||
||for mol in suppl:||
||try:||
||mol = Chem.AddHs(mol)||
||ids = AllChem.EmbedMultipleConfs(mol, numConfs=n)||
||ids = list(ids)||
||# for id in ids:||
||# AllChem.UFFOptimizeMolecule(mol, confId=id)||
||except:||
||raise||
||
||try:||
||with futures.ProcessPoolExecutor(max_workers=max_workers) 
as executor:||

||# Submit a set of asynchronous jobs||
||jobs = []||
||try:||
||for id in ids:||
||job = executor.submit(optimize, mol, id)||
||jobs.append(job)||
||except:||
||raise||
||
||for job in futures.as_completed(jobs):||
||for id in ids:||
||writer.write(mol, confId=id)||
||writer.close()||
||except:||
||raise|

But with nbconf = 10, it generate 100 conformers. So i suspect something 
wrong with the optimization function and the job management.



(1) http://www.rdkit.org/docs/Cookbook.html#parallel-conformation-generation

Thank you.
--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss