I didn't expect it to be so easy !! I took me no effort at all :p
Anyway -- thanks for this really gentle introduction to the code. I guess I
will just familiarize myself with checking out, editing and rebuilding the
code other than the actual development. Till next time I need something...
The only thing left for me to offer is that if you give me rights I will
include it in the documentation
http://code.google.com/p/rdkit/wiki/DatabaseCartridgeReferenceDocumentation
Of course I will make a note that it will be released in the next version...
(2011_02?)
Cheers
JP
On 10 March 2011 05:24, Greg Landrum <greg.land...@gmail.com> wrote:
> Hi JP,
>
> On Wed, Mar 9, 2011 at 3:27 PM, JP <jeanpaul.ebe...@inhibox.com> wrote:
> > Following the documentation on:
> >
> http://code.google.com/p/rdkit/wiki/DatabaseCartridgeReferenceDocumentation
> > I can see no obvious way how to calculate rotatable bonds per molecule
> > through the database cartridge.
>
> Yeah, that's not exposed yet.
>
> > If there isn't a way: how difficult would it be to add this myself? (I
> need
> > this info through sql so I can just use it in my queries).
> > Presumably RDkit already does this: and it is just missing on the DB API.
> > Correct?
>
> yep.
>
> > Where do I start?
>
> I was torn here between explaining how to do it and just doing it,
> which probably is quicker. :-)
>
> Then I realized I could just do it and point you to how it was done,
> so here we go.
>
> At the moment the rotatable bonds count is done purely in Python using
> the code in
> $RDBASE/rdkit/Chem/Lipinski.py
> It counts the number of times the SMARTS pattern
> [!$(*#*)&!D1]-&!@[!$(*#*)&!D1] matches the molecule. This should
> ideally be added as a function in the C++ interface, and I will do
> that at some point, but for this example I did the simpler thing and
> added the computation to the cartridge code directly.
>
> I checked this in with rev1659:
> http://rdkit.svn.sourceforge.net/viewvc/rdkit?view=revision&revision=1659
>
> The first thing I did was add the computation function in C++ in
> adapter.cpp:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/adapter.cpp?r1=1659&r2=1658&pathrev=1659
> It's pretty simple: count the number of times the substructure appears.
>
> This is also added to the rdkit.h header:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/rdkit.h?r1=1659&r2=1658&pathrev=1659
>
> Then I needed to make this available in C so that postgresql can call
> it. That's here:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/mol_op.c?r1=1659&r2=1658&pathrev=1659
>
> Add the function definition for postgresql:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/rdkit.sql.in?r1=1659&r2=1658&pathrev=1659
>
> and then add a test:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/sql/props.sql?r1=1659&r2=1658&pathrev=1659
> and the expected result:
>
> http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/PgSQL/rdkit/expected/props.out?r1=1659&r2=1658&pathrev=1659
>
> after that, I ran "make", "make install", and "make installcheck" and
> it was done.
>
> Hope that helps,
> -greg
>
--
Jean-Paul Ebejer
Early Stage Researcher
InhibOx Ltd
Pembroke House
36-37 Pembroke Street
Oxford
OX1 1BP
UK
(+44 / 0) 1865 262 034
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
Any unauthorised dissemination or copying of this email or its attachments,
and any use or disclosure of any information contained in them, is strictly
prohibited and may be illegal. If you have received this email in error
please notify the sender and delete all copies from your system.
We and our group companies accept no liability or responsibility for
personal emails or emails unconnected with our business.
Internet communications including emails and access and use of web sites
cannot be guaranteed to be secure or error free as information can be
intercepted, corrupted, lost or arrive late. Furthermore, while we have
taken steps to control the spread of viruses on our systems, we cannot
guarantee that this email and any files transmitted with it are virus free.
No liability is accepted for any errors, omissions, interceptions, corrupted
mail, lost communications or late delivery arising as a result of receiving
this message via the Internet or for any virus that may be contained in it.
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss