#include #include #include #include #include #include #include using namespace std; using namespace OpenBabel; int main(int argc, char* argv[]) { OBConversion conv; conv.SetInAndOutFormats("SMI", "SDF"); OBMol mol; conv.ReadString(&mol, "COc1cc2ncnc(c2cc1OCCCN1CCOCC1)Nc1ccc(c(c1)Cl)F"); generateDiagram(&mol); mol.SetDimension(2); OBSmartsPattern smp; smp.Init("C1COCCN1"); smp.Match(mol); vector > mlist = smp.GetUMapList(); mol.BeginModify(); OBAtom* a = mol.GetAtom(mlist[0][2]); a->SetAtomicNum(16); mol.EndModify(); conv.Write(&mol, &cout); }