Re: [Rdkit-discuss] Fwd: 2D drawing with atoms labeled by index

2016-10-24 Thread Dmitri Maziuk
OK, my turn: that went out too soon.

It seems to me that jypiter, ipython, or whatever, has no idea how 
render MIME type image/svg+xml. It can display an "SVG" object, but the 
bit that turned image/svg+xml into "SVG" does not understand XML 
namespaces (that's been around since at least 2009).

Try saving the text (svg/svg2) to a file and opening it in chrome (if 
you can actually open a file in chrome) or some other application.

Dima


--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Fwd: 2D drawing with atoms labeled by index

2016-10-24 Thread Peter S. Shenkin
Hi,

Dima wrote:
>
> Try saving the text (svg/svg2) to a file and opening it in chrome (if you
> can actually open a file in chrome) or some other application.


I actually did that, and in a second email I reported:

>
>- Chrome thinks svg.svg is empty
>
>
>- When I load svg2.svg, Chrome complains, "This XML file does not
>appear to have any style information associated with it. The document tree
>is shown below"
>
>  -P.

On Tue, Oct 25, 2016 at 12:28 AM, Dmitri Maziuk 
wrote:

> OK, my turn: that went out too soon.
>
> It seems to me that jypiter, ipython, or whatever, has no idea how render
> MIME type image/svg+xml. It can display an "SVG" object, but the bit that
> turned image/svg+xml into "SVG" does not understand XML namespaces (that's
> been around since at least 2009).
>
> Try saving the text (svg/svg2) to a file and opening it in chrome (if you
> can actually open a file in chrome) or some other application.
>
> Dima
>
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Fwd: 2D drawing with atoms labeled by index

2016-10-24 Thread Dimitri Maziuk
On 2016-10-24 19:04, Peter S. Shenkin wrote:

> My second conclusion (based on the .svg-file experiments) is that it's
> not an iPython problem and, since you see the same thing on Firefox,
> it's unlikely to be a Chrome problem.

Well, what I got it from (Greg's I think) tutorial that if you don't 
strip off the svg:'s the image won't show up in whatever he's using. In 
my case (firefox) the image won't show up if you do.

Programs that read XML correctly (the gimp, inkscape, eog to name a 
couple) will show the image either way.

So to your original question: no rhyme or reason that I know of to when 
you should or should not strip off the svg:'s.

Dima


--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] RDKit workflow in KNIME

2016-10-24 Thread Simon Saubern
Stuart,

The PAINS file is available in the RDKIT Github repository. If that's 
too complicated deal with at this early stage, try some of the workflows 
on myexperiment.org:

http://www.myexperiment.org/workflows/1841.html (embedded file)
or
http://www.myexperiment.org/workflows/4748.html (just in a table)

Simon

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] reading multiple conformers from file

2016-10-24 Thread Thomas Evangelidis
Hello everyone,

I am a new user of RDkit and I was looking in the documentation for an easy
way to load multiple conformers from a structure file like .sdf. The code
must 1) distinguish between different protonation states of the same
molecule,  2) create a new Mol() object for each protonation state and load
into it the respective conformers.

Apparently I can work out a solution for 1)
using mol.GetProp('_Name'), mol.GetNumAtoms, mol.GetNumBonds and other
properties, but I was wondering if there is any more straight forward way
to do it.
For 2) I guess I must iterate over all molecules in the input file, create
new Mol() objects (one for each protonation state of each ligand) and add
conformers to these new Mol() objects. Again this sounds easily
programmable, but sounds like a very common operation, thus I was wondering
if it has been implemented in a function.

thanks in advance
Thomas


-- 

==

Thomas Evangelidis

Research Specialist
CEITEC - Central European Institute of Technology
Masaryk University
Kamenice 5/A35/1S081,
62500 Brno, Czech Republic

email: tev...@pharm.uoa.gr

  teva...@gmail.com


website: https://sites.google.com/site/thomasevangelidishomepage/
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] 2D drawing with atoms labeled by index

2016-10-24 Thread Peter S. Shenkin
Consider the following excerpt:

svg = drawer.GetDrawingText()
svg2 = svg.replace('svg:','')
svg3 = SVG(svg2)
print 'displaying svg:'
display(svg)
print 'displaying svg2:'
display(svg2)
print 'displaying svg3:'
display(svg3)

svg and svg2 display as xml text. svg3 displays as the image, in a Jupyter
notebook in Chrome.

On Mon, Oct 24, 2016 at 6:44 PM, Dimitri Maziuk 
wrote:

> On 10/24/2016 04:39 PM, Peter S. Shenkin wrote:
>
> > Or is it
> > rather because chemists in your target audience will be thinking of the
> > first atom in, say, a structure from an sd file as atom #1?
>
> That
>
> > 2. Regarding the last line, most of the RDKit code I've seen in past
> > examples displays the molecule using code like the following. When is it
> > necessary/not necessary to remove the "svg" string from the results of
> > GetDrawingText()?
>
> Not sure: it's a namespace, I'm assuming ipython can't deal with xml
> namespaces. Properly written programs should show it either way,
> unfortunately my target viewer is firefox (it's a web application and
> the user's default browser is firefox) and firefox isn't one of them.
> Without svg:'s it'll show the file as xml text instead of the image.
>
> HTH
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] 2D drawing with atoms labeled by index

2016-10-24 Thread Dimitri Maziuk
On 10/24/2016 04:39 PM, Peter S. Shenkin wrote:

> Or is it
> rather because chemists in your target audience will be thinking of the
> first atom in, say, a structure from an sd file as atom #1?

That

> 2. Regarding the last line, most of the RDKit code I've seen in past
> examples displays the molecule using code like the following. When is it
> necessary/not necessary to remove the "svg" string from the results of
> GetDrawingText()?

Not sure: it's a namespace, I'm assuming ipython can't deal with xml
namespaces. Properly written programs should show it either way,
unfortunately my target viewer is firefox (it's a web application and
the user's default browser is firefox) and firefox isn't one of them.
Without svg:'s it'll show the file as xml text instead of the image.

HTH
-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



signature.asc
Description: OpenPGP digital signature
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] 2D drawing with atoms labeled by index

2016-10-24 Thread Peter S. Shenkin
Hi, Dimitri,

I have two questions about your code.

1. Why are you incrementing the atom index by 1? Are there functions in
RDKit, for example, that use atom indices using index-origin 1? Or is it
rather because chemists in your target audience will be thinking of the
first atom in, say, a structure from an sd file as atom #1?

2. Regarding the last line, most of the RDKit code I've seen in past
examples displays the molecule using code like the following. When is it
necessary/not necessary to remove the "svg" string from the results of
GetDrawingText()?

svg = drawer.GetDrawingText().replace('svg:','')
SVG(svg)

Thanks,
-P.

On Mon, Oct 24, 2016 at 2:31 PM, Dimitri Maziuk 
wrote:

> Since you already got your answer I'll just post this for posterity:
>
>
> import sys
> import rdkit
> import rdkit.Chem
> import rdkit.Chem.AllChem
> import rdkit.Chem.Draw
> import rdkit.Chem.Draw.rdMolDraw2D
>
> mol=rdkit.Chem.SupplierFromFilename(sys.argv[1],removeHs=False).next()
> dr=rdkit.Chem.Draw.rdMolDraw2D.MolDraw2DSVG(800,800)
> dr.SetFontSize(0.3)
> op = dr.drawOptions()
> for i in range(mol.GetNumAtoms()) :
> op.atomLabels[i]=mol.GetAtomWithIdx(i).GetSymbol() + str((i+1))
> rdkit.Chem.AllChem.Compute2DCoords(mol)
> dr.DrawMolecule(mol)
> dr.FinishDrawing()
> svg=dr.GetDrawingText()
>
>
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
> 
> --
> 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
>
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] 2D drawing with atoms labeled by index

2016-10-24 Thread Dimitri Maziuk
Since you already got your answer I'll just post this for posterity:


import sys
import rdkit
import rdkit.Chem
import rdkit.Chem.AllChem
import rdkit.Chem.Draw
import rdkit.Chem.Draw.rdMolDraw2D

mol=rdkit.Chem.SupplierFromFilename(sys.argv[1],removeHs=False).next()
dr=rdkit.Chem.Draw.rdMolDraw2D.MolDraw2DSVG(800,800)
dr.SetFontSize(0.3)
op = dr.drawOptions()
for i in range(mol.GetNumAtoms()) :
op.atomLabels[i]=mol.GetAtomWithIdx(i).GetSymbol() + str((i+1))
rdkit.Chem.AllChem.Compute2DCoords(mol)
dr.DrawMolecule(mol)
dr.FinishDrawing()
svg=dr.GetDrawingText()


-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



signature.asc
Description: OpenPGP digital signature
--
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 workflow in KNIME

2016-10-24 Thread Stuart Ember
Hello All,

I have been trying to get the 09901004_Filtering A Hitlist workflow from KNIME 
working but cannot set the location of the sieve files containing the pains 
data. When I try and configure the node, an error is thrown stating this data 
is missing. Since this workflow was downloaded from the public server, I don't 
understand why it is not automatically downloaded. I'd appreciate it if anyone 
can offer advice as to where I can find the missing data please? I just started 
learning to use KNIME and realize that I may have overlooked something trivial.

Many thanks for your help.

Stuart

Stuart W. Ember
Senior Research Scientist
Reaction Biology Corp.
1 Great Valley Parkway, Suite 18
Malvern, PA 19355

stuart.em...@reactionbiology.com
610.722.0247
--
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