openbabel / openbabel/openbabel

Incorrect bond type written for aromatic bonds in MDL SDF files

Open
#3,000 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.4k
Forks
488
Avg merge
6d 1h
Merged PRs (30d)
1

Description

Environment Information

Open Babel version: 3.1.0
Operating system and version: MacOS 26.4.1

Expected Behavior

Aromatic bonds should be written with bond type 4, as defined by the CTF format specification.
https://www.daylight.com/meetings/mug05/Kappler/ctfile.pdf

Actual Behavior

Aromatic bonds are written with bond type 5.

Steps to Reproduce

If we try to convert valid .hin file with explicit aromatic bonds

obabel -ihin test.hin -osdf

We get incorrect .sdf file with bond types 5 instead of 4

test.hin:

mol 1 ""
atom 1 - C   **  -  0.00041 -2.02520   0.08170  -1.43130 4 2 s 16 s 17 s 18 s 
atom 2 - N   **  - -0.31305 -0.59160   0.03810  -1.25400 3 1 s 3 s 19 s 
atom 3 - C   **  -  0.26580  0.00000   0.00000   0.00000 3 2 s 4 d 5 s
atom 4 - O   **  - -0.26841 -0.63540   0.00000   1.05240 1 3 d
atom 5 - C   **  -  0.16730  1.45700   0.00000  -0.00000 3 3 s 6 a 14 a
atom 6 - N   **  - -0.24466  2.06180  -0.00000  -1.21050 2 5 a 7 a
atom 7 - C   **  -  0.05459  3.42170  -0.00630  -1.27630 3 6 a 8 a 20 s
atom 8 - C   **  -  0.09253  4.24880  -0.00120  -0.15090 3 7 a 9 a 13 a
atom 9 - N   **  - -0.25334  5.59930   0.01840  -0.23730 2 8 a 10 a
atom 10 - C   **  -  0.02833  6.32380   0.02090   0.90390 3 9 a 11 a 21 s
atom 11 - C   **  - -0.04288  5.77150   0.00830   2.16650 3 10 a 12 a 22 s
atom 12 - C   **  - -0.04751  4.38780  -0.00460   2.25710 3 11 a 13 a 23 s
atom 13 - C   **  -  0.04556  3.60070  -0.00600   1.09670 3 8 a 12 a 14 a
atom 14 - C   **  -  0.15640  2.20180  -0.00900   1.17270 3 5 a 13 a 15 s
atom 15 - O   **  - -0.50383  1.58450  -0.02990   2.40220 2 14 s 24 s
atom 16 - H   **  -  0.04260 -2.52270  -0.51060  -0.65900 1 1 s
atom 17 - H   **  -  0.04260 -2.26580  -0.31450  -2.42050 1 1 s
atom 18 - H   **  -  0.04260 -2.35050   1.12280  -1.36040 1 1 s
atom 19 - H   **  -  0.14873 -0.02080   0.10830  -2.08910 1 2 s
atom 20 - H   **  -  0.08515  3.83270  -0.00470  -2.28050 1 7 s
atom 21 - H   **  -  0.08296  7.39990   0.03380   0.76630 1 10 s
atom 22 - H   **  -  0.06328  6.39260   0.01080   3.05410 1 11 s
atom 23 - H   **  -  0.06257  3.92510  -0.01060   3.24160 1 12 s
atom 24 - H   **  -  0.29226  2.25830  -0.03340   3.10160 1 15 s
endmol 1

output:

test.hin
 OpenBabel07242613313D

 24 25  0  0  1  0  0  0  0  0999 V2000
   -2.0252    0.0817   -1.4313 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.5916    0.0381   -1.2540 N   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6354    0.0000    1.0524 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.4570    0.0000   -0.0000 C   0  0  2  0  0  0  0  0  0  0  0  0
    2.0618   -0.0000   -1.2105 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.4217   -0.0063   -1.2763 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.2488   -0.0012   -0.1509 C   0  0  1  0  0  0  0  0  0  0  0  0
    5.5993    0.0184   -0.2373 N   0  0  0  0  0  0  0  0  0  0  0  0
    6.3238    0.0209    0.9039 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.7715    0.0083    2.1665 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.3878   -0.0046    2.2571 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.6007   -0.0060    1.0967 C   0  0  1  0  0  0  0  0  0  0  0  0
    2.2018   -0.0090    1.1727 C   0  0  2  0  0  0  0  0  0  0  0  0
    1.5845   -0.0299    2.4022 O   0  0  0  0  0  0  0  0  0  0  0  0
   -2.5227   -0.5106   -0.6590 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.2658   -0.3145   -2.4205 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.3505    1.1228   -1.3604 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0208    0.1083   -2.0891 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.8327   -0.0047   -2.2805 H   0  0  0  0  0  0  0  0  0  0  0  0
    7.3999    0.0338    0.7663 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.3926    0.0108    3.0541 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.9251   -0.0106    3.2416 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.2583   -0.0334    3.1016 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  1 16  1  0  0  0  0
  1 17  1  0  0  0  0
  1 18  1  0  0  0  0
  2  3  1  0  0  0  0
  2 19  1  0  0  0  0
  3  4  2  0  0  0  0
  5  3  1  6  0  0  0
  5  6  5  0  0  0  0
  5 14  5  0  0  0  0
  6  7  5  0  0  0  0
  7 20  1  0  0  0  0
  8  7  5  6  0  0  0
  8  9  5  0  0  0  0
  8 13  5  0  0  0  0
  9 10  5  0  0  0  0
 10 11  5  0  0  0  0
 10 21  1  0  0  0  0
 11 12  5  0  0  0  0
 11 22  1  0  0  0  0
 12 23  1  0  0  0  0
 13 12  5  1  0  0  0
 13 14  5  0  0  0  0
 14 15  1  6  0  0  0
 15 24  1  0  0  0  0
M  END
$$$$

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running obabel -ihin test.hin -osdf with the issue's test.hin input and compare the aromatic bond records in the generated SDF with the cited CTfile specification. Trace the SDF output path from this conversion and verify that aromatic bonds are emitted with bond type 4 rather than 5; done means the reproduced output and a regression check show the corrected type.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.