Hello All, I am using OBMol->GetMapList to get the occurrences of fragments in molecules. I'm not to sure that everything works correctly, though. OpenBabel(-2.2.3) apparently tells me that N matches only twice in C10H19N5O:
code: [[[ OBMol * mol = new OBMol(); OBConversion obconversion; obconversion.SetInFormat("smiles"); obconversion.ReadString(mol, "C1(N=C(NC(C)C)N=C(N=1)OC)NC(C)C"); cout << "formula "<< mol->GetFormula() << "\n"; OBSmartsPattern smartsPattern; smartsPattern.Init( "N" ); smartsPattern.Match( *mol ); vector<vector <int> > map = smartsPattern.GetMapList(); cout << "num matches of N: "<< map.size() << "\n"; ]]] output: > formula C10H19N5O > num matches of N: 2 Regards, Martin ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss