On 27/04/2013 13:58, Noel O'Boyle wrote: > I'm trying to turn the confab executable into an op as I would prefer > not to maintain the executable. > > Essentially, the op generates conformers for each input molecule, and > then it writes them to the output stream. > > The only problem is that OBConversion then calls the normal output > writer and writes the original input to the output. Is there any way > around this? Ideally, I'd like to completely skip the output writer. > > Please find attached my code (which relies on additional API functions > to actually generate the conformers).
>Or maybe I'm trying to fit a square peg into a round hole, and I >should just go with my existing (and working) executable... I think this well worth doing. There have been issues with multiple molecule outputs from ops previously, but I can't remember the details, so the following may not work. Approach 1 Suppress the output of the original molecules by returning false from Do(). Output a newly generated conformer molecule with pConv->AddChemObject(pmol). Approach 2 Add the conformers to the original molecule, output normally with the existing option writeconformers. (That this option is not an op bodes ill.) I'll try to write a mock-up of a model op with multiple outputs to remind myself of the issues, but which could be generally useful if they are resolved. Chris ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel