Indigo Transform works in KNIME but not in Java or Python API Calls

I have a small KNIME workflow that performs a transformation on a molecule and it works well.  The small workflow is attached. I need to emulate the transformation in Java and am getting the error:  

Exception in thread "main" com.ggasoftware.indigo.IndigoException: pool: access to unused element 2

Depending on the reaction I load, I get a different unused element.  I have loaded in about 5 reactions that need to be run on all of the molecules but I can't even get the first one to work.  

 

What I have tried to do in my Java code is the following:

package indigoTest;

import com.ggasoftware.indigo.*;

public class IndigoTest {
	public static void main(String[] args) {
		Indigo indigo = new Indigo();
		// IndigoRenderer renderer = new IndigoRenderer(indigo);
		
		indigo.setOption("ignore-stereochemistry-errors", "True");
		indigo.setOption("treat-x-as-pseudoatom", "True");
		IndigoObject molecule = indigo.loadMolecule("CCCC[N](:O):O");
		IndigoObject reaction1 = indigo.loadReaction("[*][n](:o):o>>[O-][N+](=O)[*] |$_R1;;;;;;;_R1$|");
		IndigoObject reaction2 = indigo.loadQueryReaction(reaction1.smiles());
		
		// System.out.println("reaction1 is: " + reaction1.smiles());			
		// System.out.println("reaction2 is: " + reaction2.smiles());
		
		// indigo.setOption("render-output-format", "png");
		// indigo.setOption("render-margins", 10, 10);
		// indigo.setOption("render-comment", "rendered reaction");
		// renderer.renderToFile(reaction2, "rxn2.png");
		
		indigo.transform(reaction2, molecule);
		System.out.println("transform with molecule: " + molecule.smiles());
	}
}

 

I've loaded the code on a windows, linux, and mac machine and used two different versions of indigo (1.1.12 and 1.1.12dev) so there shouldn't be a versioning problem here.  I've got the workflow running on the same machines as the java code as well.  

I left some comments in there for debugging.  Uncomment everything if you want some print statements and a print-out of the final query reaction that I get and can be compared to the knime query reaction.  I attached the image produced from the query reaction.  

 

Note that the SMILES representation of the pictures shown in the outputs of each node can be viewed by right clicking the header of the column and selecting SMILES as the image renderer.

 

There doesn't appear to be much documentation for this issue in the API and I haven't been able to contact anyone at EPAMS (a.k.a. GGA Software) to answer this question.  

I simply need the reaction transformation to work with these queries.  

Good luck!

Best,

Christopher

 

 

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.