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 ------------------------------------------------------------------------------ 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