unsigned int ob_num_atoms (char *smiles) { OBMol mol; OBConversion conv; string tmpStr (smiles); istringstream molstream (tmpStr); unsigned int numatoms = 0;
conv.SetInAndOutFormats ("SMI", "SMI"); conv.Read (&mol, &molstream); numatoms = mol.NumAtoms (); return (numatoms); } is the basic skeleton to read a SMILES into an OBMol and get the atom count. FOR_BONDS_OF_MOL(bond, mol) // iterator access (see OBMolBondIter) will give you an iterator over the bonds OBBond->GetBO gives you the order. Then you can increment your counts per bond order. Take a look at http://openbabel.org/api/2.2.0/classOpenBabel_1_1OBMol.shtml and the examples at the bottom. regards, Ernst-Georg ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss