#!/usr/local2/bin/python from openeye.oechem import * import os, string ifs = oemolistream() ifs.open('g_create_derivatives.sdf') ofs_1 = oemolostream() ofs_1.open('h_react_derivatives_ln.ism') ofs_2 = oemolostream() ofs_2.open('h_react_derivatives_ln.sdf') ofs_3 = oemolostream() ofs_3.open('h_react_derivatives_lp.ism') ofs_4 = oemolostream() ofs_4.open('h_react_derivatives_lp.sdf') # Hydantoin, Succinyl, Acetyl, Formyl # Reaction: OH- nucleophilic attack at X-C=O (peptide) -OH mol_hyd = OEGraphMol() OEParseSmiles(mol_hyd, "[OH]") libgen1 = OELibraryGen("[C,#1:4][C:1](=[O:3])[NH0,NH1:2].[OH:100]>>[*:4][C:1]([O-:3])([OH:100])[N:2]") mol_wat = OEGraphMol() OEParseSmiles(mol_wat, "O(H)H") libgen2 = OELibraryGen("[C,#1:4][C:1](=[O:3])[NH0,NH1:2].[O:100]([H:101])[H:102]>>[*: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_hyd.Clear() mol_wat.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() #Formimino # Reaction: OH- nucleophilic attack at X-C=O (peptide) -OH ifs.open('g_create_derivatives.sdf') mol_wat = OEGraphMol() OEParseSmiles(mol_wat, "O(H)H") mol_hyd = OEGraphMol() OEParseSmiles(mol_hyd, "[OH]") libgen1 = OELibraryGen("[NH:3]=[CH:4][NH0,NH1:2].[OH:100]>>[NH2:3][CH:4]([OH:100])[NH0,NH1:2]") libgen2 = OELibraryGen("[NH:3]=[CH:4][NH0,NH1:2].[O:100]([H:101])[H:102]>>[NH2:3][CH:4]([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_hyd.Clear() mol_wat.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() #Carbamoyl # Reaction: OH- nucleophilic attack at X-C=O (peptide) -OH ifs.open('g_create_derivatives.sdf') mol_wat = OEGraphMol() OEParseSmiles(mol_wat, "O(H)H") mol_hyd = OEGraphMol() OEParseSmiles(mol_hyd, "[OH]") libgen1 = OELibraryGen("[NH2:1][C:2](=[O:3])[NH1,NH0:4].[OH:100]>>[NH2:1][C:2]([O-:3])([OH:100])[N:4]") libgen2 = OELibraryGen("[NH2:1][C:2](=[O:3])[NH1,NH0:4].[O:100]([H:101])[H:102]>>[NH2:1][C:2]([O-:3])([O:100][H:101])[*+:4][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_hyd.Clear() mol_wat.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()