Re: [Rdkit-discuss] RDKit and Binder

2017-12-06 Thread Samo Turk
I don't have direct experience with RDKit and binder but I would guess that
the recommended way would be to use conda in binder (default is pip) and
add rdkit in channels and rdkit in dependencies in environment.yml.
Example:
https://github.com/ContinuumIO/binder-example-conda/blob/master/environment.yml

Best regards,
Samo

On Wed, Dec 6, 2017 at 9:05 AM, Jan Halborg Jensen 
wrote:

> has anyone experience sharing RDKit scripts using https://mybinder.org/
> ?  If so, could you share an example?
>
> Best regards, Jan
>
> 
> --
> 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


[Rdkit-discuss] RDKit tutorials

2017-11-29 Thread Samo Turk
Hi RDKit fans,

It's been a while since RDKit UGM in Berlin and I only now took time to
make a pool request (rdkit tutorial repo
) to submit a notebook I made
during the hackaton. I would like to take this opportunity and encourage
other hackaton participants (or anyone else) to contribute their own
notebooks.

Best regards,
Samo
--
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] Clustering

2017-06-11 Thread Samo Turk
Hi All,

I have to admit I was commenting about PCA->k-means without actually
trying. Out of curiosity I implemented it here:
https://github.com/samoturk/cheminf-notebooks/tree/master/Python#pca-k-meanspy

It can process 4M compounds in ~60 minutes on desktop i5 and it should work
with 16GB or RAM. Clusters that come out make (some) sense but in this
regard Butina is better.

PS. DataWarrior can easily load the results (it takes 30 min) but then it
works smoothly.

Cheers,
Samo

On Mon, Jun 5, 2017 at 7:46 PM, Abhik Seal  wrote:

> Hello all ,
>
> How about doing some dimension reduction using  pca or Tsne and then run
> clustering using some selected top components like top 20 and I think then
> the clustering would be fast .
>
> Thanks
> Abhik
>
> On Mon, Jun 5, 2017 at 6:11 AM David Cosgrove 
> wrote:
>
>> Hi,
>> I have used this algorithm for many years clustering sets of several
>> millions of compounds.  Indeed, I am old enough to know it as the Taylor
>> algorithm.  It is slow but reliable.  A crucial setting is the similarity
>> threshold for the clusters, which dictates the size of the neighbour lists
>> and hence the amount of RAM required.  It also, of course, determines the
>> quality of the clusters.  My implementation is at
>> https://github.com/OpenEye-Contrib/Flush.git.  This repo has a number of
>> programs of relevance, the one you want is called cluster.  I have just
>> confirmed that it compiles on ubuntu 16.  It needs the fingerprints as
>> ascii bitstrings, I don't have code for turning RDKit fingerprints into
>> this format, but I would imagine it's quite straightforward.  The program
>> runs in parallel using OpenMPI.  That's valuable for two reasons.  One is
>> speed, but the more important one is memory use.  If you can spread the
>> slave processes over several machines you can cluster much larger sets of
>> molecules as you are effectively expanding the RAM of the machine.  When I
>> wrote the original, 64MB was a lot of RAM, it is less of an issue these
>> days but still matters if clustering millions of fingerprints.  Note that
>> the program cluster doesn't ever store the distance matrix, just the lists
>> of neighbours for each molecule within the threshold.  This reduces the
>> memory footprint substantially if you have a tight-enough cluster threshold.
>> HTH,
>> Dave
>>
>>
>>
>> On Mon, Jun 5, 2017 at 11:22 AM, Nils Weskamp 
>> wrote:
>>
>>> Hi Michal,
>>>
>>> I have done this a couple of times for compound sets up to 10M+ using a
>>> simplified variant of the Taylor-Butina algorithm. The overall run time
>>> was in the range of hours to a few days (which could probably be
>>> optimized, but was fast enough for me).
>>>
>>> As you correctly mentioned, getting the (sparse) similarity matrix is
>>> fairly simple (and can be done in parallel on a cluster). Unfortunately,
>>> this matrix gets very large (even the sparse version). Most clustering
>>> algorithms require random access to the matrix, so you have to keep it
>>> in main memory (which then has to be huge) or calculate it on-the-fly
>>> (takes forever).
>>>
>>> My implementation (in C++, not sure if I can share it) assumes that the
>>> similarity matrix has been pre-calculated and is stored in one (or
>>> multiple) files. It reads these files sequentially and whenever a
>>> compound pair with a similarity beyond the threshold is found, it checks
>>> whether one of the cpds. is already a centroid (in which case the other
>>> is assigned to it). Otherwise, one of the compounds is randomly chosen
>>> as centroid and the other is assigned to it.
>>>
>>> This procedure is highly order-dependent and thus not optimal, but has
>>> to read the whole similarity matrix only once and has limited memory
>>> consumption (you only need to keep a list of centroids). If you still
>>> run into memory issues, you can start by clustering with a high
>>> similarity threshold and then re-cluster centroids and singletons on a
>>> lower threshold level.
>>>
>>> I also played around with DBSCAN for large compound databases, but (as
>>> previously mentioned by Samo) found it difficult to find the right
>>> parameters and ended up with a single huge cluster covering 90 percent
>>> of the database in many cases.
>>>
>>> Hope this helps,
>>> Nils
>>>
>>> Am 05.06.2017 um 11:02 schrieb Michał Nowotka:
>>> > Is there anyone who actually done this: clustered >2M compounds using
>>> > any well-known clustering algorithm and is willing to share a code and
>>> > some performance statistics?
>>>
>>>
>>> 
>>> --
>>> 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
>>> 

Re: [Rdkit-discuss] RDKit on armv7h

2017-06-04 Thread Samo Turk
I'll just install debian in chroot and test if armv7 binary from the repo
works.

On Sat, Jun 3, 2017 at 9:00 PM, Maciek Wójcikowski <mac...@wojcikowski.pl>
wrote:

> I have Odroid C2 (which is Rpi3 faster cousin), also armv8. Thats a myth
> rather than reality. Debian is almost 100% arm64 friendly (spoiler alert).
>
> I fired a Docker container with Debian Sid arm64 and installed RDKit from
> repo. All things work fine, unfortunately Conda is a no-go for now. I can
> try to compile RDKit from source and let you know how it went.
>
> 
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
> 2017-06-03 20:02 GMT+02:00 Samo Turk <samo.t...@gmail.com>:
>
>> It compiled successfully, unfortunately importing rdkit crashes python
>> interpreter (Segmentation fault). But I didn't have time to look more
>> closely into this. I successfully compiled rdkit on arm few years ago but
>> on raspberry pi (arm v6), this time it is a chromebook.
>>
>> @Maciek If you have rpi 3 in mind, I read that arm64 is not recommended
>> at this time since there is no support for vendor provided libraries..
>>
>> On Sat, Jun 3, 2017 at 5:00 PM, Maciek Wójcikowski <mac...@wojcikowski.pl
>> > wrote:
>>
>>> Has anyone try the Arm64 (aarch64)? Is it the same?
>>>
>>> 
>>> Pozdrawiam,  |  Best regards,
>>> Maciek Wójcikowski
>>> mac...@wojcikowski.pl
>>>
>>> 2017-06-03 8:46 GMT+02:00 Gianluca Sforna <gia...@gmail.com>:
>>>
>>>> On Thu, Jun 1, 2017 at 12:03 AM, Samo Turk <samo.t...@gmail.com> wrote:
>>>> > Thanks! It seems to work, but it's still compiling. Rockchip CPU in my
>>>> > Chromebook is not very fast..
>>>> >
>>>>
>>>> How did it turn out? According to my Fedora builds, compiling is fine
>>>> but tests are going to fail :)
>>>>
>>>> --
>>>> Gianluca Sforna
>>>>
>>>> http://plus.google.com/+gianlucasforna - http://twitter.com/giallu
>>>> Tinker Garage - http://tinkergarage.it
>>>>
>>>> 
>>>> --
>>>> 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 on armv7h

2017-06-03 Thread Samo Turk
It compiled successfully, unfortunately importing rdkit crashes python
interpreter (Segmentation fault). But I didn't have time to look more
closely into this. I successfully compiled rdkit on arm few years ago but
on raspberry pi (arm v6), this time it is a chromebook.

@Maciek If you have rpi 3 in mind, I read that arm64 is not recommended at
this time since there is no support for vendor provided libraries..

On Sat, Jun 3, 2017 at 5:00 PM, Maciek Wójcikowski <mac...@wojcikowski.pl>
wrote:

> Has anyone try the Arm64 (aarch64)? Is it the same?
>
> 
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
> 2017-06-03 8:46 GMT+02:00 Gianluca Sforna <gia...@gmail.com>:
>
>> On Thu, Jun 1, 2017 at 12:03 AM, Samo Turk <samo.t...@gmail.com> wrote:
>> > Thanks! It seems to work, but it's still compiling. Rockchip CPU in my
>> > Chromebook is not very fast..
>> >
>>
>> How did it turn out? According to my Fedora builds, compiling is fine
>> but tests are going to fail :)
>>
>> --
>> Gianluca Sforna
>>
>> http://plus.google.com/+gianlucasforna - http://twitter.com/giallu
>> Tinker Garage - http://tinkergarage.it
>>
>> 
>> --
>> 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 on armv7h

2017-05-31 Thread Samo Turk
Thanks! It seems to work, but it's still compiling. Rockchip CPU in my
Chromebook is not very fast..

On Wed, May 31, 2017 at 11:24 PM, Brian Kelley <fustiga...@gmail.com> wrote:

> Try
>
> cmake -DRDK_OPTIMIZE_NATIVE=off
>
> This should turn off popcnt which doesn't exist on arm7
>
>
>
> 
> Brian Kelley
>
> On May 31, 2017, at 5:08 PM, Samo Turk <samo.t...@gmail.com> wrote:
>
> Dear RDKit community,
>
> I have trouble compiling RDKit on Arch Linux on armv7h cpu. It has to be
> something with CPU architecture since the same build script is working on
> Arch Linux on x86_64. Package versions are the same on both computers: gcc
> 7.1.1, boost 1.64.0, python 3.6.1 and build script is here:
> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rdkit
>
> Error I get:
> c++: error: unrecognized command line option ‘-mpopcnt’
> make[2]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/build.make:63:
> Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:528: 
> Code/RDGeneral/CMakeFiles/RDGeneral.dir/all]
> Error 2
> make: *** [Makefile:163: all] Error 2
>
> Cheers,
> Samo
>
> 
> --
> 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


[Rdkit-discuss] RDKit on armv7h

2017-05-31 Thread Samo Turk
Dear RDKit community,

I have trouble compiling RDKit on Arch Linux on armv7h cpu. It has to be
something with CPU architecture since the same build script is working on
Arch Linux on x86_64. Package versions are the same on both computers: gcc
7.1.1, boost 1.64.0, python 3.6.1 and build script is here:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rdkit

Error I get:
c++: error: unrecognized command line option ‘-mpopcnt’
make[2]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/build.make:63:
Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:528:
Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Cheers,
Samo
--
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


[Rdkit-discuss] Ring detection difference between mol and query

2016-04-27 Thread Samo Turk
Hi RDKit enthusiasts,

There is a difference in ring detection between a molecule (FromSmiles) and
query (FromSmarts). Like in this example:
smiles = 'c1ccc2nncn2n1'
# Construct mol
m = Chem.MolFromSmiles(smiles)
Chem.FastFindRings(m)
ri = m.GetRingInfo()
# Construct query
q = Chem.MolFromSmarts(smiles)
Chem.FastFindRings(q)
ri_q = q.GetRingInfo()

print "Mol: %s, query: %s " % (ri.AtomRings(), ri_q.AtomRings())

result:

Mol: ((0, 8, 7, 3, 2, 1), (4, 3, 7, 6, 5)), query: ((8, 7, 6, 5, 4, 3,
2, 1, 0), (7, 6, 5, 4, 3))


Bug or feature? The problem is that certain atoms are detected as members
of two rings, which is in my opinion (except for two) not the case..

Cheers,
Samo
--
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


[Rdkit-discuss] GetAvalonFP returns ValueError: Sanitization error: Can't kekulize mol

2016-03-20 Thread Samo Turk
Hi RDKiters,

I have problems with substructure matching in pandas and it's caused by
AvalonTools (L178 in current version of PandasTools). I'm not sure if this
is a bug or I'm doing something wrong. Here is a version of the code with
just Avalon part:


from rdkit.Avalon import pyAvalonTools as pyAvalonTools

x = Chem.MolFromSmarts('c1c1')
pyAvalonTools.GetAvalonFP(x,isQuery=True,bitFlags=pyAvalonTools.avalonSSSBits)

---ValueError
   Traceback (most recent call
last) in ()  1
pyAvalonTools.GetAvalonFP(x,> 2
isQuery=True,bitFlags=pyAvalonTools.avalonSSSBits)ValueError:
Sanitization error: Can't kekulize mol


It works if I force Chem.PatternFingerprint as _fingerprinter

Cheers,
Samo
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] GetAvalonFP returns ValueError: Sanitization error: Can't kekulize mol

2016-03-19 Thread Samo Turk
Hi Greg,

Thanks for quick reply!

I noticed that it works if it is constructed from SMILES, but the queries I
usually have are more complex and are constructed from SMARTS especially
because I also do some query adjustments (similar to what was discussed
here https://github.com/rdkit/rdkit/issues/567).

Cheers,
Samo

On Fri, Mar 18, 2016 at 2:25 PM, Greg Landrum <greg.land...@gmail.com>
wrote:

> Hi Samo,
>
> The problem is because the molecule was constructed from SMARTS. If you
> use MolFromSmiles it should work.
>
> Having said that: I believe that it should also be possible to do this for
> a molecule contructed from SMARTS, in which case this would be a bug, but
> I'm going to have to play with it a bit to be sure
>
> -greg
>
> On Fri, Mar 18, 2016 at 5:44 AM, Samo Turk <samo.t...@gmail.com> wrote:
>
>>
>> I have problems with substructure matching in pandas and it's caused by
>> AvalonTools (L178 in current version of PandasTools). I'm not sure if this
>> is a bug or I'm doing something wrong. Here is a version of the code with
>> just Avalon part:
>>
>>
>> from rdkit.Avalon import pyAvalonTools as pyAvalonTools
>>
>> x = Chem.MolFromSmarts('c1c1')
>>
>> pyAvalonTools.GetAvalonFP(x,isQuery=True,bitFlags=pyAvalonTools.avalonSSSBits)
>>
>> ---ValueError
>> Traceback (most recent call 
>> last) in ()  1 
>> pyAvalonTools.GetAvalonFP(x,> 2   
>> isQuery=True,bitFlags=pyAvalonTools.avalonSSSBits)ValueError: Sanitization 
>> error: Can't kekulize mol
>>
>>
>> It works if I force Chem.PatternFingerprint as _fingerprinter
>>
>> Cheers,
>> Samo
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] identify which bonds are rotatable

2015-08-10 Thread Samo Turk
Hi Dimitrios!

Yes there is a way. You just have to use smarts pattern for rotatable bond
(you can find it in Lipinski module
https://github.com/rdkit/rdkit/blob/1bf6ef3d65f5c7b06b56862b3fb9116a3839b229/rdkit/Chem/Lipinski.py#L47
):
In [75]:  mol = Chem.MolFromSmiles('CCc1cc(OC)ccc1')
In [76]:  RotatableBond =
Chem.MolFromSmarts('[!$(*#*)!D1]-!@[!$(*#*)!D1]')
In [77]:  mol.GetSubstructMatches(RotatableBond)
Out[77]:  ((1, 2), (4, 5))

Result are tuples of the indices of the molecule's atoms that match a
substructure query.

Cheers,
Samo

On Mon, Aug 10, 2015 at 12:28 PM, Dimitrios Spiliotopoulos 
d.spiliotopou...@bioc.uzh.ch wrote:


 Hi RDKit users!

 Is there a way to identify which bonds are rotatable in a small molecule?
 (in addition to obtaining the number of rotatable bonds via
 *CalcNumRotatableBonds*.)

 Thank you very much in advance!
 Best wishes,

 d.


 --
 Dimitrios Spiliotopoulos, PhD
 SNF SystemsX.ch Postdoctoral Fellow
 Department of Biochemistry, University of Zurich
 Room: Y 44-K-70
 Tel: +41 44 635 55 44
 Tel: +41 44 635 55 92
 Fax: +41 44 635 68 62


 --

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


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


Re: [Rdkit-discuss] Export pandas DataFrame to xlsx with molecule images

2014-11-04 Thread Samo Turk
Hi Grégori,

I tried exactly what you suggested already yesterday but it didn't work. I
did find a solution after some fiddling and now it works.
https://github.com/rdkit/rdkit/pull/371/files

Thanks!


On Tue, Nov 4, 2014 at 9:32 AM, Grégori Gerebtzoff greg...@gerebtzoff.com
wrote:

  Hi Samo,

 I don't think you need temporary files at all;
 have you tried something like this?

 from cStringIO import StringIO
 image_file = StringIO()
 img = Draw.MolToImage(row[molCol], size=size)
 img.save(image_file, format='PNG')
 image_data = image_file.getvalue()

 Grégori



 On 03. 11. 14 21:44, Samo Turk wrote:

  Hi Grégori,

  Thanks for pointing this out. I modified the code and now it writes only
 one temporary file.

  Cheers,
 Samo

 On Fri, Oct 31, 2014 at 10:56 AM, Grégori Gerebtzoff 
 greg...@gerebtzoff.com wrote:

  Hi Samo,

 I used a few years ago the PHPExcel library to put images into an Excel
 file, and it was not necessary to use physical files.
 Having a quick look at the library I found this class (probably the one I
 used): PHPExcel_Worksheet_MemoryDrawing (source code:
 https://github.com/clariondoor/PHPExcel/blob/master/Worksheet/MemoryDrawing.php
 )
 The interesting bit:
 public function __construct()
 {
 // Initialise values
 $this-_imageResource= null;
 $this-_renderingFunction = self::RENDERING_DEFAULT;
 $this-_mimeType= self::MIMETYPE_DEFAULT;
 $this-_uniqueName= md5(rand(0, ). time() .
 rand(0, ));

 // Initialize parent
 parent::__construct();
 }

 Thus I'm pretty sure you can use the same trick in python XlsxWriter
 (have a look at the _add_image_files function in packager.py), using a
 random file name and a bit stream to the image, as described here:
 http://xlsxwriter.readthedocs.org/en/latest/example_images_bytesio.html#ex-images-bytesio
 :

 filename   = 'python.png'
 image_file = open(filename, 'rb')
 image_data = BytesIO(image_file.read())
 image_file.close()
 # Write the byte stream image to a cell. The filename must  be specified.
 worksheet.insert_image('B8', filename, {'image_data': image_data})

 At least it's worth a try!
 Another trick I had to do both with PHPExcel and in VBA was to set the
 width of columns three times to make sure that it was actually correct.
 Don't ask me why... Just in case you face some width issues.

 Good luck!

 Grégori



 On 30. 10. 14 16:49, Samo Turk wrote:

 Hi rdkiters,

  Due to popular demand I started to work on a function to export pandas
 DataFrame to xlsx with molecule images embedded.
  Because of the xlsx specifics the code is not optimal. The most annoying
 thing about this implementation is that it has to write all images to the
 hard drive, before it packs them in xlsx (and deletes them at the end). I
 checked two python xlsx libraries and both save images that way. If someone
 finds better solution, please share it.

  The dimensions of cells with images are not optimal because Excel is
 weird. :) From xlsxwriter docs): The width corresponds to the column width
 value that is specified in Excel. It is approximately equal to the length
 of a string in the default font of Calibri 11. Unfortunately, there is no
 way to specify “AutoFit” for a column in the Excel file format.

  It crashes if value of a cell is of wrong type so use
 df['value'].astype() to fix incorrectly assigned types.

  Resulting files work nicely in Office 365 (standalone and web app), but
 for some reason don't work optimally with LibreOffice (after row ~125 it
 stacks all images).

   I made a pull request on GitHub:
 https://github.com/rdkit/rdkit/pull/371
  Demo:
 http://nbviewer.ipython.org/github/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/XLSX%20export.ipynb
  Demo xlsx file:
 https://github.com/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/demo.xlsx

  Regards,
 Samo


   
 --



 ___
 Rdkit-discuss mailing 
 listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss




 --

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




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


Re: [Rdkit-discuss] UGM2014: interactive SDF viewer - code on GitHub

2014-11-03 Thread Samo Turk
Very nice effort!

Cheers,
Samo

On Mon, Nov 3, 2014 at 12:11 PM, Pahl, Axel axelp...@gmx.de wrote:

 Hi Andrew,

 thanks a lot, that's a great idea.
 I do hope that people will like it.
 For those who could not attend the excellent meeting (just teasing...) I
 have also included the sdf_viewer.pdf in the repo, which is essentially
 the presentation of my live demo.

 Kind regards,
 Axel

 On 03.11.2014 11:37, Andrew Dalke wrote:
  On Nov 3, 2014, at 10:22 AM, Pahl, Axel wrote:
  Please have fun with the program and let me know if there are any bugs
  or improvement proposals (apart from those already listed in the
 README).
  It looks very nice! You might want to put a link to
 
 
 http://nbviewer.ipython.org/github/apahl/sdf_viewer/blob/master/nb_example.ipynb
 
  so people like me, who weren't at the meeting, can get an idea of what
 it does.
 
  Cheers,
 
Andrew
da...@dalkescientific.com
 
 
 
 
 --
  ___
  Rdkit-discuss mailing list
  Rdkit-discuss@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
 



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

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


Re: [Rdkit-discuss] Export pandas DataFrame to xlsx with molecule images

2014-11-03 Thread Samo Turk
Hi Grégori,

Thanks for pointing this out. I modified the code and now it writes only
one temporary file.

Cheers,
Samo

On Fri, Oct 31, 2014 at 10:56 AM, Grégori Gerebtzoff greg...@gerebtzoff.com
 wrote:

  Hi Samo,

 I used a few years ago the PHPExcel library to put images into an Excel
 file, and it was not necessary to use physical files.
 Having a quick look at the library I found this class (probably the one I
 used): PHPExcel_Worksheet_MemoryDrawing (source code:
 https://github.com/clariondoor/PHPExcel/blob/master/Worksheet/MemoryDrawing.php
 )
 The interesting bit:
 public function __construct()
 {
 // Initialise values
 $this-_imageResource= null;
 $this-_renderingFunction = self::RENDERING_DEFAULT;
 $this-_mimeType= self::MIMETYPE_DEFAULT;
 $this-_uniqueName= md5(rand(0, ). time() .
 rand(0, ));

 // Initialize parent
 parent::__construct();
 }

 Thus I'm pretty sure you can use the same trick in python XlsxWriter (have
 a look at the _add_image_files function in packager.py), using a random
 file name and a bit stream to the image, as described here:
 http://xlsxwriter.readthedocs.org/en/latest/example_images_bytesio.html#ex-images-bytesio
 :

 filename   = 'python.png'
 image_file = open(filename, 'rb')
 image_data = BytesIO(image_file.read())
 image_file.close()
 # Write the byte stream image to a cell. The filename must  be specified.
 worksheet.insert_image('B8', filename, {'image_data': image_data})

 At least it's worth a try!
 Another trick I had to do both with PHPExcel and in VBA was to set the
 width of columns three times to make sure that it was actually correct.
 Don't ask me why... Just in case you face some width issues.

 Good luck!

 Grégori



 On 30. 10. 14 16:49, Samo Turk wrote:

Hi rdkiters,

  Due to popular demand I started to work on a function to export pandas
 DataFrame to xlsx with molecule images embedded.
  Because of the xlsx specifics the code is not optimal. The most annoying
 thing about this implementation is that it has to write all images to the
 hard drive, before it packs them in xlsx (and deletes them at the end). I
 checked two python xlsx libraries and both save images that way. If someone
 finds better solution, please share it.

  The dimensions of cells with images are not optimal because Excel is
 weird. :) From xlsxwriter docs): The width corresponds to the column width
 value that is specified in Excel. It is approximately equal to the length
 of a string in the default font of Calibri 11. Unfortunately, there is no
 way to specify “AutoFit” for a column in the Excel file format.

  It crashes if value of a cell is of wrong type so use
 df['value'].astype() to fix incorrectly assigned types.

  Resulting files work nicely in Office 365 (standalone and web app), but
 for some reason don't work optimally with LibreOffice (after row ~125 it
 stacks all images).

   I made a pull request on GitHub: https://github.com/rdkit/rdkit/pull/371
  Demo:
 http://nbviewer.ipython.org/github/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/XLSX%20export.ipynb
  Demo xlsx file:
 https://github.com/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/demo.xlsx

  Regards,
 Samo


 --



 ___
 Rdkit-discuss mailing 
 listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss




 --

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


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


Re: [Rdkit-discuss] [Rdkit-devel] 2014.09 (Q3 2014) RDKit Release

2014-10-30 Thread Samo Turk
Arch Linux PKGBUILD:
https://gist.github.com/samoturk/32e36597f0b4aac51ba0

openSUSE SPEC:
https://gist.github.com/samoturk/d2e717abc9204d632d5c




On Thu, Oct 30, 2014 at 12:53 PM, Gianluca Sforna gia...@gmail.com wrote:

 On Thu, Oct 30, 2014 at 7:23 AM, Greg Landrum greg.land...@gmail.com
 wrote:
  I'm pleased to announce that the next version of the RDKit -- 2014.09
  (a.k.a. Q3 2014) -- is released.
 
  The release notes are below.
 
  The release and binary files are on the github release page:
  https://github.com/rdkit/rdkit/releases/tag/Release_2014_09_1
  as well as the sourceforge downloads page:
  http://sourceforge.net/projects/rdkit/files/rdkit/Q3_2014/
 
  I have uploaded 32-bit and 64-bit Windows binaries for Python 2.7 and, in
  response to a couple of requests, 32-bit and 64-bit Windows binaries for
  Java.

 binary RPMs for Fedora 20, 21 and RHEL/Centos 6, 7 are available from:
 https://copr.fedoraproject.org/coprs/giallu/rdkit/


 --
 Gianluca Sforna

 http://morefedora.blogspot.com
 http://plus.google.com/+gianlucasforna - http://twitter.com/giallu


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

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


[Rdkit-discuss] Export pandas DataFrame to xlsx with molecule images

2014-10-30 Thread Samo Turk
Hi rdkiters,

Due to popular demand I started to work on a function to export pandas
DataFrame to xlsx with molecule images embedded.
Because of the xlsx specifics the code is not optimal. The most annoying
thing about this implementation is that it has to write all images to the
hard drive, before it packs them in xlsx (and deletes them at the end). I
checked two python xlsx libraries and both save images that way. If someone
finds better solution, please share it.

The dimensions of cells with images are not optimal because Excel is weird.
:) From xlsxwriter docs): The width corresponds to the column width value
that is specified in Excel. It is approximately equal to the length of a
string in the default font of Calibri 11. Unfortunately, there is no way to
specify “AutoFit” for a column in the Excel file format.

It crashes if value of a cell is of wrong type so use df['value'].astype()
to fix incorrectly assigned types.

Resulting files work nicely in Office 365 (standalone and web app), but for
some reason don't work optimally with LibreOffice (after row ~125 it stacks
all images).

I made a pull request on GitHub: https://github.com/rdkit/rdkit/pull/371
Demo:
http://nbviewer.ipython.org/github/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/XLSX%20export.ipynb
Demo xlsx file:
https://github.com/Team-SKI/snippets/blob/master/IPython/rdkit_hackaton/demo.xlsx

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


Re: [Rdkit-discuss] FYI: the RDKit is incompatible with numpy v1.9

2014-10-29 Thread Samo Turk
Hi,

Was this resolved? It seems to work for me with numpy v1.9.0...

Samo

On Mon, Sep 15, 2014 at 5:23 PM, Greg Landrum greg.land...@gmail.com
wrote:

 Dear all,

 Riccardo and I have accidentally discovered that the RDKit is
 incompatible with the most recent version of numpy (v1.9.0). We're working
 on getting it cleared up. In the meantime: please don't upgrade to that
 version if you are an RDKit user.

 -greg



 --
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce
 Perforce version control. Predictably reliable.

 http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


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


[Rdkit-discuss] Windows and PandasTools again

2014-09-26 Thread Samo Turk
Hi All,

While we are at PandasTools and Windows. If you use Anaconda on Windows and
Riccardo Vianello's excellent and convenient binstar package PandasTools
also returns an error because it looks for Salts.txt at the wrong place.
You can fix it by opening
WereEverYouHave\Anaconda\Lib\site-packages\rdkit\RDPaths.py and modifying
RDCodeDir and _share to:
RDCodeDir=os.path.dirname(__file__)
_share = os.path.join(r'WereEverYouHave/Anaconda/Library', r'share/RDKit')

Cheers,
Samo
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Chem.PandasTools

2014-05-09 Thread Samo Turk
Hi,

You can create new object that stores MMP and has default pandas and
ipython representation as base64 encoded png. This usually works for me,
but I'm not sure why in this case it works only for ipython representation
and not for pandas.. The code:

# codecell

import pandas as pd
import rdkit.Chem as Chem
from rdkit.Chem import PandasTools
from rdkit.Chem import Draw
from rdkit.Chem.Draw import IPythonConsole

# codecell

from base64 import b64encode
from StringIO import StringIO

class Reaction():
def __init__(self, reaction=None):
self.reaction = reaction

def _repr_html_(self):
sio = StringIO()
Draw.ReactionToImage(self.reaction).save(sio,format='PNG')
s = b64encode(sio.getvalue())
return 'img src=data:image/png;base64,%s/' %s
def __str__(self):
sio = StringIO()
Draw.ReactionToImage(self.reaction).save(sio,format='PNG')
s = b64encode(sio.getvalue())
return 'img src=data:image/png;base64,%s/' %s

# codecell

MMP_reaction = Chem.rdChemReactions.ReactionFromSmarts([*:1][H][*:1]C)

# codecell

mmp = Reaction(MMP_reaction)

# codecell

mmp

# codecell

newnew_df = pd.DataFrame(columns=['fig'],index=[1] )
newnew_df['fig'].ix[1] = mmp

# codecell

newnew_df

# codecell


Regards,
Samo


On Fri, May 9, 2014 at 8:19 AM, paul.czodrow...@merckgroup.com wrote:

 Dear Grégori,

 when storing the image into a new data frame:
 
 MMP_reaction = Chem.rdChemReactions.ReactionFromSmarts([*:1][H][*:1]C)
 newnew_df = pd.DataFrame(columns=['fig'],index=[1] )
 newnew_df['fig'].ix[1] = Draw.ReactionToImage(MMP_reaction)
 

 apparently, the image can be stored in a data frame, but in the ipython
 notebook it is displayed as PIL image



 Cheers  Thanks so far (in particular for the impressive speed in
 response!),
 Paul

  Hi Paul,
 
  You first have to read the MMP into a reaction object
  (Chem.ReactionFromSmarts).
 
  Greg
 
  On Friday, May 9, 2014, paul.czodrow...@merckgroup.com wrote:
  Dear Gregori  Samo,
 
  thanks for your hints.
 
  I just tried running
 
  Draw.ReactionToImage([*:1][H][*:1]C)
 
  =
 
  AttributeError: 'str' object has no attribute 'GetNumReactantTemplates'
 
 
 
  BTW, how would I finally add a picture to a Pandas data frame?
 
 
  Cheers,
  Paul


 This message and any attachment are confidential and may be privileged or
 otherwise protected from disclosure. If you are not the intended recipient,
 you must not copy this message or attachment or disclose the contents to
 any other person. If you have received this transmission in error, please
 notify the sender immediately and delete the message and any attachment
 from your system. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not accept liability for any omissions or errors in this
 message which may arise as a result of E-Mail-transmission or for damages
 resulting from any unauthorized changes of the content of this message and
 any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not guarantee that this message is free of viruses and does
 not accept liability for any damages caused by any virus transmitted
 therewith.

 Click http://www.merckgroup.com/disclaimer to access the German, French,
 Spanish and Portuguese versions of this disclaimer.


 --
 Is your legacy SCM system holding you back? Join Perforce May 7 to find
 out:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Samo Turk
Hi,

I'm not sure if it will work but you can try:
df['new'] = df['Transformation'].map(showLine_MMP)


Regards,
Samo


On Thu, May 8, 2014 at 4:31 PM, paul.czodrow...@merckgroup.com wrote:

 Dear RDKitters,

 I started to play around with the great Chem.PandasTool contribution
 provided by Nicholas and Samo.

 Given such a data frame:
 
 Transformation  npairs
 1   [*:1][H][*:1]C5
 

 how do I depict the molecular transformation in the dataframe?


 I guess that I somehow have to integrate this function
 
 def showLine_MMP(in_string):
 f = in_string.split(\t)
 LHS = Chem.MolFromSmiles(f[0].split()[0])
 RHS = Chem.MolFromSmiles(f[0].split()[1])
 mols.append(LHS)
 mols.append(RHS)
 return Draw.MolsToGridImage(mols,molsPerRow=2)
 

 but I'm not sure how to accomplish this.


 Cheers  Thanks,
 Paul


 This message and any attachment are confidential and may be privileged or
 otherwise protected from disclosure. If you are not the intended recipient,
 you must not copy this message or attachment or disclose the contents to
 any other person. If you have received this transmission in error, please
 notify the sender immediately and delete the message and any attachment
 from your system. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not accept liability for any omissions or errors in this
 message which may arise as a result of E-Mail-transmission or for damages
 resulting from any unauthorized changes of the content of this message and
 any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not guarantee that this message is free of viruses and does
 not accept liability for any damages caused by any virus transmitted
 therewith.

 Click http://www.merckgroup.com/disclaimer to access the German, French,
 Spanish and Portuguese versions of this disclaimer.


 --
 Is your legacy SCM system holding you back? Join Perforce May 7 to find
 out:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] docker.io - container for fully fledged rdkit installation on linux?

2013-11-28 Thread Samo Turk
Hi,

I didn't want to upset anyone. :) Anyway, maybe this short article on Wired
clears things up:
http://www.wired.com/wiredenterprise/2013/11/docker-linux/?cid=co15093964

Regards,
Samo


On Wed, Nov 27, 2013 at 9:24 PM, Jean-Marc Nuzillard 
jm.nuzill...@univ-reims.fr wrote:

 Dear Igor,

 Le 27/11/2013 16:20, Igor Filippov a écrit :
  Not to criticize or anything, but I've seen this issue quite a few
  times - perhaps the problem
  is actually with me and everybody else is in the know?

 Don't worry, Igor, the same feeling comes to me as well. You are not
 alone ;-)

 Jean-Marc

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



 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] docker.io - container for fully fledged rdkit installation on linux?

2013-11-27 Thread Samo Turk
Hi rdkitters,

New release of Docker is
availablehttp://blog.docker.io/2013/11/docker-0-7-docker-now-runs-on-any-linux-distribution/and
it brings one very impotant improvement - it runs on any linux
distribution (as long as the kernel is 3.8 or later). I updated RDKit
Dockerfile https://gist.github.com/samoturk/6669650 so it builds
everything on top of Ubuntu 13.10 base image. To build the container do:
git clone https://gist.github.com/6669650.git .
mv Dockerfile-rdkit Dockerfile
sudo docker build -t rdkit .

Run it with:
sudo docker run -p 127.0.0.1:8889: rdkit
and IPython notebook will be available on http://127.0.0.1:8889/

Regards,
Samo


On Tue, Sep 24, 2013 at 9:08 AM, paul.czodrow...@merckgroup.com wrote:


 I also highly appreciate your efforts!


 Cheers,
 Paul


  Stuff like this that makes it easier for people to access/use the
  RDKit is great!
 
  The more options we have the better.
 
  Many thanks to you guys for looking into this stuff. :-)
 
  -greg
 
 

  Interesting stuff, looks promising!
  Got pulled in so I created a Dockerfile that builds an image with
  rdkit, ipython and matplotlib. Once the image is built it runs
  ipython notebook server. You can find the source here: https://
  gist.github.com/samoturk/6669650
  Just follow instructions in the first few lines of the Dockerfile to
  build and run it..
 
  Regards,
  Samo
 



 This message and any attachment are confidential and may be privileged or
 otherwise protected from disclosure. If you are not the intended recipient,
 you must not copy this message or attachment or disclose the contents to
 any other person. If you have received this transmission in error, please
 notify the sender immediately and delete the message and any attachment
 from your system. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not accept liability for any omissions or errors in this
 message which may arise as a result of E-Mail-transmission or for damages
 resulting from any unauthorized changes of the content of this message and
 any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
 subsidiaries do not guarantee that this message is free of viruses and does
 not accept liability for any damages caused by any virus transmitted
 therewith.

 Click http://www.merckgroup.com/disclaimer to access the German, French,
 Spanish and Portuguese versions of this disclaimer.



 --
 October Webinars: Code for Performance
 Free Intel webinars can help you accelerate application performance.
 Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
 from
 the latest Intel processors and coprocessors. See abstracts and register 
 http://pubads.g.doubleclick.net/gampad/clk?id=60133471iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MolsToGridImage() fails with Sanitization error: Can't kekulize mol

2013-08-20 Thread Samo Turk
Dear Greg,

Thank you! kekulize=False works as advertised! :)
I found UGM2012 IPython notebooks and one is on sanitization, so no need to
explain it..

Regards,
Samo


On Tue, Aug 20, 2013 at 5:25 AM, Greg Landrum greg.land...@gmail.comwrote:

 Dear Samo,

 On Mon, Aug 19, 2013 at 4:04 PM, Samo Turk samo.t...@gmail.com wrote:


 I was playing with ipython notebook and I get interesting error:

 from rdkit import Chem
 from rdkit.Chem import Draw
 from rdkit.Chem.Draw import IPythonConsole

 mol = Chem.MolFromSmarts('c1c1')
 mol

 draws benzene

 Draw.MolsToGridImage([mol])

 ---ValueError
 Traceback (most recent call 
 last)ipython-input-71-4f0b315d518e in module() 1 
 Draw.MolsToGridImage([mol])
 /usr/lib/python2.7/site-packages/rdkit/Chem/Draw/__init__.py in 
 MolsToGridImage(mols, molsPerRow, subImgSize, legends, **kwargs)263 
 row = i//molsPerRow264 col = i%molsPerRow-- 265 
 res.paste(MolToImage(mol,subImgSize,legend=legends[i],**kwargs),(col*subImgSize[0],row*subImgSize[1]))
 266   return res267
 /usr/lib/python2.7/site-packages/rdkit/Chem/Draw/__init__.py in 
 MolToImage(mol, size, kekulize, wedgeBonds, **kwargs) 70 from rdkit 
 import Chem 71 mol = Chem.Mol(mol.ToBinary())--- 72 
 Chem.Kekulize(mol) 73  74   if not mol.GetNumConformers():
 ValueError: Sanitization error: Can't kekulize mol


 It works normally on aliphatic structures or if I use MolFromSmiles instead 
 of MolFromSmarts. Is kekulization of mols obtained from SMARTS wanted 
 behaviour? Is it possible to turn it off?

 Very short answer: use Draw.MolsToGridImage([mol],kekulize=False)

 A bit of explanation:

 The drawing code, by default, tries to kekulize the molecule so that
 drawings of aromatic systems look better. This fails for molecules
 constructed from SMARTS unless you do partial sanitization of those
 molecules (I can explain this if you're interested, but it would be a
 distraction here).

 The ipython notebook integration code tries to kekulize the molecule; if
 that fails, it renders the non-kekulized structure.

 I hope this helps,
 -greg




--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Unable to build RDKit_2013_06_1 and Git version on Arch Linux

2013-08-16 Thread Samo Turk
Hi,

I'm trying to build RDKit on Arch Linux but make fails with RDKit_2013_06_1
and Git version with the error appended to the end of this message.
Interestingly it works without a problem on RDKit_2013_03_2 and
RDKit_2012_12_1 (didn't try earlier versions). Packege versions I'm using:
python2 2.7.5-1, python2-numpy 1.7.1-1, python2-imaging 1.1.7-8, boost
1.54.0-2, python2-matplotlib 1.3.0-1, cairo 1.12.14-4
Any help would be welcome.

Best regards,
Samo

Error message:
[ 38%] Building CXX object
Code/GraphMol/SmilesParse/CMakeFiles/SmilesParse.dir/smiles.tab.cpp.o
smiles.yy:25:0: warning: YYDEBUG redefined [enabled by default]
In file included from smiles.yy:21:0:
/home/samo/Downloads/abs/rdkit-git/rdkit/Code/GraphMol/SmilesParse/smiles.tab.hpp:37:0:
note: this is the location of the previous definition
 # define YYDEBUG 0
 ^
/home/samo/Downloads/abs/rdkit-git/rdkit/Code/GraphMol/SmilesParse/smiles.tab.cpp:
In function ‘int yysmiles_parse(const char*, std::vectorRDKit::RWMol**,
std::listunsigned int*, void*)’:
/home/samo/Downloads/abs/rdkit-git/rdkit/Code/GraphMol/SmilesParse/smiles.tab.cpp:1245:30:
error: too few arguments to function ‘int yysmiles_lex(YYSTYPE*, void*)’
   yychar = yylex (yylval);
  ^
smiles.yy:23:12: note: declared here
make[2]: ***
[Code/GraphMol/SmilesParse/CMakeFiles/SmilesParse.dir/smiles.tab.cpp.o]
Error 1
make[1]: *** [Code/GraphMol/SmilesParse/CMakeFiles/SmilesParse.dir/all]
Error 2
make: *** [all] Error 2
--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Unable to build RDKit_2013_06_1 and Git version on Arch Linux

2013-08-16 Thread Samo Turk
I actually used AUR package to compile RDKit_2012_12_1 and sucessfully
modified it to compile RDKit_2013_03_2, but it fails for RDKit_2013_06_1
and Git version. I guess there is a missing dependency since you managed to
compile it.. Do you have all packeges updated to latest versions? 64bit
system?

Regards,
Samo


On Fri, Aug 16, 2013 at 3:27 PM, Mikolaj Kowalik mx...@psu.edu wrote:

 On Fri, 16 Aug 2013 10:57:53 +0200
 Samo Turk samo.t...@gmail.com wrote:

  I'm trying to build RDKit on Arch Linux but make fails with
 RDKit_2013_06_1
  and Git version with the error appended to the end of this message.
  Interestingly it works without a problem on RDKit_2013_03_2 and
  RDKit_2012_12_1 (didn't try earlier versions).

 It does not address your problem directly, but as an Arch Linux user you
 could
 probably be interested in rdkit package on AUR

 https://aur.archlinux.org/packages/rdkit/

 Although the rdkit version there is pretty outdated, the PKGBUILD can be
 easily edited to use the latest one, as was pointed out in the comments.
 All
 you need is to change the package version and update MD5 sum of the
 tarball.

 It worked flawlessly for me. Thus, feel free to bug me if your problem
 persists.

 Best,

 --
 Mikołaj Kowalik


 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss