Re: [Open Babel] Bindings - first and last molecule option

2013-12-13 Thread Maciek Wójcikowski
Hello again, I've fixed the issue here: https://github.com/openbabel/openbabel/pull/52 Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/12/12 Maciek Wójcikowski > I think, I've pin-pointed the issue in the source - OBConversion class. > The first and last molec

Re: [Open Babel] Bindings - first and last molecule option

2013-12-12 Thread Maciek Wójcikowski
I think, I've pin-pointed the issue in the source - OBConversion class. The first and last molecule is set by SetStartAndEnd method. It's being called only by Convert method, not by Read nor ReadFile, hence the binding dont use -f and -l. I figure if i't called SetStartAndEnd in Read or ReadFile, t

Re: [Open Babel] Bindings - first and last molecule option

2013-12-04 Thread Geoffrey Hutchison
> This only proves, that I really want to use it. Is the proof.py script > working correctly for anybody (attached in previous mail)? It should ouptut > molecules no. 5-10 out of 100 in proof.sdf No, it doesn't work. % python proof.py | wc 100 1001300 Hmm. Chris, any idea why this

Re: [Open Babel] Bindings - first and last molecule option

2013-12-04 Thread Maciek Wójcikowski
This only proves, that I really want to use it. Is the proof.py script working correctly for anybody (attached in previous mail)? It should ouptut molecules no. 5-10 out of 100 in proof.sdf Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/12/3 Chris Morley > > O

Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Geoffrey Hutchison
On Dec 3, 2013, at 3:52 PM, Chris Morley wrote: > In fact it is implemented this way for most common multi-molecule file > formats. The molecules before the one specified by the -f option are > skipped without being parsed. (The format's virtual SkipObjects() > function is used.) I stand corr

Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Chris Morley
> On 2013-12-03 04:28, Maciek Wójcikowski wrote: >> You're probably right, C also has to read therm, but other than recognizing the beginning and the end of the molecule it wouldn't do anything especially kekulization and bonding etc. > On 03/12/2013 18:11, Geoffrey Hutchison wrote: > Actually no.

Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Geoffrey Hutchison
> You're probably right, C also has to read therm, but other than recognizing > the beginning and the end of the molecule it wouldn't do anything especially > kekulization and bonding etc. Actually no. Indeed this would be a useful "lazy" optimization, but is not currently implemented this way.

Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Maciek Wójcikowski
Hi Dimitri, Try to do that for 20mln molecules, I guarantee you it'll kill your machine. The point is to skip n molecules at the beginning of the file, and do it efficiently(aka, read only desired range on n-m molecules). You're probably right, C also has to read therm, but other than recognizing

Re: [Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Dimitri Maziuk
On 2013-12-03 04:28, Maciek Wójcikowski wrote: > Hello, > > I'd like to ask, if it's somehow possible to use first [-f] and last > [-l] options via python bindings? last = list(mols)[-1] ? -- I haven't tried myself. I suspect even in c++ you still have to actually read them all in to get random a

[Open Babel] Bindings - first and last molecule option

2013-12-03 Thread Maciek Wójcikowski
Hello, I'd like to ask, if it's somehow possible to use first [-f] and last [-l] options via python bindings? I've looked at pybel._operations, but there is no such option there. Setting it via OBConverter's methods AddOption() and SetOptions() does't seem to work either. My first instinct is that