On 28/03/2013 12:17, Pascal Muller wrote: > Hi, > >> Is there a way to append ROTATABLE_BOND as a descriptor in openbabel, If is >> there any then please help me. > > http://forums.openbabel.org/number-of-rotatable-bonds-td959206.html > > Should be easy to add the corresponding line in > openbabel-2.3.1/tools/obprop.cpp, recompile, and run obprop, if that > is what you want. > > Or just run e.g. > > #!/usr/bin/python > import pybel > for mol in pybel.readfile("smi", "file.smi"): > print mol.OBMol.NumRotors(), "\t", mol.OBMol.GetTitle()
If you would prefer the number of rotatable bonds as a descriptor and without having to recompile, add the following item to data/plugindefines.txt SmartsDescriptor rotors [!$(*#*)&!D1]-!@[!$(*#*)&!D1] Number of rotatable bonds\n From http://www.daylight.com/dayhtml_tutorials/languages/smarts/smarts_examples.html#ROTATE Use like: obabel mols.xxx -O out.yyy --append rotors obabel mols.xxx -O out.yyy --sort rotors+ obabel mols.xxx -O out.yyy --filter "rotors>2" obabel mols.xxx -O out.yyy --largest 3 rotors+ Chris ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss