#!/usr/bin/env python # ch28-4.py from openeye.oechem import * libgen = OELibraryGen("[O:1]=[C:2][Cl:3].[N:4]>>[O:1]=[C:2][N:4]") libgen.SetExplicitHydrogens(False) libgen.SetValenceCorrection(True) mol = OEGraphMol() OEParseSmiles(mol, "CC(=O)Cl") libgen.SetStartingMaterial(mol, 0) mol.Clear() OEParseSmiles(mol, "NCC") libgen.SetStartingMaterial(mol, 1) for product in libgen.GetProducts(): smi = OECreateCanSmiString(product) print smi