Re: [Open Babel] splitting molecule file - the hard case

2015-11-12 Thread Filip Stefaniak
On 11/10/2015 05:23 PM, Maciek Wójcikowski wrote: > Hi Filip, > > OBMol has a Separate method, which does exactly what you'd > like. > http://openbabel.org/dev-api/classOpenBabel_1_1OBMol.shtml#a1e5c6955a32c0ec2317a8de12ab7ba5a > > import pybel > mol = pybel.readfile('mol2',

Re: [Open Babel] splitting molecule file - the hard case

2015-11-10 Thread Maciek Wójcikowski
Hi Filip, OBMol has a Separate method, which does exactly what you'd like. http://openbabel.org/dev-api/classOpenBabel_1_1OBMol.shtml#a1e5c6955a32c0ec2317a8de12ab7ba5a import pybel > mol = pybel.readfile('mol2', 'ligand.mol2').next() > for m in mol.OBMol.Separate(): > print m Note that m

[Open Babel] splitting molecule file - the hard case

2015-11-10 Thread Filip Stefaniak
Hi, I have a mol2 file: https://gist.github.com/filipsPL/0b936f4d416bdc45ebea There are three apparently separate molecules inside. But I'm not able to separate them. obabel -m doesn't solve the problem. I've tried to do it in python with pybel, but I don't know how to exactly code it (it is not