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
<https://openbabel.org/wiki/PDB> 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

Reply via email to