cdk / depict

SMILES Depiction Generator
GNU Lesser General Public License v2.1
54 stars 14 forks source link

bug in atom placement on for image render - specific smiles #65

Open Mblakey opened 1 year ago

Mblakey commented 1 year ago

smiles: N1C2C(=S3c4c1ccc(c4)N=Cc1ccc(SO3)cc1)C=CC=C2 smiles: c12cc3C4c5cc6ccccc6cc5C(c3cc1cccc2)Oc1ccc(cc1)O4

The sulphur here should be bonded to the benzene, other drawers confirm this smiles is correct! (although if its not, please school me!)

#1 #1 (1)

johnmay commented 1 year ago

No the SMILES is correct but it's when you get a macrocycle there is currently no conflict resolution - in fact there is no pretty option - so it just gives up. The molecule is connected properly you just get things laid on top of each other.

You can see ChemDraw also gives up but falls back to a force directed layout:

Screenshot 2023-05-07 at 07 47 59

I can see a possible tweak to the first one in the cleanup stage, the second one just needs to be 3D probably...