Hi everyone,
After that the interoperability between KNIME and Python has been announced starting from KNIME 4.7, I’ve started working with Python, RDKit and KNIME from KNIME AP.
I’m a beginner with this integration, so I apologise in advance if this problem is related to some basic notion that I lack.
I created a Conda environment including the python modules contained in the KNIME bundled python environment and I’ve added RDKit to it.
As you can see in the attached example workflow, if I perform any operation on a column containing molecules in RDKit type format using the Python Script node, the resulting molecules have problems and cannot be rendered with KNIME (see screenshot below). This is true even if I simply copy the input RDKit type column.
Oddingly, if I test this with KNIME 4.7, no error is reported (but the molecules are not rendered anyway), while if I run it with KNIME 5.1 the error reported below is triggered.
Am I missing something or is this a bug?
2023-08-22 10:53:46,440 : ERROR : AWT-EventQueue-0 : : RDKitAdapterCellValueFactory : Python Script : 3:2698 : Error when deserializing RDKitMolValue
java.io.IOException: Unable to interpret RDKit Molecule: Bad pickle format: ENDMOL tag not found.
at org.rdkit.knime.types.RDKitTypeSerializationUtils.deserializeMolCell2(RDKitTypeSerializationUtils.java:53)
at org.rdkit.knime.types.RDKitAdapterCellValueFactory$RDKitAdapterCellReadValue.getAdapterCell(RDKitAdapterCellValueFactory.java:119)
at org.knime.core.data.v2.value.AbstractAdapterCellValueFactory$AbstractAdapterCellReadValue.getDataCell(AbstractAdapterCellValueFactory.java:259)
at org.knime.core.data.columnar.table.ColumnarRowIterator.next(ColumnarRowIterator.java:171)
at org.knime.core.node.BufferedDataTable$CloseableFailProveRowIterator.next(BufferedDataTable.java:527)
at org.knime.core.node.tableview.TableContentModel.cacheNextRow(TableContentModel.java:1170)
at org.knime.core.util.ThreadUtils.getAsBooleanWithContext(ThreadUtils.java:651)
at org.knime.core.node.tableview.TableContentModel.cacheNextRowWithContext(TableContentModel.java:1154)
at org.knime.core.node.tableview.TableContentModel.getRow(TableContentModel.java:1129)
at org.knime.core.node.tableview.TableContentModel.isHiLit(TableContentModel.java:953)
at org.knime.core.node.tableview.TableRowHeaderModel.isHiLit(TableRowHeaderModel.java:292)
at org.knime.core.node.tableview.TableRowHeaderView.prepareRenderer(TableRowHeaderView.java:211)
at java.desktop/javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at java.desktop/javax.swing.plaf.ComponentUI.update(Unknown Source)
at java.desktop/javax.swing.JComponent.paintComponent(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JViewport.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/javax.swing.JLayeredPane.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
at java.desktop/javax.swing.JComponent.paintToOffscreen(Unknown Source)
at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(Unknown Source)
at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at java.desktop/javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at java.desktop/javax.swing.RepaintManager.paint(Unknown Source)
at java.desktop/javax.swing.JComponent.paint(Unknown Source)
at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at java.desktop/sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.desktop/java.awt.Container.paint(Unknown Source)
at java.desktop/java.awt.Window.paint(Unknown Source)
at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
python-rdkit_rendering_problem.knwf (40.6 KB)