Re: [Rdkit-discuss] HasSubstructMatch return False where it shouldn't

2016-11-02 Thread Greg Landrum
Hi Michal,

The first test that I do when things like this happen is to try using the
RDKit's default behavior and checking if I get the results I expect. In
this case I do: if I read the molecule from the mol block with sanitization
then I get a match.

Now the question is why it's not happening with the partial sanitization
you are doing. The answer there lies in the fact that the SMARTS includes
aromatic atoms and bonds, but the molecule - as you are constructing it -
does not. CTAB's do not (should not) contain info about aromaticity, so the
molecule you construct includes single and double bonds, not aromatic
bonds.

If you are reading in mol blocks, I really do recommend that you go ahead
and use the sanitization, the MDL chemistry model that one gets out of mol
blocks is quite different from the rest of the RDKit.

I hope this helps,
-greg


On Tue, Nov 1, 2016 at 6:20 PM, Michał Nowotka  wrote:

> Hi,
>
> I have this molfile (CHEMBL265667):
>
>
>   11280714432D 1   1.0 0.0 0
>
>  25 27  0 0  0999 V2000
> 3.8042   -1.60000. C   0  0  0  0  0  0   0  0  0
> 4.3167   -1.90000. N   0  0  3  0  0  0   0  0  0
> 3.8042   -1.0. N   0  0  0  0  0  0   0  0  0
> 4.8417   -1.60000. N   0  0  0  0  0  0   0  0  0
> 4.3167   -2.50000. C   0  0  0  0  0  0   0  0  0
> 4.3167   -3.69170. C   0  0  0  0  0  0   0  0  0
> 4.8417   -1.0. C   0  0  0  0  0  0   0  0  0
> 4.3167   -0.70000. C   0  0  0  0  0  0   0  0  0
> 3.7917   -3.39170. C   0  0  0  0  0  0   0  0  0
> 4.8375   -3.39170. C   0  0  0  0  0  0   0  0  0
> 3.8000   -2.79170. C   0  0  0  0  0  0   0  0  0
> 4.8375   -2.79170. C   0  0  0  0  0  0   0  0  0
> 4.3167   -4.29170. C   0  0  3  0  0  0   0  0  0
> 3.2875   -1.89170. O   0  0  0  0  0  0   0  0  0
> 4.8375   -4.59170. C   0  0  0  0  0  0   0  0  0
> 4.3167   -0.09170. O   0  0  0  0  0  0   0  0  0
> 4.8292   -5.19170. C   0  0  0  0  0  0   0  0  0
> 5.3500   -4.29170. C   0  0  0  0  0  0   0  0  0
> 5.8667   -5.19170. C   0  0  0  0  0  0   0  0  0
> 3.7917   -4.59170. O   0  0  0  0  0  0   0  0  0
> 5.8667   -4.59170. C   0  0  0  0  0  0   0  0  0
> 5.3542   -5.49170. C   0  0  0  0  0  0   0  0  0
> 6.3917   -5.49170. Cl  0  0  0  0  0  0   0  0  0
> 3.2750   -3.69170. C   0  0  0  0  0  0   0  0  0
> 5.3542   -3.69170. C   0  0  0  0  0  0   0  0  0
>   2  1  1  0 0  0
>   3  1  1  0 0  0
>   4  2  1  0 0  0
>   5  2  1  0 0  0
>   6 10  1  0 0  0
>   7  8  1  0 0  0
>   8  3  1  0 0  0
>   9 11  1  0 0  0
>  10 12  2  0 0  0
>  11  5  2  0 0  0
>  12  5  1  0 0  0
>  13  6  1  0 0  0
>  14  1  2  0 0  0
>  15 13  1  0 0  0
>  16  8  2  0 0  0
>  17 15  2  0 0  0
>  18 15  1  0 0  0
>  19 21  1  0 0  0
>  20 13  1  0 0  0
>  21 18  2  0 0  0
>  22 17  1  0 0  0
>  23 19  1  0 0  0
>  24  9  1  0 0  0
>  25 10  1  0 0  0
>   4  7  2  0 0  0
>   9  6  2  0 0  0
>  22 19  2  0 0  0
> M  END
>
> and this smarts: [OH1]-C(-c1c1)c2c2
>
> I'm using this code to find a substructure:
>
> mol = Chem.MolFromMolBlock(str(molstring), sanitize=False)
> mol.UpdatePropertyCache(strict=False)
> patt = Chem.MolFromSmarts(str(smarts))
> Chem.GetSSSR(patt)
> Chem.GetSSSR(mol)
> match = mol.HasSubstructMatch(patt)
>
> and the `match` is empty.
>
> But with indigo code:
>
> mol = indigoObj.loadMolecule(str(molstring))
> patt = indigoObj.loadSmarts(str(smarts))
> match = indigoObj.substructureMatcher(mol).match(patt)
>
> match is valid and I can render this to image:
>
>
> ​
> ​I'm I missing some flag or doing something wrong?
>
> --
>
> Michal
>
> 
> --
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platfo

Re: [Rdkit-discuss] compiling with the RDKit with cairo on Fedora

2016-11-02 Thread Greg Landrum
Paul,
Yep, that's a bug in the build system.I will fix it. 
Thanks for the bug report!-greg


_
From: Paul Emsley 
Sent: Tuesday, November 1, 2016 12:49 PM
Subject: [Rdkit-discuss] compiling with the RDKit with cairo on Fedora
To: RDKit Discuss 



Hi Greg and Gianluca (in particular),

[meta: I think this is an RDKit issue rather than a Fedora one (I might be 
wrong)]

I installed rdkit-2016.03.2-6.fc24.x86_64 and now am trying to compile my 
program with that.

To do so, I include the flag -I/usr/include/rkdit

When trying to use the include file MolDraw2DCairo.h, I get the error

In file included from lbg-search.cc:37:0:  [1]
/usr/include/rdkit/MolDraw2DCairo.h:18:42: fatal error: 
GraphMol/MolDraw2D/MolDraw2D.h: No 
such file or directory
  #include 

/usr/include/rdkit/GraphMol/MolDraw2D does not exist. I think that
   MolDraw2D.h
   MolDraw2DSVG.h
   MolDraw2Dwx.h
   MolDraw2DUtils.h
are being installed into the wrong directory.

i.e. in GraphMol/MolDraw2D/CMakeLists.txt

rdkit_headers(MolDraw2D.h
   MolDraw2DSVG.h
   MolDraw2Dwx.h
   MolDraw2DUtils.h
)

needs added: DEST GraphMol/MolDraw2D

(the current git master has the same)

Thanks,

Paul.


[1] https://github.com/pemsley/coot/blob/master/lbg/lbg-search.cc


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] compiling with the RDKit with cairo on Fedora

2016-11-02 Thread Gianluca Sforna
On Tue, Nov 1, 2016 at 1:48 PM, Paul Emsley  wrote:
>
> Hi Greg and Gianluca (in particular),
>
> [meta: I think this is an RDKit issue rather than a Fedora one (I might be 
> wrong)]
>
> I installed rdkit-2016.03.2-6.fc24.x86_64 and now am trying to compile my 
> program with that.
>
> To do so, I include the flag -I/usr/include/rkdit
>
> When trying to use the include file MolDraw2DCairo.h, I get the error
>
> In file included from lbg-search.cc:37:0:  [1]
> /usr/include/rdkit/MolDraw2DCairo.h:18:42: fatal error: 
> GraphMol/MolDraw2D/MolDraw2D.h: No
> such file or directory
>   #include 
>
> /usr/include/rdkit/GraphMol/MolDraw2D does not exist. I think that
>MolDraw2D.h
>MolDraw2DSVG.h
>MolDraw2Dwx.h
>MolDraw2DUtils.h
> are being installed into the wrong directory.


Exactly:
$ sudo dnf repoquery -l rdkit-devel | grep 2D
/usr/include/rdkit/Geometry/Transform2D.h
/usr/include/rdkit/MolDraw2D.h
/usr/include/rdkit/MolDraw2DCairo.h
/usr/include/rdkit/MolDraw2DSVG.h
/usr/include/rdkit/MolDraw2DUtils.h
/usr/include/rdkit/MolDraw2Dwx.h
/usr/lib/libMolDraw2D.so
/usr/include/rdkit/Geometry/Transform2D.h
/usr/include/rdkit/MolDraw2D.h
/usr/include/rdkit/MolDraw2DCairo.h
/usr/include/rdkit/MolDraw2DSVG.h
/usr/include/rdkit/MolDraw2DUtils.h
/usr/include/rdkit/MolDraw2Dwx.h
/usr/lib64/libMolDraw2D.so


>
> i.e. in GraphMol/MolDraw2D/CMakeLists.txt
>
> rdkit_headers(MolDraw2D.h
>MolDraw2DSVG.h
>MolDraw2Dwx.h
>MolDraw2DUtils.h
> )
>
> needs added: DEST GraphMol/MolDraw2D
>
> (the current git master has the same)

I could not find this change, so I went ahead and created the patch.

Testing it in a new build right now.

-- 
Gianluca Sforna

http://plus.google.com/+gianlucasforna - http://twitter.com/giallu
Tinker Garage - http://tinkergarage.it

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] RDKit patch releases in conda?

2016-11-02 Thread James Davidson
Dear All,

I think I probably know the answer to this already, but wanted to double check 
- did any of the four 2016_03 patch releases ever get pushed to conda?
I only seem to get 2016_03_1 with "conda update -c 
https://conda.anaconda.org/rdkit rdkit"

(if not available then I guess this is academic with 2016_09_1 around the 
corner?)

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..
__--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKit patch releases in conda?

2016-11-02 Thread Riccardo Vianello
Hi James,

On Wed, Nov 2, 2016 at 3:11 PM, James Davidson 
wrote:

> I think I probably know the answer to this already, but wanted to double
> check – did any of the four 2016_03 patch releases ever get pushed to conda?
>
> I only seem to get 2016_03_1 with “conda update –c
> https://conda.anaconda.org/rdkit rdkit”
>

are you working on Windows? Pre-built conda packages targeting the 2016.03
patch releases are at this time only available for linux and osx.


> (if not available then I guess this is academic with 2016_09_1 around the
> corner?)
>

an additional patch release was tagged before the UGM, and I think it
wasn't yet pushed to the anaconda channel. if there's interest for making
this revision available, I can try to include some windows packages (for
the amd64 platform at least), otherwise it might make sense to wait for the
upcoming release?

Best regards,
Riccardo
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKit patch releases in conda?

2016-11-02 Thread Greg Landrum
Riccardo had pushed binaries for Linux and I have done most of the mac 
versions, but doing windows builds, which I suspect is what you want, is enough 
of a barrier that we haven't done those.
There is an ongoing discussion about resolving this problem, but it is 
non-trivial.
-gregP.S. Obligatory plug: this is a matter of focusing resources on an 
less-than-pleasant task; exactly the kind of thing that RDKit 
maintenance/support customers can reasonably request.


_
From: James Davidson 
Sent: Wednesday, November 2, 2016 2:32 PM
Subject: [Rdkit-discuss] RDKit patch releases in conda?
To:  




Dear All,

 

I think I probably know the answer to this already, but wanted to double check 
– did any of the four 2016_03 patch releases ever get pushed to conda?

I only seem to get 2016_03_1 with “conda update –c 
https://conda.anaconda.org/rdkit rdkit”

 

(if not available then I guess this is academic with 2016_09_1 around the 
corner?)

 

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



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKit patch releases in conda?

2016-11-02 Thread James Davidson
Hi Greg (and Riccardo),

> Riccardo had pushed binaries for Linux and I have done most of the mac 
> versions, but doing windows builds, which I suspect is what you want, is 
> enough of a barrier that we haven't done those.
> There is an ongoing discussion about resolving this problem, but it is 
> non-trivial.
It sounds like there is a chance that Riccardo will look at a win64 2016_03 
patch build for conda (which would be geat!)

> P.S. Obligatory plug: this is a matter of focusing resources on an 
> less-than-pleasant task; exactly the kind of thing that RDKit 
> maintenance/support customers can reasonably request.
That sounds fair...

Kind regards

James


_
From: James Davidson 
Sent: Wednesday, November 2, 2016 2:32 PM
Subject: [Rdkit-discuss] RDKit patch releases in conda?
To: 

Dear All,
 
I think I probably know the answer to this already, but wanted to double check 
– did any of the four 2016_03 patch releases ever get pushed to conda?
I only seem to get 2016_03_1 with “conda update –c 
https://conda.anaconda.org/rdkit rdkit”
 
(if not available then I guess this is academic with 2016_09_1 around the 
corner?)
 
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..
__


__
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..
__
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKit patch releases in conda?

2016-11-02 Thread James Davidson
Hi Riccardo,

> are you working on Windows? Pre-built conda packages targeting the 2016.03 
> patch releases are at this time only available for linux and osx.
Yes, I'm afraid so...

> an additional patch release was tagged before the UGM, and I think it wasn't 
> yet pushed to the anaconda channel. if there's interest for making this 
> revision available,
>  I can try to include some windows packages (for the amd64 platform at 
> least), otherwise it might make sense to wait for the upcoming release?
I would definitely be interested in this (py2 and py3) for win64, but if it is 
anything more than a small amount of work, then please don't do it just for me!

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..
__
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Issues with rdkit and postgresql cartridge conda installation

2016-11-02 Thread Danes, Larson
Greg,


First off, thanks very much for the speedy and helpful response. I apologize 
for not getting back and thanking you sooner. It was midterm time and I haven't 
had much time for anything besides studying.


As for your suggestion, installing the rdkit-postgresql cartridge with conda 
worked fine in a linux environment.


Thanks again,


Larson Danes


From: Greg Landrum 
Sent: Friday, October 14, 2016 10:49:23 PM
To: Danes, Larson
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] Issues with rdkit and postgresql cartridge conda 
installation

Hi Larson,

On Fri, Oct 14, 2016 at 6:17 PM, Danes, Larson 
mailto:larson.da...@und.edu>> wrote:
>
> First and foremost, please excuse any inaccuracies as I am new to the world 
> of Cheminformatics. I'll start with some background on my issue. I've got a 
> MySQL database with chemical information such as CASRNs, Annotation Class, 
> and SMILE strings. I have a web app currently in development that takes a 
> list of CASRNs as input and performs an enrichment analysis on those 
> chemicals. The goal is to now take a SMILE string as input, query the rdkit 
> postgresql database (which will consist of a table with rows that have CASRNs 
> and SMILE strings) to find any chemicals that match the input SMILE string 
> over a set threshold. These chemicals CASRNs will then become the input for 
> enrichment and the rest of the app will be agnostic toward how the CASRNs 
> were obtained.
>
>
> I suppose I should say this: if the description above isn't something rdkit 
> is suited for and I'm totally off base, please let me know! As I stated 
> earlier, I'm new to this realm.

The basic flow you describe: search a database for molecules similar to a query 
and retrieve the results is definitely right inline with what the RDKit 
cartridge can do.

> Anyway, the issues I'm facing currently involve the installation of rdkit and 
> the postgresql cartridge. I should say, I've tried this on both Windows 7 and 
> Windows 10 (work desktop in 7 and laptop is 10). So, the first question I 
> have is when running the command
>

This is the problem from which all the others stem: We don't currently provide 
conda builds of the rdkit-postgresql cartridge for any systems other than 64bit 
linux. There hasn't been a lot of demand for this and it's a non-zero amount of 
work to set things up, so it hasn't happened.

Do you have access to linux? The cartridge should work fine on a VM running on 
your windows machine (using virtual box) or using the new "Bash on Windows" 
subsystem in Windows 10 
(https://msdn.microsoft.com/en-us/commandline/wsl/about?f=255&MSPPError=-2147217396)

-greg



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Different default behaviour for Kekulize in Python and C++

2016-11-02 Thread David Cosgrove
Hi All,

As I've been transliterating the GettingStartedInPython to
GettingStartedInC++, I've noticed that you get different default behaviour
from Kekulize in the two languages:

m = Chem.MolFromSmiles('c1c1')
print( 'Order : {}'.format( m.GetBondWithIdx(0).GetBondType() ) )
print( 'Aromatic : {}'.format( m.GetBondWithIdx(0).GetIsAromatic() ) )
Chem.Kekulize(m)
print( 'After default Kekulize : Aromatic : {}'.format(
m.GetBondWithIdx(0).GetIsAromatic() ) )

m1 = Chem.MolFromSmiles('c1c1')
Chem.Kekulize(m1 , clearAromaticFlags=False )
print( 'After Kekulize, clearAromaticFlags False : Aromatic : {}'.format(
m1.GetBondWithIdx(0).GetIsAromatic() ) )

m2 = Chem.MolFromSmiles('c1c1')
Chem.Kekulize(m2 , clearAromaticFlags=True )
print( 'After Kekulize, clearAromaticFlags True : Aromatic : {}'.format(
m2.GetBondWithIdx(0).GetIsAromatic() ) )

gives

Order : AROMATIC
Aromatic : True
After default Kekulize : Aromatic : True
After Kekulize, clearAromaticFlags False : Aromatic : True
After Kekulize, clearAromaticFlags True : Aromatic : False

Whereas the corresponding C++

 RDKit::RWMOL_SPTR mol( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1" )
) );
  std::cout << "Order : " << mol->getBondWithIdx( 0 )->getBondType() <<
std::endl;
  std::cout << "Aromatic : " << mol->getBondWithIdx( 0 )->getIsAromatic()
<< std::endl;

  RDKit::MolOps::Kekulize( *mol );
  std::cout << "After default Kekulize : Aromatic : " <<
mol->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

  RDKit::RWMOL_SPTR mol1( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1"
) ) );
  RDKit::MolOps::Kekulize( *mol1 , false );
  std::cout << "After Kekulize, markAtomsBonds false : Aromatic : " <<
mol1->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

  RDKit::RWMOL_SPTR mol2( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1"
) ) );
  RDKit::MolOps::Kekulize( *mol2 , true );
  std::cout << "After Kekulize, markAtomsBonds true : Aromatic : " <<
mol2->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

gives

Order : 12
Aromatic : 1
After default Kekulize : Aromatic : 0
After Kekulize, markAtomsBonds false : Aromatic : 1
After Kekulize, markAtomsBonds true : Aromatic : 0


I.e. by default the Python version clears the Aromatic flags on the bonds,
the C++ doesn't.  That seemed sufficiently anomalous to point out and
consider whether they should be unified.  Although there's a strong
possibility that that would be a breaking change for people's code.

I attach the full program files for the two versions if you want to
reproduce it.  This is on a recent pull of the github code
(e9af48ffd77c5a219a1671a63704aa815c08b348)
//
// Modifying molecules example9.cpp

#include 

#include 
#include 
#include 

int main( int argc , char **argv ) {

  RDKit::RWMOL_SPTR mol( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1" ) ) );
  std::cout << "Order : " << mol->getBondWithIdx( 0 )->getBondType() << std::endl;
  std::cout << "Aromatic : " << mol->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

  RDKit::MolOps::Kekulize( *mol );
  std::cout << "After default Kekulize : Aromatic : " << mol->getBondWithIdx( 0 )->getIsAromatic() << std::endl;
 
  RDKit::RWMOL_SPTR mol1( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1" ) ) );
  RDKit::MolOps::Kekulize( *mol1 , false );
  std::cout << "After Kekulize, markAtomsBonds false : Aromatic : " << mol1->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

  RDKit::RWMOL_SPTR mol2( new RDKit::RWMol( *RDKit::SmilesToMol( "c1c1" ) ) );
  RDKit::MolOps::Kekulize( *mol2 , true );
  std::cout << "After Kekulize, markAtomsBonds true : Aromatic : " << mol2->getBondWithIdx( 0 )->getIsAromatic() << std::endl;

}
#!/usr/bin/env python

from rdkit import Chem

m = Chem.MolFromSmiles('c1c1')
print( 'Order : {}'.format( m.GetBondWithIdx(0).GetBondType() ) )
print( 'Aromatic : {}'.format( m.GetBondWithIdx(0).GetIsAromatic() ) )
Chem.Kekulize(m)
print( 'After default Kekulize : Aromatic : {}'.format( m.GetBondWithIdx(0).GetIsAromatic() ) )

m1 = Chem.MolFromSmiles('c1c1')
Chem.Kekulize(m1 , clearAromaticFlags=False )
print( 'After Kekulize, clearAromaticFlags False : Aromatic : {}'.format( m1.GetBondWithIdx(0).GetIsAromatic() ) )

m2 = Chem.MolFromSmiles('c1c1')
Chem.Kekulize(m2 , clearAromaticFlags=True )
print( 'After Kekulize, clearAromaticFlags True : Aromatic : {}'.format( m2.GetBondWithIdx(0).GetIsAromatic() ) )
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] rdkit-postgresql cartridge not included in repository install?

2016-11-02 Thread Larson Danes
Hi all,

I was able to get the rdkit-postgresql cartridge working in a conda virtual
env after installing everything (rdkit, postgresql, rdkit-postgresql
cartridge) on a linux VM after getting help in this
 thread.

The gist of the problem I'm trying to solve now is this: get rdkit running
as a server via the postgresql cartridge and call it from a web
application.

To do this, I assume I need to use rdkit and the postgresql cartridge
outside of the conda virtual environment. After installing rdkit from
repository as per the documentation, I proceeded to install postgresql from
apt. Then, I created my database, started it, and attempted to create the
rdkit extension. I was then greeted with a familiar error: "No such file
'rdkit.control'".

My first attempt at a solution was to install the rdkit-postgresql
cartridge from conda. I did so, and moved the relevant (all) files into the
directory in which postgresql was looking for 'rdkit.control' and
'rdkit--3.4.sql' and so on. This was met with failure as there was one
library that I was not able to locate and move (in the conda install,
github, or with apt-file) which was something along the lines of
"libAvalon.so.1".

My question, then, is what is the process for getting the rdkit-postgresql
cartridge up and running outside of a conda virtual environment (in a linux
environment)? And, probably more to the point, is this the best option for
the webserver use case?

Any help here is greatly appreciated.

Thanks all,

Larson Danes
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss