#!/usr/local2/bin/python2.3 # extract mols with correct leaving group import sys, string, os from openeye.oechem import * corr_leaving = ['7_1', '7_3', '15_5', '15_7', '6_1', '6_3', '12_9', '12_11', '5_1', '5_3', '8_5', '8_7', '14_5', '14_7', '3_1', '3_3', '1_5', '1_7', '4_5', '4_7', '13_5', '13_7', '16_9', '16_11', '11_1', '11_3', '9_1', '9_3', '2_1', '2_3', '10_5', '10_7'] ifs = oemolistream() ofs = oemolostream() ifs.open('e_phos_stereo_ln.sdf') ofs.open('e_phos_stereo_ln_corr_l.sdf') for mol in ifs.GetOEMols(): if mol.GetTitle() in corr_leaving: OEWriteMolecule(ofs,mol) else: continue ifs.close() ofs.close()