partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Inconsistent with the expected results #243

Closed niuzhenjiang closed 2 years ago

niuzhenjiang commented 3 years ago

i use a mol file to generate structural formula,But I found it inconsistent with my expectations: in chemDraw.exe:What I expect is the following figure: image but in kekule.js: image

I want to show hyperatoms,plase help me ,thank you very much this is the mol file:

ChemScript 14.007302119313D

6 5 0 0 0 0 0 0 0 0999 V2000 -1.7862 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.0717 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.3572 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3572 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.0717 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.7862 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0
2 3 1 0
3 4 1 0
4 5 1 0
5 6 1 0
A 6 OMe M END

niuzhenjiang commented 2 years ago

mol.txt

this is the mol file

partridgejiang commented 2 years ago

Please note the last three lines of the source .mol file,

...
A 6
OMe
M END

The first line (A 6) is in a somewhat nonstandard dialect of ISISDraw. Many cheminformatics softwares (including Kekule.js) do not fully support this dialect. Even in ChemDraw, when saving the molecule into a new .mol file, it will be converted into a more standard subgroup form:

...
mol.mol
  ChemDraw07312113122D

  7  6  0  0  0  0  0  0  0  0999 V2000
   -1.7863   -0.6187    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0718   -0.2063    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3573   -0.6187    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.3572   -0.2063    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.0717   -0.6187    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.7862   -0.2063    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.7863    0.6187    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  6  7  1  0      
  5  6  1  0      
  1  2  1  0      
  2  3  1  0      
  3  4  1  0      
  4  5  1  0      
M  STY  1   1 SUP
M  SLB  1   1   1
M  SAL   1  2   6   7
M  SBL   1  1   2
M  SMT   1 OMe
M  SBV   1   2   -0.7145   -0.4124
M  END

So, personal suggestion, it’s best to convert the nonstandard files before using them.

niuzhenjiang commented 2 years ago

I would like to ask if there is any way to use the code to convert it to the standard mol format.thanks