On 12/02/2013 09:38, Chris Swain wrote: > > On 12 Feb 2013, at 07:32, > openbabel-discuss-requ...@lists.sourceforge.net > <mailto:openbabel-discuss-requ...@lists.sourceforge.net> wrote: > >> Message: 3 >> Date: Sun, 10 Feb 2013 19:40:53 +0000 >> From: Chris Morley <c.mor...@gaseq.co.uk <mailto:c.mor...@gaseq.co.uk>> >> Subject: Re: [Open Babel] 2.3.2 >> To:openbabel-discuss@lists.sourceforge.net >> <mailto:openbabel-discuss@lists.sourceforge.net> >> Message-ID: <5117f7c5.9000...@gaseq.co.uk <http://gaseq.co.uk/>> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> On 09/02/2013 20:04, Chris Swain wrote: >>> Hi >>> My main machine has OpenBabel 2.3.1 installed and this command works >>> fine. >>> >>> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c "NNNN" >>> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf >>> 665 >>> The number being the number of molecules in the sdf file. >>> >>> >>> I've been playing around with OpenBabel 2.3.2 from SVN and I now get >>> an error, it seems I now need to explicitly include the input file type. >>> >>> ChrisMacbookPro:~ swain$ /usr/local/bin/obgrep -v -c "NNNN" >>> /Users/swain/Desktop/ChemicalStructures/acetophenones.sdf >>> >>> Does not work but if I include -isdf it does work. >>> >>> SMILES files work with or without the input file defined. >>> >>> I'm not sure if this is something I have done or if it is a bug? >> >> It does that for me too, apparently as a result of a change made last >> summer. >> >> As an alternative, you could use obabel with the -v option and a nul >> output format: >> >> obabel 10dataset.sdf -onul -v "C1CCCCC1" >> 8 molecules converted >> >> This has the extension in that, instead of a SMARTS pattern, the >> parameter of -v can be the name of a file containing several structures >> (in any format) you want to exclude (or, with the -s option, include). >> >> There is currently no obabel equivalent of obgrep's -t NUM option which >> restricts to molecules with exactly NUM matches - but I've just >> rectified that in the development code. >> >> Chris > > Am I correct in thinking the output is written to stand error not > standard output?
The "8 molecules converted" and other informative messages are written to clog, which may be mapped to standard error. Error messages are written to standard error, and the output of formats may be written to standard out. I prefer using obabel rather than standalone programs because (usually) its functionality can also be accessed from the GUI. It has a uniform user interface and also additional features, such as adding or removing hydrogens, filtering, sorting, that can often be done at the same time. Chris ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss