Re: [Open Babel] Canonical SMILES with disconnected parts

2017-05-31 Thread xh s
Hi Tim,

I was able to convert the problematic molecule to a SDF file and reproduce
the error. Here's the test.sdf file. I used "obabel test.sdf -Otest.can".


 OpenBabel05311714443D

  7  4  0  0  0  0  0  0  0  0999 V2000
1.6789   -1.95710.9205 Cl  0  5  0  0  0  0  0  0  0  0  0  0
2.9546   -0.84200.3747 C   0  0  0  0  0  0  0  0  0  0  0  0
3.7238   -0.06421.7843 Cl  0  0  0  0  0  0  0  0  0  0  0  0
4.2107   -1.8015   -0.4843 Cl  0  0  0  0  0  0  0  0  0  0  0  0
0.72321.4157   -0.6233 O   0  0  0  0  0  0  0  0  0  0  0  0
   -0.07561.0202   -0.3210 H   0  0  0  0  0  0  0  0  0  0  0  0
2.5841   -0.0998   -0.3221 H   0  0  0  0  0  0  0  0  0  0  0  0
  2  3  1  0  0  0  0
  2  4  1  0  0  0  0
  6  5  1  0  0  0  0
  7  5  1  0  0  0  0
M  CHG  1   1  -1
M  END



Best regards,
Xianghai

On Wed, May 31, 2017 at 8:09 AM, Tim Vandermeersch <
tim.vandermeer...@gmail.com> wrote:

> Hi,
>
> I can't reproduce this. The order of fragments should be canonical (the
> algorithm takes this into account). What is the original source of the
> OBMol that gives a different result?
>
> For example, the following SMILES all convert to the same canonical form:
>
> ClCCl.O.[Cl-]
> O.ClCCl.[Cl-]
> O.[Cl-].ClCCl
> ClCCl.[Cl-].O
> [Cl-].ClCCl.O
> [Cl-].O.ClCCl
>
> => ClCCl.O.[Cl-]
>
> Kind regards,
> Tim
>
> On Sat, May 27, 2017 at 4:50 PM, Geoff Hutchison <
> geoff.hutchi...@gmail.com> wrote:
>
>> No, this is a known bug with disconnected fragments. The canonical
>> algorithm does not canonicalize the fragments.
>>
>> Geoff
>>
>> On May 27, 2017, at 4:20 AM, Noel O'Boyle  wrote:
>>
>> Should be the same. Can you provide the files?
>>
>> On 27 May 2017 12:51 a.m., "xh s"  wrote:
>>
>>> In my program I convert the molecule ClCCl.O.[Cl-] (from both SMILES and
>>> OBMol) to canonical SMILES but get two different answers, ClCCl.O.[Cl-] and
>>> ClCCl.[Cl-].O
>>>
>>> My question is, is the order of disconnected parts controlled by the
>>> algorithm so that there is only one unique way?
>>>
>>> Thanks!
>>> Xianghai
>>>
>>> 
>>> --
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> ___
>>> OpenBabel-discuss mailing list
>>> OpenBabel-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>
>>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Canonical SMILES with disconnected parts

2017-05-31 Thread Tim Vandermeersch
Hi,

I can't reproduce this. The order of fragments should be canonical (the
algorithm takes this into account). What is the original source of the
OBMol that gives a different result?

For example, the following SMILES all convert to the same canonical form:

ClCCl.O.[Cl-]
O.ClCCl.[Cl-]
O.[Cl-].ClCCl
ClCCl.[Cl-].O
[Cl-].ClCCl.O
[Cl-].O.ClCCl

=> ClCCl.O.[Cl-]

Kind regards,
Tim

On Sat, May 27, 2017 at 4:50 PM, Geoff Hutchison 
wrote:

> No, this is a known bug with disconnected fragments. The canonical
> algorithm does not canonicalize the fragments.
>
> Geoff
>
> On May 27, 2017, at 4:20 AM, Noel O'Boyle  wrote:
>
> Should be the same. Can you provide the files?
>
> On 27 May 2017 12:51 a.m., "xh s"  wrote:
>
>> In my program I convert the molecule ClCCl.O.[Cl-] (from both SMILES and
>> OBMol) to canonical SMILES but get two different answers, ClCCl.O.[Cl-] and
>> ClCCl.[Cl-].O
>>
>> My question is, is the order of disconnected parts controlled by the
>> algorithm so that there is only one unique way?
>>
>> Thanks!
>> Xianghai
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Error when using compound.draw() in pybel installed by conda - PNG depiction support not found.

2017-05-31 Thread Maciek Wójcikowski
I've rebuilt the Python 2.7 packages for Windows (the rest is still
compiling), and the PNG should work now. Update openbabel package to 2.4.1
py27_3: `conda install -c openbabel openbabel`.


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

2017-05-31 13:16 GMT+02:00 Noel O'Boyle :

> That's a pity. In the meanwhile, you can still create SVG images if
> you choose this a write format, and pysvg might be able to convert to
> PNG (?).
>
> On 31 May 2017 at 10:21, Maciek Wójcikowski  wrote:
> > Hi,
> >
> > PNG is not supported yet on Windows - Openbabel was not compiled with
> it, as
> > there is no cairo package on Anaconda main channel for windows (note
> you're
> > using conda-forge).
> >
> > Unfortunately this is also the case in bioconda, so for now there is no
> > better conda solution yet. I will revisit this issue and try to support
> PNG
> > files.
> >
> > 
> > Pozdrawiam,  |  Best regards,
> > Maciek Wójcikowski
> > mac...@wojcikowski.pl
> >
> > 2017-05-31 11:06 GMT+02:00 Hongbin Yang :
> >>
> >> Hi,
> >>
> >> I installed openbabel via `conda install -c openbabel openbabel`.
> >>
> >> I wanted to draw the molecule like
> >> `pybel.readstring('smi','c1c1').draw()`
> >>
> >> Then the error was raised:
> >> C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self,
> show,
> >> filename, update, usecoords)
> >> 615 formatok = obconversion.SetOutFormat("_png2")
> >> 616 if not formatok:
> >> --> 617 raise ImportError("PNG depiction support not found. You should "
> >> 618 "compile Open Babel with support for Cairo. See "
> >> 619 "installation instructions for more "
> >>
> >> ImportError: PNG depiction support not found. You should compile Open
> >> Babel with support for Cairo. See installation instructions for more
> >> information.
> >>
> >> The installed packages includes:
> >> libpng 1.6.28 vc9_0 [vc9] conda-forge
> >> pillow 4.0.0 py27_0
> >> pycairo 1.10.0 
> >> openbabel 2.4.1 py27_2 openbabel
> >> cairo 1.14.6 vc9_4 [vc9] conda-forge
> >>
> >> I have both pillow and (py)cairo. Why can't I draw the molecule ?
> >> I guess that if I followed the suggestion and compile it with suport
> cairo
> >> it will work. But I have to work with conda. Is there any better way?
> >>
> >> Sincerely,
> >>
> >> 
> >> Hongbin Yang 杨弘宾
> >> Research: Toxicophore and Chemoinformatics
> >> Pharmaceutical Science, School of Pharmacy
> >> East China University of Science and Technology
> >>
> >>
> >> 
> --
> >> Check out the vibrant tech community on one of the world's most
> >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >> ___
> >> OpenBabel-discuss mailing list
> >> OpenBabel-discuss@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
> >>
> >
> >
> > 
> --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > OpenBabel-discuss mailing list
> > OpenBabel-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
> >
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Error when using compound.draw() in pybel installed by conda - PNG depiction support not found.

2017-05-31 Thread Noel O'Boyle
That's a pity. In the meanwhile, you can still create SVG images if
you choose this a write format, and pysvg might be able to convert to
PNG (?).

On 31 May 2017 at 10:21, Maciek Wójcikowski  wrote:
> Hi,
>
> PNG is not supported yet on Windows - Openbabel was not compiled with it, as
> there is no cairo package on Anaconda main channel for windows (note you're
> using conda-forge).
>
> Unfortunately this is also the case in bioconda, so for now there is no
> better conda solution yet. I will revisit this issue and try to support PNG
> files.
>
> 
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
> 2017-05-31 11:06 GMT+02:00 Hongbin Yang :
>>
>> Hi,
>>
>> I installed openbabel via `conda install -c openbabel openbabel`.
>>
>> I wanted to draw the molecule like
>> `pybel.readstring('smi','c1c1').draw()`
>>
>> Then the error was raised:
>> C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self, show,
>> filename, update, usecoords)
>> 615 formatok = obconversion.SetOutFormat("_png2")
>> 616 if not formatok:
>> --> 617 raise ImportError("PNG depiction support not found. You should "
>> 618 "compile Open Babel with support for Cairo. See "
>> 619 "installation instructions for more "
>>
>> ImportError: PNG depiction support not found. You should compile Open
>> Babel with support for Cairo. See installation instructions for more
>> information.
>>
>> The installed packages includes:
>> libpng 1.6.28 vc9_0 [vc9] conda-forge
>> pillow 4.0.0 py27_0
>> pycairo 1.10.0 
>> openbabel 2.4.1 py27_2 openbabel
>> cairo 1.14.6 vc9_4 [vc9] conda-forge
>>
>> I have both pillow and (py)cairo. Why can't I draw the molecule ?
>> I guess that if I followed the suggestion and compile it with suport cairo
>> it will work. But I have to work with conda. Is there any better way?
>>
>> Sincerely,
>>
>> 
>> Hongbin Yang 杨弘宾
>> Research: Toxicophore and Chemoinformatics
>> Pharmaceutical Science, School of Pharmacy
>> East China University of Science and Technology
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Error when using compound.draw() in pybel installed by conda - PNG depiction support not found.

2017-05-31 Thread Maciek Wójcikowski
Hi,

PNG is not supported yet on Windows - Openbabel was not compiled with it,
as there is no cairo package on Anaconda main channel for windows (note
you're using conda-forge).

Unfortunately this is also the case in bioconda, so for now there is no
better conda solution yet. I will revisit this issue and try to support PNG
files.


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

2017-05-31 11:06 GMT+02:00 Hongbin Yang :

> Hi,
>
> I installed openbabel via `conda install -c openbabel openbabel`.
>
> I wanted to draw the molecule like
> `pybel.readstring('smi','c1c1').draw()`
>
> Then the error was raised:
> C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self, show,
> filename, update, usecoords)
> 615 formatok = obconversion.SetOutFormat("_png2")
> 616 if not formatok:
> --> 617 raise ImportError("PNG depiction support not found. You should "
> 618 "compile Open Babel with support for Cairo. See "
> 619 "installation instructions for more "
>
> ImportError: PNG depiction support not found. You should compile Open
> Babel with support for Cairo. See installation instructions for more
> information.
>
> The installed packages includes:
> libpng 1.6.28 vc9_0 [vc9] conda-forge
> pillow 4.0.0 py27_0
> pycairo 1.10.0 
> openbabel 2.4.1 py27_2 openbabel
> cairo 1.14.6 vc9_4 [vc9] conda-forge
>
> I have both pillow and (py)cairo. Why can't I draw the molecule ?
> I guess that if I followed the suggestion and compile it with suport cairo
> it will work. But I have to work with conda. Is there any better way?
>
> Sincerely,
>
> --
> Hongbin Yang 杨弘宾
> Research: Toxicophore and Chemoinformatics
> Pharmaceutical Science, School of Pharmacy
> East China University of Science and Technology
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


[Open Babel] Error when using compound.draw() in pybel installed by conda - PNG depiction support not found.

2017-05-31 Thread Hongbin Yang






Hi,
I installed openbabel via `conda install -c openbabel openbabel`.
I wanted to draw the molecule like`pybel.readstring('smi','c1c1').draw()`
Then the error was raised:?C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc 
in draw(self, show, filename, update, usecoords)

615 formatok = obconversion.SetOutFormat("_png2")

616 if not formatok:

--> 617 raise ImportError("PNG depiction support not found. You 
should "

618   "compile Open Babel with support for 
Cairo. See "

619   "installation instructions for more "



ImportError: PNG depiction support not found. You should compile Open Babel 
with support for Cairo. See installation instructions for more information.
The installed packages includes:libpng1.6.28
vc9_0  [vc9]  conda-forgepillow4.0.0
py27_0pycairo   1.10.0openbabel
 2.4.1py27_2openbabelcairo 
1.14.6vc9_4  [vc9]  conda-forge
I have both pillow and (py)cairo. Why can't I draw the molecule ?I guess that 
if I followed the suggestion and compile it with suport cairo it will work. But 
I have to work with conda. Is there any better way?
Sincerely,?


Hongbin Yang 杨弘宾

Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy

East China University of Science and Technology?


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss