Le 6 mai 2013 à 18:12, Patrick Fuller a écrit : > > After mol.unitcell.FillUnitCell, can you try: > mol.OBMol.ConnectTheDots() > mol.OBMol.PerceiveBondOrders() > > I've tried this, but it's way too slow. I'm guessing ConnectTheDots is > O(N^2), and N is big in crystal structures.
What N are you talking about - the time should be negligible even for 1000s of atoms, unless you are doing this in a loop ? Could you supply an example /test case ? > Is there a way to better control the unit cell? Say, returning a 2x2x2-cell > structure or recentering the coordinates so the organic molecules don't get > split up? There are actually several FillUnitCell functions in open babel: 1) in https://github.com/openbabel/openbabel/blob/master/src/generic.cpp (line 578) 2) in https://github.com/openbabel/openbabel/blob/master/src/ops/fillUC.cpp The latter (which is used from the command line) has two options, 'keepconnect' and 'strict' - the first option should keep the atoms connected. Can you try it (I don't know if it can be used from python, from the command line it would be --fillUC keepconnect ) ? Vincent -- Vincent Favre-Nicolin http://inac.cea.fr CEA/Grenoble Institut Nanosciences & Cryogénie Laboratoire SP2M/Nano-structures et Rayonnement Synchrotron 17, rue des Martyrs 38054 Grenoble Cedex 9 - France Université Joseph Fourier http://www.ujf-grenoble.fr tél: (+33) 4 38 78 95 40 fax: (+33) 4 38 78 51 38 ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss