Re: [Rdkit-discuss] ring bond query

2016-04-13 Thread Yingfeng Wang
Brian,

Thank you very much! It works. The updated code is given as follows.


#include 
#include 
#include 
#include 
#include 
#include 


using namespace RDKit;
using namespace std;

int main(int argc, const char * argv[])
{
RWMol* pCurMol;
MolGraph curTopology;
vector viiRingBonds;
string sSmiles = "Oc1ncnnc1-c1c1";
list
>::const_iterator itEdge;

pCurMol = SmilesToMol(sSmiles, 0, false);
MolOps::findSSSR(*(pCurMol));
curTopology = pCurMol->getTopology();
viiRingBonds = pCurMol->getRingInfo()->bondRings();
for (itEdge = curTopology.m_edges.begin(); itEdge !=
curTopology.m_edges.end(); ++itEdge)
if (queryIsBondInRing(itEdge->m_property.get()))
cout<<"get one ring bond"< wrote:

> Not sure if it will help, but the python version of IsInRing checks to see
> if the sssr is initialized.  Here is the C++ code that is used, you may be
> able to adapt it to your needs:
>
> bool BondIsInRing(const Bond *bond) {
>   if (!bond->getOwningMol().getRingInfo()->isInitialized()) {
> MolOps::findSSSR(bond->getOwningMol());
>   }
>   return bond->getOwningMol().getRingInfo()->numBondRings(bond->getIdx())
> != 0;
> }
>
>
> On Wed, Apr 13, 2016 at 11:59 AM, Yingfeng Wang 
> wrote:
>
>> Paolo,
>>
>> Thanks. As I mentioned in the end of my question, setting this flag true
>> may cause other problems. In the python version, the sanitize flag is also
>> false, but it works. Is it possible to figure out a workaround for checking
>> whether each bond is in a ring in the C++ version?
>>
>> Best,
>> Yingfeng
>>
>> On Wed, Apr 13, 2016 at 11:53 AM, Paolo Tosco 
>> wrote:
>>
>>> Dear Yingfeng,
>>>
>>> the reason why RingInfo is not initialized is that you are invoking
>>> SmilesToMol() with the sanitize flag set to false; setting that parameter
>>> to true in the SmilesToMol() call should fix your problem.
>>>
>>> Kind regards,
>>> Paolo
>>>
>>>
>>> On 4/13/2016 16:48, Yingfeng Wang wrote:
>>>
>>> This is my C++ code.
>>>
>>>
>>> #include 
>>> #include 
>>> #include 
>>> #include 
>>> #include 
>>>
>>> using namespace RDKit;
>>> using namespace std;
>>>
>>> int main(int argc, const char * argv[])
>>> {
>>> RWMol* pCurMol;
>>> MolGraph curTopology;
>>> vector viiRingBonds;
>>> string sSmiles = "Oc1ncnnc1-c1c1";
>>> list
>>> >::const_iterator itEdge;
>>>
>>> pCurMol = SmilesToMol(sSmiles, 0, false);
>>> curTopology = pCurMol->getTopology();
>>> viiRingBonds = pCurMol->getRingInfo()->bondRings();
>>> for (itEdge = curTopology.m_edges.begin(); itEdge !=
>>> curTopology.m_edges.end(); ++itEdge)
>>> if (queryIsBondInRing(itEdge->m_property.get()))
>>> cout<<"get one ring bond"<>>
>>> return 0;
>>> }
>>>
>>> It crashes in the following line
>>>
>>> queryIsBondInRing(itEdge->m_property.get())
>>>
>>> with the following information.
>>>
>>> Pre-condition Violation
>>> RingInfo not initialized
>>> Violation occurred on line 67 in file
>>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp
>>> Failed Expression: df_init
>>> 
>>>
>>> libc++abi.dylib: terminating with uncaught exception of type
>>> Invar::Invariant: Pre-condition Violation
>>>
>>>
>>> Actually, the corresponding python version works.
>>>
>>> >>> from rdkit import Chem
>>> >>> sSmiles = "Oc1ncnnc1-c1c1"
>>> >>> curMol =Chem.MolFromSmiles(sSmiles, False)
>>> >>> iBondsNum = curMol.GetNumBonds()
>>> >>> for i in range(iBondsNum):
>>> ... current_bond = curMol.GetBondWithIdx(i)
>>> ... if current_bond.IsInRing():
>>> ... print i
>>> ...
>>> 1
>>> 2
>>> 3
>>> 4
>>> 5
>>> 7
>>> 8
>>> 9
>>> 10
>>> 11
>>> 12
>>> 13
>>>
>>>
>>> Please note that the problem cannot be solved by using
>>> SmilesToMol(sSmiles, 0, true);
>>>
>>> because it may cause other problems, e.g.,
>>> string sSmiles = "c.c";
>>> Therefore, I would like to stay with SmilesToMol(sSmiles, 0, false);
>>>
>>> Could you please give me some hints for fixing the C++ version, and
>>> getting the similar results of the python version.
>>>
>>>
>>> --
>>> Find and fix application performance issues faster with Applications Manager
>>> Applications Manager provides deep performance insights into multiple tiers 
>>> of
>>> your business applications. It resolves application problems quickly and
>>> reduces your MTTR. Get your free 
>>> trial!https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>>
>>>
>>>
>>> ___
>>> Rdkit-discuss mailing 
>>> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>>
>>>
>>
>>
>> 

Re: [Rdkit-discuss] ring bond query

2016-04-13 Thread Brian Kelley
Not sure if it will help, but the python version of IsInRing checks to see
if the sssr is initialized.  Here is the C++ code that is used, you may be
able to adapt it to your needs:

bool BondIsInRing(const Bond *bond) {
  if (!bond->getOwningMol().getRingInfo()->isInitialized()) {
MolOps::findSSSR(bond->getOwningMol());
  }
  return bond->getOwningMol().getRingInfo()->numBondRings(bond->getIdx())
!= 0;
}


On Wed, Apr 13, 2016 at 11:59 AM, Yingfeng Wang  wrote:

> Paolo,
>
> Thanks. As I mentioned in the end of my question, setting this flag true
> may cause other problems. In the python version, the sanitize flag is also
> false, but it works. Is it possible to figure out a workaround for checking
> whether each bond is in a ring in the C++ version?
>
> Best,
> Yingfeng
>
> On Wed, Apr 13, 2016 at 11:53 AM, Paolo Tosco 
> wrote:
>
>> Dear Yingfeng,
>>
>> the reason why RingInfo is not initialized is that you are invoking
>> SmilesToMol() with the sanitize flag set to false; setting that parameter
>> to true in the SmilesToMol() call should fix your problem.
>>
>> Kind regards,
>> Paolo
>>
>>
>> On 4/13/2016 16:48, Yingfeng Wang wrote:
>>
>> This is my C++ code.
>>
>>
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>>
>> using namespace RDKit;
>> using namespace std;
>>
>> int main(int argc, const char * argv[])
>> {
>> RWMol* pCurMol;
>> MolGraph curTopology;
>> vector viiRingBonds;
>> string sSmiles = "Oc1ncnnc1-c1c1";
>> list
>> >::const_iterator itEdge;
>>
>> pCurMol = SmilesToMol(sSmiles, 0, false);
>> curTopology = pCurMol->getTopology();
>> viiRingBonds = pCurMol->getRingInfo()->bondRings();
>> for (itEdge = curTopology.m_edges.begin(); itEdge !=
>> curTopology.m_edges.end(); ++itEdge)
>> if (queryIsBondInRing(itEdge->m_property.get()))
>> cout<<"get one ring bond"<>
>> return 0;
>> }
>>
>> It crashes in the following line
>>
>> queryIsBondInRing(itEdge->m_property.get())
>>
>> with the following information.
>>
>> Pre-condition Violation
>> RingInfo not initialized
>> Violation occurred on line 67 in file
>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp
>> Failed Expression: df_init
>> 
>>
>> libc++abi.dylib: terminating with uncaught exception of type
>> Invar::Invariant: Pre-condition Violation
>>
>>
>> Actually, the corresponding python version works.
>>
>> >>> from rdkit import Chem
>> >>> sSmiles = "Oc1ncnnc1-c1c1"
>> >>> curMol =Chem.MolFromSmiles(sSmiles, False)
>> >>> iBondsNum = curMol.GetNumBonds()
>> >>> for i in range(iBondsNum):
>> ... current_bond = curMol.GetBondWithIdx(i)
>> ... if current_bond.IsInRing():
>> ... print i
>> ...
>> 1
>> 2
>> 3
>> 4
>> 5
>> 7
>> 8
>> 9
>> 10
>> 11
>> 12
>> 13
>>
>>
>> Please note that the problem cannot be solved by using
>> SmilesToMol(sSmiles, 0, true);
>>
>> because it may cause other problems, e.g.,
>> string sSmiles = "c.c";
>> Therefore, I would like to stay with SmilesToMol(sSmiles, 0, false);
>>
>> Could you please give me some hints for fixing the C++ version, and
>> getting the similar results of the python version.
>>
>>
>> --
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers 
>> of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free 
>> trial!https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>
>>
>>
>> ___
>> Rdkit-discuss mailing 
>> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>>
>
>
> --
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list

Re: [Rdkit-discuss] ring bond query

2016-04-13 Thread Yingfeng Wang
Paolo,

Thanks. As I mentioned in the end of my question, setting this flag true
may cause other problems. In the python version, the sanitize flag is also
false, but it works. Is it possible to figure out a workaround for checking
whether each bond is in a ring in the C++ version?

Best,
Yingfeng

On Wed, Apr 13, 2016 at 11:53 AM, Paolo Tosco  wrote:

> Dear Yingfeng,
>
> the reason why RingInfo is not initialized is that you are invoking
> SmilesToMol() with the sanitize flag set to false; setting that parameter
> to true in the SmilesToMol() call should fix your problem.
>
> Kind regards,
> Paolo
>
>
> On 4/13/2016 16:48, Yingfeng Wang wrote:
>
> This is my C++ code.
>
>
> #include 
> #include 
> #include 
> #include 
> #include 
>
> using namespace RDKit;
> using namespace std;
>
> int main(int argc, const char * argv[])
> {
> RWMol* pCurMol;
> MolGraph curTopology;
> vector viiRingBonds;
> string sSmiles = "Oc1ncnnc1-c1c1";
> list
> >::const_iterator itEdge;
>
> pCurMol = SmilesToMol(sSmiles, 0, false);
> curTopology = pCurMol->getTopology();
> viiRingBonds = pCurMol->getRingInfo()->bondRings();
> for (itEdge = curTopology.m_edges.begin(); itEdge !=
> curTopology.m_edges.end(); ++itEdge)
> if (queryIsBondInRing(itEdge->m_property.get()))
> cout<<"get one ring bond"<
> return 0;
> }
>
> It crashes in the following line
>
> queryIsBondInRing(itEdge->m_property.get())
>
> with the following information.
>
> Pre-condition Violation
> RingInfo not initialized
> Violation occurred on line 67 in file
> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp
> Failed Expression: df_init
> 
>
> libc++abi.dylib: terminating with uncaught exception of type
> Invar::Invariant: Pre-condition Violation
>
>
> Actually, the corresponding python version works.
>
> >>> from rdkit import Chem
> >>> sSmiles = "Oc1ncnnc1-c1c1"
> >>> curMol =Chem.MolFromSmiles(sSmiles, False)
> >>> iBondsNum = curMol.GetNumBonds()
> >>> for i in range(iBondsNum):
> ... current_bond = curMol.GetBondWithIdx(i)
> ... if current_bond.IsInRing():
> ... print i
> ...
> 1
> 2
> 3
> 4
> 5
> 7
> 8
> 9
> 10
> 11
> 12
> 13
>
>
> Please note that the problem cannot be solved by using
> SmilesToMol(sSmiles, 0, true);
>
> because it may cause other problems, e.g.,
> string sSmiles = "c.c";
> Therefore, I would like to stay with SmilesToMol(sSmiles, 0, false);
>
> Could you please give me some hints for fixing the C++ version, and
> getting the similar results of the python version.
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free 
> trial!https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
>
> ___
> Rdkit-discuss mailing 
> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] ring bond query

2016-04-13 Thread Paolo Tosco

Dear Yingfeng,

the reason why RingInfo is not initialized is that you are invoking 
SmilesToMol() with the sanitize flag set to false; setting that 
parameter to true in the SmilesToMol() call should fix your problem.


Kind regards,
Paolo

On 4/13/2016 16:48, Yingfeng Wang wrote:

This is my C++ code.


#include 
#include 
#include 
#include 
#include 

using namespace RDKit;
using namespace std;

int main(int argc, const char * argv[])
{
RWMol* pCurMol;
MolGraph curTopology;
vector viiRingBonds;
string sSmiles = "Oc1ncnnc1-c1c1";
list 
>::const_iterator itEdge;


pCurMol = SmilesToMol(sSmiles, 0, false);
curTopology = pCurMol->getTopology();
viiRingBonds = pCurMol->getRingInfo()->bondRings();
for (itEdge = curTopology.m_edges.begin(); itEdge != 
curTopology.m_edges.end(); ++itEdge)

if (queryIsBondInRing(itEdge->m_property.get()))
cout<<"get one ring bond"<m_property.get())

with the following information.

Pre-condition Violation
RingInfo not initialized
Violation occurred on line 67 in file 
/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code/GraphMol/RingInfo.cpp

Failed Expression: df_init


libc++abi.dylib: terminating with uncaught exception of type 
Invar::Invariant: Pre-condition Violation



Actually, the corresponding python version works.

>>> from rdkit import Chem
>>> sSmiles = "Oc1ncnnc1-c1c1"
>>> curMol =Chem.MolFromSmiles(sSmiles, False)
>>> iBondsNum = curMol.GetNumBonds()
>>> for i in range(iBondsNum):
... current_bond = curMol.GetBondWithIdx(i)
... if current_bond.IsInRing():
... print i
...
1
2
3
4
5
7
8
9
10
11
12
13


Please note that the problem cannot be solved by using
SmilesToMol(sSmiles, 0, true);

because it may cause other problems, e.g.,
string sSmiles = "c.c";
Therefore, I would like to stay with SmilesToMol(sSmiles, 0, false);

Could you please give me some hints for fixing the C++ version, and 
getting the similar results of the python version.



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] assign E/Z information to double bond and write to SMILES

2016-04-13 Thread Rafal Roszak
On Wed, 13 Apr 2016 10:52:47 +0200
Greg Landrum  wrote:

> The RDKit does determine E/Z labels for double bonds. Here's a simple
> In [4]: m.GetBondWithIdx(0).GetStereo()
> Out[4]: rdkit.Chem.rdchem.BondStereo.STEREOE


Thank you for comment. My input SMILES does not contain stereo-information, 
basically my problem is how to set this within RDKit.
Is there any way to set stereo information to double bond?

Regards,


Rafal


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] DLL load failed error

2016-04-13 Thread Paolo Tosco

Dear Peter,

I have just tried to install the wheel file that you mentioned (I guess 
downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) and I 
get the following (unexpected) error message on a Windows 10 64-bit OS, 
even though I am running a Python 2.7 32-bit pip:


C:\Users\paolo>C:\Python27_32\Scripts\pip install 
C:\Users\paolo\Downloads\numpy-1.11.0+mkl-cp27-cp27m-win32.whl
numpy-1.11.0+mkl-cp27-cp27m-win32.whl is not a supported wheel on this 
platform.


Installing numpy from the standard pip repository works just fine:
C:\Python27_32\Scripts\pip install numpy
Collecting numpy
Installing collected packages: numpy
Successfully installed numpy-1.11.0

I would also make sure that there isn't a python27.dll somewhere along 
your PATH locations; when I ran this script on my system


@echo off
for %%A in ("%path:;=";"%") do (
dir %%~A\python*.dll 2> NUL
)

it found C:\WINDOWS\system32\Python27.dll that I didn't know to be there.

Hope that helps,
Paolo

On 4/13/2016 9:16, Peter Hunt wrote:


Hi Paolo,

Thanks for the reply. I did have a 64-bit Python installation but it 
**should** have all been uninstalled.


I have the same as you when I run python and there is nothing in the 
PATH which would suggest I’m picking up something from elsewhere.


Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC 
v.1500 32 bit (Intel)] on win32


Type "help", "copyright", "credits" or "license" for more information.

>>>

Prior to installation of the RDKit files, I have also had to install 
numpy (numpy-1.11.0+mkl-cp27-cp27m-win32.whl), scipy 
(scipy-0.17.0-cp27-none-win32.whl), pip version 8 and scikit-learn as 
I wanted to use the Random Forest classifier out of sklearn.ensemble 
and had to have an up-to-date version of scipy to get that to do more 
than a very small data matrix. To get that (scipy) to work I had to 
have the numpy+mkl installation from the wheel file above or else I 
find a similar DLL load failure for part of the scipy modules. All 
these were installed by means of pip and should be Python 2.7 and 
32bit versions.


Hence there are plenty of things that could be getting in the way of 
the RDKit installation but I wondered if there was anything known 
regarding this DLL error. Would redoing the installations in a 
different order (ie RDKit before numpy & scipy) make a difference..?


Regards

*/Peter/*

*From:*Paolo Tosco [mailto:paolo.to...@unito.it]
*Sent:* 12 April 2016 14:58
*To:* Peter Hunt 
*Subject:* Re: [Rdkit-discuss] DLL load failed error

Dear Peter,

I am running Windows 10 with 64-bit Python but I just installed 32-bit 
Python 2.7.11 under C:\Python27_32 to test this out.
I unzipped RDKit_2015_03_1.win32.py27.zip into C:\, then opened up a 
shell and issued the following commands:


Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\paolo>set RDBASE=C:RDKit_2014_03_1

C:\Users\paolo>set PYTHONPATH=%RDBASE%

C:\Users\paolo>set PATH=%RDBASE%\lib;%PATH%

C:\Users\paolo>C:\Python27_32\python.exe
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC 
v.1500 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> import rdkit
>>> from rdkit import Chem
>>>

Could it be that you have a 64-bit Python in your PATH which gets in 
the way? I get the error message that you got when try to import rdkit 
and then Chem from a 64-bit Python shell.


Kind regards,
Paolo

On 4/12/2016 10:34, Peter Hunt wrote:

Dear All,

I’m trying to install and run the latest RDKit version (2015_03_1)
for Python 2.7 and 32bit windows OS running Win10 from SourceForge.

I’m running into the “ImportError: DLL load failed: %1 is not a
valid Win32 application” and the links on the
RDKit/docs/install.html for Win7 are not helpful.

Any recommendations as to how I can get around this..? Usually
this is a conflict of versions 64/32bit but I have installed 32bit
versions of everything required.

Thanks in advance.

Regards

*/Peter/*





--

Find and fix application performance issues faster with Applications Manager

Applications Manager provides deep performance insights into multiple tiers 
of

your business applications. It resolves application problems quickly and

reduces your MTTR. Get your free trial!

https://ad.doubleclick.net/ddm/clk/302982198;130105516;z




___

Rdkit-discuss mailing list

Rdkit-discuss@lists.sourceforge.net


https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into 

Re: [Rdkit-discuss] assign E/Z information to double bond and write to SMILES

2016-04-13 Thread Greg Landrum
Hi Rafal,

On Tue, Apr 12, 2016 at 3:33 PM, Rafal Roszak  wrote:

>
> Is there any way to assign information about double bond configuration
> (E or Z) and export the structure (with E/Z information) as a SMILES?
>
>
The RDKit does determine E/Z labels for double bonds. Here's a simple
example:

In [2]: mb = """
   ...:   Mrv1561 04131610462D
   ...:
   ...:   4  3  0  0  0  0999 V2000
   ...:-1.0714   -1.56250. C   0  0  0  0  0  0  0  0  0  0  0
 0
   ...:-0.2464   -1.56250. C   0  0  0  0  0  0  0  0  0  0  0
 0
   ...:-1.4839   -0.84800. C   0  0  0  0  0  0  0  0  0  0  0
 0
   ...: 0.1661   -2.27700. C   0  0  0  0  0  0  0  0  0  0  0
 0
   ...:   1  2  2  0  0  0  0
   ...:   1  3  1  0  0  0  0
   ...:   2  4  1  0  0  0  0
   ...: M  END
   ...: """
In [3]: m = Chem.MolFromMolBlock(mb)
In [4]: m.GetBondWithIdx(0).GetStereo()
Out[4]: rdkit.Chem.rdchem.BondStereo.STEREOE

If you then generate a SMILES for that molecule, you do get information
about double bond stereochemistry:

In [5]: Chem.MolToSmiles(m,True)
Out[5]: 'C/C=C/C'

Here's the documentation for double bond stereochemistry in SMILES, which
doesn't support E/Z labels:
http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html#RTFToC23

When you construct a molecule from this SMILES, the RDKit perceives the
stereochemistry:

In [6]: m2 = Chem.MolFromSmiles('C/C=C/C')
In [7]: m2.GetBondWithIdx(1).GetStereo()
Out[7]: rdkit.Chem.rdchem.BondStereo.STEREOE

I want to find the most stable E/Z-isomer for given SMILES and I wonder to
> know how much RDKit can help me.
>

The RDKit can determine (and store) the E/Z labels for you, but figuring
out which of the stereoisomers is the most stable is a problem that it
cannot solve. That would require some quantum mechanics and, most likely,
human intervention and thought.

Best,
-greg
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] DLL load failed error

2016-04-13 Thread Greg Landrum
Peter: any chance that you could switch to using anaconda python? It can be
helpful with the "DLL hell" problem.

-greg


On Wed, Apr 13, 2016 at 10:16 AM, Peter Hunt  wrote:

> Hi Paolo,
>
>
>
> Thanks for the reply. I did have a 64-bit Python installation but it *
> *should** have all been uninstalled.
>
> I have the same as you when I run python and there is nothing in the PATH
> which would suggest I’m picking up something from elsewhere.
>
>
>
> Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32
> bit (Intel)] on win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>>
>
>
>
> Prior to installation of the RDKit files, I have also had to install numpy
> (numpy-1.11.0+mkl-cp27-cp27m-win32.whl), scipy
> (scipy-0.17.0-cp27-none-win32.whl), pip version 8 and scikit-learn as I
> wanted to use the Random Forest classifier out of sklearn.ensemble and had
> to have an up-to-date version of scipy to get that to do more than a very
> small data matrix. To get that (scipy) to work I had to have the numpy+mkl
> installation from the wheel file above or else I find a similar DLL load
> failure for part of the scipy modules. All these were installed by means of
> pip and should be Python 2.7 and 32bit versions.
>
>
>
> Hence there are plenty of things that could be getting in the way of the
> RDKit installation but I wondered if there was anything known regarding
> this DLL error. Would redoing the installations in a different order (ie
> RDKit before numpy & scipy) make a difference..?
>
> Regards
>
> *Peter*
>
> *From:* Paolo Tosco [mailto:paolo.to...@unito.it]
> *Sent:* 12 April 2016 14:58
> *To:* Peter Hunt 
> *Subject:* Re: [Rdkit-discuss] DLL load failed error
>
>
>
> Dear Peter,
>
> I am running Windows 10 with 64-bit Python but I just installed 32-bit
> Python 2.7.11 under C:\Python27_32 to test this out.
> I unzipped RDKit_2015_03_1.win32.py27.zip into C:\, then opened up a shell
> and issued the following commands:
>
> Microsoft Windows [Version 10.0.10586]
> (c) 2015 Microsoft Corporation. All rights reserved.
>
> C:\Users\paolo>set RDBASE=C:RDKit_2014_03_1
>
> C:\Users\paolo>set PYTHONPATH=%RDBASE%
>
> C:\Users\paolo>set PATH=%RDBASE%\lib;%PATH%
>
> C:\Users\paolo>C:\Python27_32\python.exe
> Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32
> bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import rdkit
> >>> from rdkit import Chem
> >>>
>
> Could it be that you have a 64-bit Python in your PATH which gets in the
> way? I get the error message that you got when try to import rdkit and then
> Chem from a 64-bit Python shell.
>
> Kind regards,
> Paolo
>
> On 4/12/2016 10:34, Peter Hunt wrote:
>
> Dear All,
>
>
>
> I’m trying to install and run the latest RDKit version (2015_03_1) for
> Python 2.7 and 32bit windows OS running Win10 from SourceForge.
>
> I’m running into the “ImportError: DLL load failed: %1 is not a valid
> Win32 application” and the links on the RDKit/docs/install.html for Win7
> are not helpful.
>
> Any recommendations as to how I can get around this..? Usually this is a
> conflict of versions 64/32bit but I have installed 32bit versions of
> everything required.
>
> Thanks in advance.
>
> Regards
>
> *Peter*
>
>
>
>
>
>
> --
>
> Find and fix application performance issues faster with Applications Manager
>
> Applications Manager provides deep performance insights into multiple tiers of
>
> your business applications. It resolves application problems quickly and
>
> reduces your MTTR. Get your free trial!
>
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
>
>
> ___
>
> Rdkit-discuss mailing list
>
> Rdkit-discuss@lists.sourceforge.net
>
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
>
>
> --
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!

Re: [Rdkit-discuss] DLL load failed error

2016-04-13 Thread Peter Hunt
Hi Paolo,

Thanks for the reply. I did have a 64-bit Python installation but it *should* 
have all been uninstalled.
I have the same as you when I run python and there is nothing in the PATH which 
would suggest I'm picking up something from elsewhere.

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Prior to installation of the RDKit files, I have also had to install numpy 
(numpy-1.11.0+mkl-cp27-cp27m-win32.whl), scipy 
(scipy-0.17.0-cp27-none-win32.whl), pip version 8 and scikit-learn as I wanted 
to use the Random Forest classifier out of sklearn.ensemble and had to have an 
up-to-date version of scipy to get that to do more than a very small data 
matrix. To get that (scipy) to work I had to have the numpy+mkl installation 
from the wheel file above or else I find a similar DLL load failure for part of 
the scipy modules. All these were installed by means of pip and should be 
Python 2.7 and 32bit versions.

Hence there are plenty of things that could be getting in the way of the RDKit 
installation but I wondered if there was anything known regarding this DLL 
error. Would redoing the installations in a different order (ie RDKit before 
numpy & scipy) make a difference..?
Regards
Peter
From: Paolo Tosco [mailto:paolo.to...@unito.it]
Sent: 12 April 2016 14:58
To: Peter Hunt 
Subject: Re: [Rdkit-discuss] DLL load failed error

Dear Peter,

I am running Windows 10 with 64-bit Python but I just installed 32-bit Python 
2.7.11 under C:\Python27_32 to test this out.
I unzipped RDKit_2015_03_1.win32.py27.zip into C:\, then opened up a shell and 
issued the following commands:

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\paolo>set RDBASE=C:RDKit_2014_03_1

C:\Users\paolo>set PYTHONPATH=%RDBASE%

C:\Users\paolo>set PATH=%RDBASE%\lib;%PATH%

C:\Users\paolo>C:\Python27_32\python.exe
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdkit
>>> from rdkit import Chem
>>>

Could it be that you have a 64-bit Python in your PATH which gets in the way? I 
get the error message that you got when try to import rdkit and then Chem from 
a 64-bit Python shell.

Kind regards,
Paolo
On 4/12/2016 10:34, Peter Hunt wrote:
Dear All,

I'm trying to install and run the latest RDKit version (2015_03_1) for Python 
2.7 and 32bit windows OS running Win10 from SourceForge.
I'm running into the "ImportError: DLL load failed: %1 is not a valid Win32 
application" and the links on the RDKit/docs/install.html for Win7 are not 
helpful.
Any recommendations as to how I can get around this..? Usually this is a 
conflict of versions 64/32bit but I have installed 32bit versions of everything 
required.
Thanks in advance.
Regards
Peter





--

Find and fix application performance issues faster with Applications Manager

Applications Manager provides deep performance insights into multiple tiers of

your business applications. It resolves application problems quickly and

reduces your MTTR. Get your free trial!

https://ad.doubleclick.net/ddm/clk/302982198;130105516;z




___

Rdkit-discuss mailing list

Rdkit-discuss@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss