IAtomContainer now accessible in Java Snippets (trunk)

Hi All

It is now possible to interact with a CDKCell IAtomContainer with a Java Snippet (like the RDKit implementation). 

Example workflow:

Java snippet:

Table output:

Let me know if you run into any issues.

Cheers

Sam

 

Known issue:

If you have another plugin that provides CDK then this may be put first on the classpath. As a result you can create your java snippet but when you got o execute you may get the following issue:

 

java.lang.RuntimeException: java.lang.RuntimeException: Could not find a converter factory for: CDK Molecule -> org.openscience.cdk.interfaces.IAtomContainer
    at org.knime.base.node.jsnippet.JavaSnippetCellFactory.getCells(JavaSnippetCellFactory.java:214)
    at org.knime.core.data.container.RearrangeColumnsTable.calcNewCellsForRow(RearrangeColumnsTable.java:503)
    at org.knime.core.data.container.RearrangeColumnsTable.calcNewColsSynchronously(RearrangeColumnsTable.java:424)
    at org.knime.core.data.container.RearrangeColumnsTable.create(RearrangeColumnsTable.java:342)
    at org.knime.core.node.ExecutionContext.createColumnRearrangeTable(ExecutionContext.java:371)
    at org.knime.base.node.jsnippet.JavaSnippet.execute(JavaSnippet.java:893)
    at org.knime.base.node.jsnippet.JavaSnippetNodeModel.execute(JavaSnippetNodeModel.java:139)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:732)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:566)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1128)
    at org.knime.core.node.Node.execute(Node.java:915)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.lang.RuntimeException: Could not find a converter factory for: CDK Molecule -> org.openscience.cdk.interfaces.IAtomContainer
    at org.knime.base.node.jsnippet.JavaSnippetCellFactory$DataCellProxy.getValueOfType(JavaSnippetCellFactory.java:411)
    at org.knime.base.node.jsnippet.JavaSnippetCellFactory.getCells(JavaSnippetCellFactory.java:193)

 

Known conflicting plugins:

  • ChesMapper
  • HCS Tools

If you uninstall these plugins the CDK Java Snippet functionality should work.

Cheers

Sam

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