jchempaint icon indicating copy to clipboard operation
jchempaint copied to clipboard

CDKException with manual input of SMILES of a salt

Open rwst opened this issue 13 years ago • 1 comments

https://sourceforge.net/apps/trac/jchempaint/ticket/113

However, the same [NH4+].CP(=O)(O)CCC(N)C(=O)[O-] in a MOL file is displayed as usual.

This is NOT considered a CDK problem and should be fixed in JCP.

rwst avatar May 25 '12 17:05 rwst

From: Egon Willighagen [email protected] Date: Fri, 9 Nov 2012 11:34:18 +0100 Message-ID: CAMPqvY8PZ0P4UuH8bcfjbU-2i+iQ-Gc6ddKyaGTAAGrta5Hwaw@mail.gmail.com To: Joos Kiener [email protected] Cc: "[email protected]" [email protected] Subject: Re: [Cdk-user] layout disconnected structures in 1 AtomContainer

Hi Joos,

On Fri, Nov 9, 2012 at 11:19 AM, Joos Kiener [email protected] wrote:

The issue is to create and sdf file were all the disconnected structures are nicely displayed. Running StructureDiagrammGenerator only works for connected structures and GeometryTools also don't seem to offer a out of the box solution.

Is there any tool in cdk that can do this?

The ConnectivityTool can be used to split disconnected structures into a list of "molecules".

Because some discussion in the bug tracker came up around this too, let's set some definitions. A 'molecule' is a chemical graph, where each atom can be reached from another atom via one or more bonds. A salt is a disconnected structure, consisting of two or more 'molecules'.

The SDG tool in the CDK is an algorithm to layout 'molecules', and thus fails on salts. That is not a bug, just a limitation of the algorithm.

To work around this, you can split up the structure first, then do SDG on each molecule.

Now, to combine that again, you need to do some tricks, one of which is to decide how you would put them in one diagram. For example as a table of structures. We used to have code for that in the CDK, and I used that in the past to lay out multiple reactions.

That said, I love an algorithm in the CDK to lay out salts... if we introduce a dative bond concept in 'master', then the current SDG algorithm may actually work. We do not have such a bond right now, and it will require code updated all over the place, but I'm happy to see that. Then, we'd only need an algorithm to take a 'salt' and connect positive atoms with negative atoms... (there may be multiple charges, etc...)

OK, let me update the atom type perception in master first, and then I will try to look at the dative bond idea.

Egon

rwst avatar Nov 12 '12 08:11 rwst