jsme-editor / jsme-editor.github.io

73 stars 19 forks source link

SMILES parsing Error: S-alkyl Dibenzothiophenium Issue #50

Open Rhodium-Complex opened 2 months ago

Rhodium-Complex commented 2 months ago

Hello,

I've encountered an issue in JSME(v2023-07-31) regarding the rendering of structures from SMILES notation. When attempting to draw S-alkyl dibenzothiophenium using the SMILES string c4ccc([s+]3c1ccccc1c2ccccc23)cc4, an error message ERROR: SMILES parsing error: Assignment of aromatic double bonds failed appears. This SMILES string was generated by JSME itself. I tried Paste MOL or SDF or SMILES and direct paste, but both were failed

SMILES String Result
c4ccc([s+]3c1ccccc1c2ccccc23)cc4 Error: Parsing failed
c4ccc([S+]3c1ccccc1c2ccccc23)cc4 Success (manually change into uppercase S)
c4ccc([o+]3c1ccccc1c2ccccc23)cc4 Success (o (aromatic O) is acceptable)

Thank you for looking into this issue.

chdominguez commented 1 month ago

Did you manage to fix this issue?

Rhodium-Complex commented 1 month ago

Hello Mr. chdominguez,

Thank you for reaching out. Unfortunately, the issue has not been resolved yet. The JavaScript involved is obfuscated, complicating the understanding of the program's behavior from the source code. I am not very familiar with JavaScript, and I am unsure about the next steps to take to resolve this issue. However, I have conducted some analysis using the Edge developer tools and noticed an interesting behavior in the file ./jsme/deferredjs/0ADE505A5718D4BE2E0EE1B7C54CC163/1.js. It appears that at around line 18, the code for c.b.s[15] takes on a significantly large value (263176) only when [s+] is used. It should likely be either 1032 or 2056.

Additionally, I have discovered that parsing also fails for the SMILES string c4ccc(p3c1ccccc1c2ccccc23)cc4, which might suggest that this issue could be common with elements from the third period onwards.

Best regards,