Re: [Open Babel] Reading large coordinate files in C++ using Babel

2018-02-15 Thread Sébastien Le Roux

Le 13/02/2018 à 22:28, Benjamin Bucior a écrit :

Hi Sébastien,

I have run into similar issues and eventually traced it back to the 
ring perception after using a profiler.  Unfortunately, the ring 
perception can be triggered in unexpected places to avoid internal 
inconsistencies. (e.g. copying an OBMol in turn calculates OBAtom 
hybridization if not defined, which can quickly become a 95+% 
bottleneck in large systems.)


For a use case similar to yours, if you are only interested in the XYZ 
coordinates but not bonding information, there may be a simple 
workaround.  Many of the formats have flags to adjust the input and 
output behavior.  Caveat: I mostly work with CIFs, but based on the 
PDB format page  the flags look 
similar.  You might try adding this line above where you read the file:


conv.AddOption("b", OBConversion::INOPTIONS);

Alternatively, if you are interested in neighbors but not bond orders, 
I have had success with the "s" option.


Best regards,
Ben

Hi,
and thank you for your help, all of you,
your solution [ *conv.AddOption("b", OBConversion::INOPTIONS);* ] is 
precisely what I was looking for,

not that I can understand what it does, but it does it :-P
I use OpenBabel to read chemistry files, but I am only interested in 
atomic coordinates,
my software is fast enough when looking for bonding information, even 
for way more than the
3000 atoms in my disordered SiO2 example, and as long as I can get the 
coordinates I am fine.
I think all the analysis you are talking about should really be 
triggered by the user,
at least at the programmer level anyway, also this information is 
relevant and should
be displayed somewhere in the API website, my first though when I tried 
to understand
was to look for a diagram of some sort to explain the steps babel was 
going through to open a chem file,
so I could find out what was taking so long and maybe the keywords to 
trigger each steps,
but I could not find that kind of information ... maybe I did not look 
in the right place.
Also this happens not matter the file format, xyz, cif, pdb, obviously 
with PDB if bonding information
is stored the process is shorter, but then again should the analysis be 
performed even the file does
not contains bonding information ? And if as you mentioned many of the 
format have flags,
I was not able to find documentation (in the API website) to see what 
flags and how to trigger them.



It happens that I am very familiar with ring statistics and related 
algorithms,
is there any way to print out the ring information that Openbabel looked 
for during that time
at the opening of the files so I can check exactly what it is, ie. what 
kind of rings it
actually is interested in ? ... I could compare that info with bench 
from my codes that also look

for rings, to see if I can help to speed up the process ... who knows ...


Anyway again thank you for your help and you reactivity !
And thank you to the Openbabel community for this great tool !

Best regards

Sébastien

===
Dr. Sébastien Le Roux
Ingénieur de Recherche CNRS
Institut de Physique et Chimie des Matériaux de Strasbourg
Département des Matériaux Organiques
23, rue du Loess
BP 43
F-67034 Strasbourg Cedex 2, France
E-mail: sebastien.ler...@ipcms.unistra.fr
Webpage: http://www-ipcms.u-strasbg.fr/spip.php?article1771
RINGS project: http://rings-code.sourceforge.net/
ISAACS project: http://isaacs.sourceforge.net/
Fax:   +33 3 88 10 72 46
Phone: +33 3 88 10 71 62
===

--
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] Reading large coordinate files in C++ using Babel

2018-02-15 Thread Benjamin Bucior
Hi Sébastien,

I have run into similar issues and eventually traced it back to the ring
perception after using a profiler.  Unfortunately, the ring perception can
be triggered in unexpected places to avoid internal inconsistencies. (e.g.
copying an OBMol in turn calculates OBAtom hybridization if not defined,
which can quickly become a 95+% bottleneck in large systems.)

For a use case similar to yours, if you are only interested in the XYZ
coordinates but not bonding information, there may be a simple workaround.
Many of the formats have flags to adjust the input and output behavior.
Caveat: I mostly work with CIFs, but based on the PDB format page
 the flags look similar.  You might try
adding this line above where you read the file:

conv.AddOption("b", OBConversion::INOPTIONS);

Alternatively, if you are interested in neighbors but not bond orders, I
have had success with the "s" option.

Best regards,
Ben


On Tue, Feb 13, 2018 at 2:32 PM, Geoffrey Hutchison <
geoff.hutchi...@gmail.com> wrote:

> > as an example you use this file (silica glass SiO2 with 3000 atoms in
> PDB format, written using Babel):
> ...
> > Is this the reason why it is so slow for this kind of coordinates is
> because Babel looking for bonds ?
>
> My guess, based on your example, is ring / aromaticity perception.
>
> In PDB, while bonds (CONECT) records can be stored, bond orders are not.
> So by default, Open Babel performs bond order perception
> (OBMol::PerceiveBondOrders()).
>
> At the moment, this includes a process to detect aromaticity and perform
> Kekule assignment. This gets slowed by perception over multiple fused rings
> (nanotubes, graphene, .. silica glass). On most molecules, it’s not a huge
> issue, but for materials and nanostructures, its. very. . slooww. . .
>
> I’m not sure how you’re using your code, but I’d make sure that
> PerceiveBondOrders() is not called.
>
> Finding bonds with ConnectTheDots() is usually reasonably fast, but this
> can also be an impact that you’re describing.
>
> -Geoff
> 
> --
> 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