Structure Sketcher


First of all, congratulations to the developper team for this wonderfull application.

However, I should like draw structure with the Structure Sketcher. I try from a long time ago to do this and follow the discussions but I've never seen someone with this problem. When I draw the structure, if I click on Apply or OK, I obtain then following messagebox : "Invalid Settings. Can't parse smiles representation: O=C2C1=C(N=CN1C)N(C(C=O)N2C)C

And in the Console tab:
WARN CDKCell Molecule could not be generated from "O=C2C1=C(N=CN1C)N(C(=O)N2C)C
": Unexpected character found:
WARN CDKCell Unexpected character found:
WARN CDKCell Molecule could not be generated from "O=C2C1=C(N=CN1C)N(C(=O)N2C)C
": Unexpected character found:
WARN CDKCell Unexpected character found:

The molecule used comes from the downloadable example.

Could you help me?

Thanks in advance.

Nobody else encountered this kind of error?

It would be helpful to know which version of KNIME and the sketcher you are using? (ChemAxon?) This is probably a version compatibility problem where a line-feed character is not being stripped which can be confirmed by using the simple molecule (eg ethane).

I use the version 1.3.3. of Knime upgraded using the Update Manager. The sketcher used is jChemPaint in the CDK node. I use Knime for Windows. Ethane don't work either.

Bummer! It seems no one of us has ever tested this node under Windows :shock: Under Linux it works perfectly well. The problem is, that there is a line break after the Smiles string that is generated in the dialog (comes out of the CDK/JChemPaint classes). This is removed under Linux but not (properly) under Windows. And the node itself cannot parse Smiles that have a line break at the end. Unfortunately there is nothing you can do about it, except either using Linux or waiting for the next KNIME release (no release date known yet) :(


Thanks for the answer. I will try with Linux then or see if I can change this by myself but I need to learn how to write the code. I've already tried but I don't know how to debug with breakpoints and so on. I don't know if it is possible. Thanks again.

The bug fix in the code is actually quite simple (tiny cause, huge effect). If you have the source for the CDK plugin at hand, you may have a look into the JMolSketcherPanel. It has a getSmiles() method where the molecule structure drawn in the panel is translated into a Smiles string. Up to version 1.3.3 only the trailing '\n' is deleted from the translated string, which leaves a '\r' under Windows (under Linux only really a '\n' is at the end). If you replace the three lines with a single line, where the Smiles string is trim()ed, this will solve the bug.