/* (C) 2022 Cadence Design Systems, Inc. (Cadence) All rights reserved. TERMS FOR USE OF SAMPLE CODE The software below ("Sample Code") is provided to current licensees or subscribers of Cadence products or SaaS offerings (each a "Customer"). Customer is hereby permitted to use, copy, and modify the Sample Code, subject to these terms. Cadence claims no rights to Customer's modifications. Modification of Sample Code is at Customer's sole and exclusive risk. Sample Code may require Customer to have a then current license or subscription to the applicable Cadence offering. THE SAMPLE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. OPENEYE DISCLAIMS ALL WARRANTIES, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. In no event shall Cadence be liable for any damages or liability in connection with the Sample Code or its use. */ using System; using OpenEye.OEChem; using OpenEye.OEOmega; public class Macrocycle { static void Main(string[] args) { OEMacrocycleOmegaOptions omegaOpts = new OEMacrocycleOmegaOptions(); omegaOpts.SetParameterVisibility(OEParamVisibility.Hidden); omegaOpts.SetParameterVisibility("-rms", OEParamVisibility.Simple); omegaOpts.SetParameterVisibility("-ewindow", OEParamVisibility.Simple); omegaOpts.SetParameterVisibility("-maxconfs", OEParamVisibility.Simple); OESimpleAppOptions opts = new OESimpleAppOptions(omegaOpts, "Macrocycle", OEFileStringType.Mol, OEFileStringType.Mol3D); if(OEChem.OEConfigureOpts(opts, args, false) == OEOptsConfigureStatus.Help) Environment.Exit(1); omegaOpts.UpdateValues(opts); OEMacrocycleOmega mcomega = new OEMacrocycleOmega(omegaOpts); oemolistream ifs = new oemolistream(); if(!ifs.open(opts.GetInFile())) OEChem.OEThrow.Fatal("Unable to open " + opts.GetInFile() + " for reading"); oemolostream ofs = new oemolostream(); if(!ofs.open(opts.GetOutFile())) OEChem.OEThrow.Fatal("Unable to open " + opts.GetOutFile() + " for writing"); OEMol mol = new OEMol(); while (OEChem.OEReadMolecule(ifs, mol)) { OEChem.OEThrow.Info(mol.GetTitle()); uint retCode = mcomega.Build(mol); if(retCode == OEOmegaReturnCode.Success) OEChem.OEWriteMolecule(ofs, mol); else OEChem.OEThrow.Warning(mol.GetTitle() + ": failed with error " + retCode); } } }