Re: [Open Babel] Count Molecules

2013-08-21 Thread Geoffrey Hutchison
> Note that an output format is not used but something still has to be there. > Writing the functionality as an output format -ocount as suggested by Noel > would be clearer but I didn't find it easy to do. I suspect the op will be slightly faster than an output format due to overhead. -Geoff

Re: [Open Babel] Count Molecules

2013-08-21 Thread Dimitri Maziuk
On 08/21/2013 10:41 AM, Chris Morley wrote: > obabel 10dataset.sdf -onul --count ... > Note that an output format is not used but something still has to be > there. Writing the functionality as an output format -ocount as > suggested by Noel would be clearer but I didn't find it easy to do. Off

Re: [Open Babel] Count Molecules

2013-08-21 Thread Chris Morley
On 17/08/2013 20:09, Chris Swain wrote: Is there a way to simply count the number of molecules in a file? There is an API command OBConversion::NumInputObjects() which works with most multi-molecule formats (although it looks faulty for mol2). It is currently not exposed in the obabel interfa

Re: [Open Babel] Count Molecules

2013-08-21 Thread Maciek Wójcikowski
Hello, For sets that are not extremly big (as it could get quite long), I'd suggest converting to smiles and counting the lines: obabel input.mol2 -o smi | wc -l Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/8/20 Dimitri Maziuk > On 08/20/2013 12:32 PM, Noe

Re: [Open Babel] Count Molecules

2013-08-20 Thread Dimitri Maziuk
On 08/20/2013 12:32 PM, Noel O'Boyle wrote: > I usually use grep too, but I understand what you're saying - it's a > common task we should automate (e.g. "-ocount"). In the meanwhile, you > could speed it up quite a bit by turning off some of the perception, > i.e. -aT (read title only). python: c

Re: [Open Babel] Count Molecules

2013-08-20 Thread Noel O'Boyle
heck that the last line is also '', otherwise you > may have to add 1. > > If it is for a mol2 file, you could do > fgrep -c "@ATOM" > > > If you are on Windows, open a DOS prompt and substitute > "fgrep -c" above with "find /c"

Re: [Open Babel] Count Molecules

2013-08-17 Thread Chris Swain
> If it is for a mol2 file, you could do > fgrep -c "@ATOM" > > > If you are on Windows, open a DOS prompt and substitute > "fgrep -c" above with "find /c". > > etc. etc. > > > Ling > > > From: Chris Swain >

Re: [Open Babel] Count Molecules

2013-08-17 Thread S.L. Chan
ou are on Windows, open a DOS prompt and substitute "fgrep -c" above with "find /c". etc. etc. Ling > > From: Chris Swain >To: openbabel-discuss@lists.sourceforge.net >Sent: Saturday, August 17, 2013 12:09 PM >Subject: [Open Ba

[Open Babel] Count Molecules

2013-08-17 Thread Chris Swain
Hi, Is there a way to simply count the number of molecules in a file? Cheers Chris -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to c