#include "oesystem.h" #include "oechem.h" using namespace OESystem; using namespace OEChem; void GetGoodMol(OEMCMolBase &destination,const OEMCMolBase &source) { destination.DeleteConfs(); OEConfBase *newConf; char buf[2048]; OEIter conf; for(conf = source.GetConfs();conf;++conf) { if(conf->GetEnergy() < -15.5f) { newConf = destination.NewConf(conf); sprintf(buf,"Low Energy Conformer: energy = %.3f",newConf->GetEnergy()); newConf->SetTitle(buf); } } } int main() { OEMol mol; OEMol goodmol; oemolistream mis("input.oeb"); oemolostream mos("output.sdf"); while(OEReadMolecule(mis,mol)) { GetGoodMol(goodmol,mol); OEWriteMolecule(mos,goodmol); } return 0; }