#!/usr/local2/bin/python from openeye.oechem import * import os, string ifs = oemolistream() ifs.open('g_create_dp.sdf') ofs_1 = oemolostream() ofs_2 = oemolostream() ofs_1.open('h_react_dp_ln.ism') ofs_2.open('h_react_dp_ln.sdf') ofs_3 = oemolostream() ofs_4 = oemolostream() ofs_3.open('h_react_dp_lp.ism') ofs_4.open('h_react_dp_lp.sdf') # Reaction: OH- nucleophilic attack at X-C=O (peptide) -OH mol_hyd = OEGraphMol() OEParseSmiles(mol_hyd, "[OH]") mol_wat = OEGraphMol() OEParseSmiles(mol_wat, "O(H)H") libgen1 = OELibraryGen("[C:4][C:1]=([O:3])[NH0,NH1:2].[OH:100]>>[C:4][C:1]([O-:3])([OH:100])[NH0,NH1:2]") libgen2 = OELibraryGen("[C:4][C:1]=([O:3])[NH0,NH1:2].[O:100]([H:101])[H:102]>>[C:4][C:1]([O-:3])([O:100][H:101])[*+:2][H:102]") for mol in ifs.GetOEMols(): libgen1.AddStartingMaterial(mol, 0) libgen1.AddStartingMaterial(mol_hyd, 1) libgen2.AddStartingMaterial(mol, 0) libgen2.AddStartingMaterial(mol_wat, 1) mol.Clear() mol_wat.Clear() mol_hyd.Clear() for products in libgen1.GetProducts(): title = products.GetTitle()[:-1] products.SetTitle(title) OEWriteMolecule(ofs_1, products) OEWriteMolecule(ofs_2, products) for products in libgen2.GetProducts(): title = products.GetTitle()[:-1] products.SetTitle(title) OEWriteMolecule(ofs_3, products) OEWriteMolecule(ofs_4, products) ifs.close() ofs_1.close() ofs_2.close() ofs_3.close() ofs_4.close()