Re: [Rdkit-discuss] Reaction Arrows

2018-01-24 Thread Greg Landrum
Hi Libby,

On Tue, Jan 23, 2018 at 11:19 PM, Phipps, Elizabeth C 
wrote:

>
> Thank you for the response. Just to clarify, your thought process is that
> once you get the location/index of atoms you could be able to add in arrows
> in specific locations?
>

Yeah. It's not the nicest solution, but it will likely work.


> While trying to implement your code, an error with DrawReaction occurred:
>
> AttributeError: 'MolDraw2DSVG' object has no attribute 'DrawReaction'
>
>
> We cannot find a solution because DrawReaction seems to be an attribute to
> MolDraw2DSVG. Do you have any ideas as to why this error occurs?
>
>
Could it be that you're using an older version of the RDKit? That feature
was added as part of the 2017.09 release:

In [4]: rdkit.__version__
Out[4]: '2017.09.1'

In [5]: rdMolDraw2D.MolDraw2DSVG.DrawReaction
Out[5]: 

Best,
-greg



> Thanks,
> Libby
>
> On Dec 5, 2017, at 10:49 AM, Greg Landrum  wrote:
>
> Hi Libby,
>
> There's not currently anything directly available to do this, but some
> pieces that might help are sort of there.
>
> You could imagine getting drawings of the reactions as SVG and then adding
> the arrows that indicate the mechanism to that.
> In order to do this, you'd likely want to be able to figure out where the
> atoms are in the SVG. This is mostly possible, if in an ugly way.
>
> Here's an example, which I'll explain below:
>
> In [6]: rxn = AllChem.ReactionFromSmarts('C=CCBr.[I-]>>C=CCI.[Br-]',
> useSmiles=True)
>
> In [12]: canv = rdMolDraw2D.MolDraw2DSVG(300,300)
>
> In [13]: canv.drawOptions().includeAtomTags = True
>
> In [14]: canv.DrawReaction(rxn)
>
> In [15]: canv.FinishDrawing()
>
> In [16]: print(canv.GetDrawingText())
> 
>xmlns:svg='http://www.w3.org/2000/svg'
>   xmlns:rdkit='http://www.rdkit.org/xml'
>   xmlns:xlink='http://www.w3.org/1999/xlink'
>   xml:space='preserve'
> width='300px' height='300px' >
>  height='300' x='0' y='0'> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>  ... SNIP ...
>
>
> 
> 
>
>
> Notice the rdkit:atom properties there. Those are the positions of the
> corresponding atoms in the output SVG.
> The ugliness comes due to the fact that, currently at least, you get these
> in increasing order with no indication of whether they belong to an
> reactant (and if so, which reactant) or a product (and if so, which
> product). You are safe assuming that the reactants are output in order,
> followed by the products, and that the atoms within each are output in
> order. So atom idx 1 above is atom 0 in the first reactant, atom idx 5 is
> atom 0 in the second reactant, atom idx 7 is atom 1 in the first product,
> etc.
> I'm going to think about ways to make this output a bit easier to handle
> for reactions (suggestions appreciated), but that's what is currently there.
>
> It's also worth thinking about what the API would look like to add the
> arrows directly
>
> Apologies that this isn't straightforward, but this may be enough to get a
> start?
>
> -greg
>
>
>
>
>
> On Tue, Dec 5, 2017 at 4:27 PM, Phipps, Elizabeth C 
> wrote:
>
>> Hi,
>>
>> The goal is to help students visualize reactions and to do so we have
>> been working to figure out how to get reaction arrows in the reaction
>> output. We cannot seem to find much information as to whether it is
>> possible to have the output (a visual organic reaction) contain reaction
>> arrows using RDKit with SMILES and SMIRKS even though some examples have
>> arrows.
>> I am wondering if there is any further information as to whether it is
>> possible to show reaction arrows.
>>
>> For example:
>> 
>>
>> Thanks,
>> Libby
>>
>> 
>> --
>> 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] RDKit and Google Summer of Code 2018

2018-01-24 Thread Cameron Pye
 I know this isn't a particularly sexy job for a budding cheminformatician
but...

Work on the Python documentation!!!

I love rdKit and occasionally think I'm pretty savvy but I can't tell you
how often I'm scrolling through the documentation (or source) and either:

a) discover something that exists but doesn't have anything documentation
but the function signature
or
b) discover some some functionality that exists (and i've wanted) but
didn't know it was there!

I think this mailing list and Greg do a superb job of keeping the community
informed and creating and maintaining the codebase but I think having some
more "Pythonic" API documentation would be great.

One shining example is the scikit-learn documentation
 that has a quick start,
tutorials etc.  and then in the well categorized and explanatory API ref
has links for examples in the User Guide (akin to the "Getting Started with
the RDKit in Python" doc) .

Just my 2 cents!

Thanks for all the hard work as always,
Cam


On Mon, Jan 15, 2018 at 12:52 PM <
rdkit-discuss-requ...@lists.sourceforge.net> wrote:

> Send Rdkit-discuss mailing list submissions to
> rdkit-discuss@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
> or, via email, send a message with subject or body 'help' to
> rdkit-discuss-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
> rdkit-discuss-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Rdkit-discuss digest..."
>
>
> Today's Topics:
>
>1. Re: RDKit and Google Summer of Code 2018 (Jason Biggs)
>2. Re: RDKit and Google Summer of Code 2018 (Tim Dudgeon)
>3. Re: RDKit and Google Summer of Code 2018 (Tim Dudgeon)
>
>
> --
>
> Message: 1
> Date: Mon, 15 Jan 2018 09:20:48 -0600
> From: Jason Biggs 
> To: Greg Landrum 
> Cc: RDKit Discuss 
> Subject: Re: [Rdkit-discuss] RDKit and Google Summer of Code 2018
> Message-ID:
> 

[Rdkit-discuss] similarity maps for regression models

2018-01-24 Thread Pavel

Hello,

  I'm curious, would it be possible to use regression models for 
similarity maps drawing or only classification ones?


  If someone has a piece of code, I would appreciate this. Because I 
tried to modify the example given in the cookbook, but without success.


Pavel.



--
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