[Rdkit-discuss] minGW fails to build rdkit

2016-12-19 Thread Yingfeng Wang
I try to use minGW to build rdkit_2016_09_2, which is from the following
link.

https://github.com/rdkit/rdkit/archive/Release_2016_09_2.zip

cmake command is

cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
-DMSVC_RUNTIME_DLL="C:\Windows\System32\msvcr100.dll"
 -DBOOST_ROOT="C:\boost"
-DCMAKE_INSTALL_PREFIX=C:\software\RDKit\install_2016_09_2
-DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW
Makefiles" ..

Error happens when running mingw32-make
Error message is given as follows.

Scanning dependencies of target RDGeneral
[ 12%] Building CXX object
Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj
'ccache' is not recognized as an internal or external command,
operable program or batch file.
Code\RDGeneral\CMakeFiles\RDGeneral.dir\build.make:62: recipe for target
'Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj' failed
mingw32-make[2]: ***
[Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj] Error 1
CMakeFiles\Makefile2:494: recipe for target
'Code/RDGeneral/CMakeFiles/RDGeneral.dir/all' failed
mingw32-make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

By the way, the information of compiler is given in the following.

C:\software\RDKit\rdkit-Release_2016_09_2\build>g++ -v
Reading specs from
c:/mingw_win_build/bin/../lib/gcc/i686-w64-mingw32/4.8.3/specs
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw_win_build/bin/../libexec/gcc/i686-w64-mingw32/4.8.3
/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_32
--with-sysroot=/opt/windows_32 --libdir=/opt/windows_32/lib
--mandir=/opt/windows_32/man --infodir=/opt/windows_32/info --enable-shared
--disable-bootstrap --disable-multilib--with-arch=pentium3
--enable-threads=posix --enable-languages=c,c++ --enable-checking=release
--enable-libgomp --with-system-zlib
--with-python-dir=/lib/python2.7/site-packages
--disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp
--with-gnu-ld --verbose --enable-java-home
--with-java-home=/opt/windows_32/lib/jvm/jre
--with-jvm-root-dir=/opt/windows_32/lib/jvm
--with-jvm-jar-dir=/opt/windows_32/lib/jvm/jvm-exports
--with-arch-directory=amd64
--with-antlr-jar='/home/adrien/projects/win-builds-1.5/slackware64-current/d/gcc/antlr-*.jar'
--disable-java-awt --disable-gtktest --build=x86_64-slackware-linux
--host=i686-w64-mingw32 --target=i686-w64-mingw32
Thread model: posix
gcc version 4.8.3 (GCC)

Could you please give me any hints?

Thank you very much in advance!

Yingfeng
--
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/intel___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MolToSmiles

2016-12-19 Thread Greg Landrum
I agree with Andrew's suggestion. The optional list argument defaulting to None 
exactly how I would solve it and fits (I think) with at least most of the RDKit.
-greg





On Mon, Dec 19, 2016 at 9:14 PM +0100, "Brian Kelley"  
wrote:










I'm happy to do that as long as there is a consensus.  We could also expose the 
properties in non-string form, but that is a bit harder to do.

  GetPropsAsDict does this, but has the overhead that it does a conversion for 
everything, not just the thing you want.  It does handle the underlying type 
correctly though which is convenient.


Brian Kelley

> On Dec 19, 2016, at 2:59 PM, Andrew Dalke  wrote:
> 
>> On Dec 19, 2016, at 6:22 PM, Brian Kelley wrote:
>> I had thought about making a CanonicalAtomOrder function that does this as 
>> well, or perhaps making a MolToSmiles variant.
> 
> I learned about this function from Noel's blog post at 
> https://nextmovesoftware.com/blog/2013/07/01/accessing-smiles-atom-order/ , 
> which uses the C++ API.
> 
> I would like a variant more along those lines, like:
> 
>  MolToSmiles(mol, isomericSmiles=None,  allHsExplicit=False, 
> atomOrder=None)
> 
> where if I pass in:
> 
>  atomOrder = []
>  MolToSmiles(mol, atomOrder=atomOrder)
> 
> then I get the list of indices in atomOrder, rather than a per-molecule 
> property.
> 
> atomOrder=None can do the existing behavior.
> 
> 
> Cheers,
> 
> 
>Andrew
>da...@dalkescientific.com
> 
> 
> 
> --
> 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/intel
> ___
> 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/intel
___
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/intel___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MolToSmiles

2016-12-19 Thread Andrew Dalke
On Dec 19, 2016, at 6:22 PM, Brian Kelley wrote:
> I had thought about making a CanonicalAtomOrder function that does this as 
> well, or perhaps making a MolToSmiles variant.

I learned about this function from Noel's blog post at 
https://nextmovesoftware.com/blog/2013/07/01/accessing-smiles-atom-order/ , 
which uses the C++ API.

I would like a variant more along those lines, like:

  MolToSmiles(mol, isomericSmiles=None,  allHsExplicit=False, 
atomOrder=None)

where if I pass in:

  atomOrder = []
  MolToSmiles(mol, atomOrder=atomOrder)

then I get the list of indices in atomOrder, rather than a per-molecule 
property.

atomOrder=None can do the existing behavior.


Cheers,


Andrew
da...@dalkescientific.com



--
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/intel
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Stereochemistry

2016-12-19 Thread Jean-Marc Nuzillard
Sure !

I was only looking for a way of doing the things with bonds that
would be similar to the one with the atoms.

All the best,

Jean-Marc

Le 19/12/2016 à 11:55, Paul Emsley a écrit :
> On 19/12/2016 10:42, Jean-Marc Nuzillard wrote:
>> Thank you all!
>>
>> One more point:
>>
>> How do I get the bond indexes for which the E/Z configuration has been set?
>> I seems there are no "magic" properties for bonds and no HasProp() function 
>> for bonds.
> Iterate through the bond list and use bond.GetStereo() to find particular 
> values?
>
> It returns one of:
>
> STEREONONE
> STEREOANY 
> STEREOZ   
> STEREOE
>
> Paul.
>
>
> --
> 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
>


-- 
Jean-Marc Nuzillard
Institut de Chimie Moléculaire de Reims
CNRS UMR 7312
Moulin de la Housse
CPCBAI, Bâtiment 18
BP 1039
51687 REIMS Cedex 2
France

Tel : 03 26 91 82 10
Fax : 03 26 91 31 66
http://www.univ-reims.fr/ICMR

http://www.univ-reims.fr/LSD/
http://www.univ-reims.fr/LSD/JmnSoft/


--
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/intel
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MolToSmiles

2016-12-19 Thread Brian Kelley
I would vote for make a more obvious way to get to these values.  I have
had the need to do this when working with external depictors (i.e. mol ->
smiles -> depict with atom highlighting is one use case)  I just couldn't
think of a valid API way of doing this.  Attaching these values to the
molecule seems like it isn't really the right solution considering there
are two forms of canonical ordering if isomerisms are considered.  I had
thought about making a CanonicalAtomOrder function that does this as well,
or perhaps making a MolToSmiles variant.

Any other ideas?

On Mon, Dec 19, 2016 at 3:58 AM, Greg Landrum 
wrote:

>
> On Mon, Dec 19, 2016 at 9:43 AM, Maciek Wójcikowski  > wrote:
>
>>
>> There is also CanonicalRankAtoms [http://www.rdkit.org/Python_D
>> ocs/rdkit.Chem.rdmolfiles-module.html#CanonicalRankAtoms] which seams to
>> be forgotten.
>>
>
> One thing to be aware of here is that this provides the canonical ranking
> of atoms that is used for the SMILES generation, but the values are not
> equal to the actual output order of the atoms.
> Here's an example of that:
> In [3]: m = Chem.MolFromSmiles('CC(O)CCN')
>
> In [4]: list(Chem.CanonicalRankAtoms(m))
> Out[4]: [0, 5, 2, 4, 3, 1]
>
> In [5]: Chem.MolToSmiles(m)
> Out[5]: 'CC(O)CCN'
>
> In [7]: m.GetProp('_smilesAtomOutputOrder')
> Out[7]: '[0,1,2,3,4,5,]'
>
> so though atom 1 is ranked in position 5, it ends up being the second atom
> output since it is connected to atom 0, which happens to have rank 0.
>
> -greg
>
>
>
> 
> --
> 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
>
>
--
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/intel___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Stereochemistry

2016-12-19 Thread Paul Emsley
On 19/12/2016 10:42, Jean-Marc Nuzillard wrote:
> Thank you all!
>
> One more point:
>
> How do I get the bond indexes for which the E/Z configuration has been set?
> I seems there are no "magic" properties for bonds and no HasProp() function 
> for bonds.

Iterate through the bond list and use bond.GetStereo() to find particular 
values?

It returns one of:

STEREONONE  
STEREOANY   
STEREOZ 
STEREOE

Paul.


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

2016-12-19 Thread Jean-Marc Nuzillard

Thank you all!

One more point:

How do I get the bond indexes for which the E/Z configuration has been set?
I seems there are no "magic" properties for bonds and no HasProp() 
function for bonds.


All the best,

Jean-Marc



Le 19/12/2016 à 04:40, Greg Landrum a écrit :
One more piece that might help: the allHsExplicit to MolToSmiles() is 
there to make sure that implicit Hs (Hs not actually in the graph) 
show up in the output SMILES inside square brackets:

 In [12]: m = Chem.MolFromSmiles('CC(O)(Cl)')

In [13]: Chem.MolToSmiles(m,allHsExplicit=True)
Out[13]: '[CH3][CH]([OH])[Cl]'

If you actually have Hs in the molecular graph they will always be in 
the output SMILES, you don't need to use the allHsExplicit argument::

In [17]: m = Chem.MolFromSmiles('CC(O)(Cl)')

In [18]: mh = Chem.AddHs(m)

In [19]: Chem.MolToSmiles(mh)
Out[19]: '[H]OC([H])(Cl)C([H])([H])[H]'

-greg




On Mon, Dec 19, 2016 at 1:00 AM, Paolo Tosco > wrote:


Dear Jean-Marc,

as lactic2.sdf is a 3D structure which does not carry any
stereochemistry information in the SDF file, you will need to
perceive stereochemistry from the 3D structure with

Chem.AssignAtomChiralTagsFromStructure(mol)

before calling Chem.AssignStereochemistry().
It looks like allHsExplicit=True prevents SMILES chirality
specifications from being output:

In [1]: from rdkit import Chem

In [2]: molfilename = "lactic2.sdf"

In [3]: mol = Chem.SDMolSupplier(molfilename, removeHs = False)[0]

In [4]: Chem.AssignAtomChiralTagsFromStructure(mol)

In [5]: Chem.AssignStereochemistry(mol, cleanIt=False,
force=False, flagPossibleStereoCenters=True)

In [6]: chiralAtoms = [a for a in mol.GetAtoms() if
a.HasProp("_ChiralityPossible")]

In [7]: chiralAtomNums = [a.GetIdx()+1 for a in chiralAtoms]

In [8]: chiralAtomNums
Out[8]: [4]

In [9]: configs = [a.GetProp("_CIPCode") for a in chiralAtoms]

In [10]: configs
Out[10]: ['S']

In [11]: smi = Chem.MolToSmiles(mol, isomericSmiles=True)

In [12]: smi
Out[12]: '[H]OC(=O)[C@@]([H])(O[H])C([H])([H])[H]'

In [13]: smi = Chem.MolToSmiles(mol, isomericSmiles=True,
allHsExplicit=True)

In [14]: smi
Out[14]: '[H][O][C](=[O])[C]([H])([O][H])[C]([H])([H])[H]'


Cheers,
p.


On 12/18/2016 11:29 PM, Jean-Marc Nuzillard wrote:

Hi again,

When I run:

#
from rdkit import Chem

molfilename = "lactic2.sdf"
mol = Chem.SDMolSupplier(molfilename, removeHs = False)[0]

Chem.AssignStereochemistry(mol, cleanIt=False, force=False,
flagPossibleStereoCenters=True)
chiralAtoms = [a for a in mol.GetAtoms() if
a.HasProp("_ChiralityPossible")]
chiralAtomNums = [a.GetIdx()+1 for a in chiralAtoms]
print "chiral centers: ",
print chiralAtomNums
configs = [a.GetProp("_CIPCode") for a in chiralAtoms]
print configs

smi = Chem.MolToSmiles(mol, isomericSmiles=True, allHsExplicit=True)
print smi
#

Two (related?) problems arise.
First, _CIPCode rises a KeyError, even for atoms for which
_ChiralityPossible is defined.
When I comment the lines that define and print the configs
variable, the second problem arises.
The string smi does not contain any '@' or '@@', something I
expected from a chiral molecule
for an isomeric smiles string.

The attached lactic2.sdf file comes from PubChem. I removed (set
to 0) the parity flag for atom 4 (index 3)
because there are no parity flags in the files I will have to
deal with later.
Keeping the parity flag does not change anything.

What did I miss?

All the best,

Jean-Marc




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


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Re: [Rdkit-discuss] MolToSmiles

2016-12-19 Thread Greg Landrum
On Mon, Dec 19, 2016 at 9:43 AM, Maciek Wójcikowski 
wrote:

>
> There is also CanonicalRankAtoms [http://www.rdkit.org/Python_
> Docs/rdkit.Chem.rdmolfiles-module.html#CanonicalRankAtoms] which seams to
> be forgotten.
>

One thing to be aware of here is that this provides the canonical ranking
of atoms that is used for the SMILES generation, but the values are not
equal to the actual output order of the atoms.
Here's an example of that:
In [3]: m = Chem.MolFromSmiles('CC(O)CCN')

In [4]: list(Chem.CanonicalRankAtoms(m))
Out[4]: [0, 5, 2, 4, 3, 1]

In [5]: Chem.MolToSmiles(m)
Out[5]: 'CC(O)CCN'

In [7]: m.GetProp('_smilesAtomOutputOrder')
Out[7]: '[0,1,2,3,4,5,]'

so though atom 1 is ranked in position 5, it ends up being the second atom
output since it is connected to atom 0, which happens to have rank 0.

-greg
--
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] MolToSmiles

2016-12-19 Thread Maciek Wójcikowski
Hi Jean-Marc and others,

There is also CanonicalRankAtoms [
http://www.rdkit.org/Python_Docs/rdkit.Chem.rdmolfiles-module.html#CanonicalRankAtoms]
which seams to be forgotten.


Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl

2016-12-18 23:14 GMT+01:00 Jean-Marc Nuzillard :

> Thank you Andrew, Brian and David for your answers.
>
> mol.GetProp("_smilesAtomOutputOrder") does the job.
> I also expected a.GetProp("molAtomMapNumber") could do it for each atom a.
>
> All the best,
>
> Jean-Marc
>
> Le 18/12/2016 à 19:04, Andrew Dalke a écrit :
> > On Dec 18, 2016, at 6:32 PM, Brian Kelley wrote:
> > m.GetProp("_smilesAtomOutputOrder")
> >> '[3,2,1,0,]'
> >>
> >> Note that this returns the list as a string which is sub-optimal.
> GetPropsAsDict will convert these to proper python objects, however, this
> is considered a private member so you need to return these as well:
> >>
> > list(m.GetPropsAsDict(True,True)["_smilesAtomOutputOrder"])
> >> [3, 2, 1, 0]
> > For fun, here are a few timing numbers:
> >
> ># Common setup
> > from rdkit import Chem
> > mol = Chem.MolFromSmiles("c1c1Oc1c1")
> > Chem.MolToSmiles(mol)'
> > import json
> > import ujson # third-party JSON decoder
> > import re
> > integer_pat = re.compile("[0-9]+")
> >
> >
> > # Get the string (give a lower bound)
> > mol.GetProp("_smilesAtomOutputOrder")'
> > 1 loops, best of 3: 31.3 usec per loop
> >
> >
> > Here are variations for how to get that information as a list of
> integers:
> >
> > # Using Python's "eval()" to decode the list (this is generally UNSAFE!)
> > eval(mol.GetProp("_smilesAtomOutputOrder"))'
> > 1 loops, best of 3: 157 usec per loop
> >
> > # Use the built-in json module (need to remove the terminal ",")
> > json.loads(mol.GetProp("_smilesAtomOutputOrder")[:-2]+"]")'
> > 1 loops, best of 3: 66.5 usec per loop
> >
> > # Use the third-party "ujson" package, which is faster than json.
> > ujson.loads(mol.GetProp("_smilesAtomOutputOrder")[:-2]+"]")
> > 1 loops, best of 3: 41.2 usec per loop
> >
> > ("cjson" takes 49.7 usec per loop)
> >
> > # Use the properties dictionary
> > mol.GetPropsAsDict(True,True)["_smilesAtomOutputOrder"]
> > 1000 loops, best of 3: 462 usec per loop
> >
> > # Parse it more directly
> > map(int, integer_pat.findall(mol.GetProp("_smilesAtomOutputOrder")))
> > 1 loops, best of 3: 89 usec per loop
> >
> >
> >   Andrew
> >   da...@dalkescientific.com
> >
> >
> >
> > 
> --
> > 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
> >
>
>
> --
> Jean-Marc Nuzillard
> Institut de Chimie Moléculaire de Reims
> CNRS UMR 7312
> Moulin de la Housse
> CPCBAI, Bâtiment 18
> BP 1039
> 51687 REIMS Cedex 2
> France
>
> Tel : 03 26 91 82 10
> Fax : 03 26 91 31 66
> http://www.univ-reims.fr/ICMR
>
> http://www.univ-reims.fr/LSD/
> http://www.univ-reims.fr/LSD/JmnSoft/
>
>
> 
> --
> 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