Skip to content

Commit

Permalink
Backmerge: #2421 Incorrect stereo-label placement for (E) and (Z) (in…
Browse files Browse the repository at this point in the history
…digo part) (#2430)
  • Loading branch information
even1024 authored Sep 27, 2024
1 parent d71d854 commit ede947a
Show file tree
Hide file tree
Showing 14 changed files with 430 additions and 158 deletions.
3 changes: 2 additions & 1 deletion api/tests/integration/ref/basic/ketfile_stereo_desc.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ S-R diff.mol:SUCCEED
StereochemComplexTester_AllAbs.mol:SUCCEED
all-trans-inositol.mol:SUCCEED
atom_any.mol:SUCCEED
cip_bonds.mol:SUCCEED
cip_high_load.mol:SUCCEED
cis.mol:SUCCEED
different stereo 2.mol:SUCCEED
different stereo 3.mol:SUCCEED
different stereo 4.mol:SUCCEED
different stereo 5.mol:SUCCEED
different stereo.mol:SUCCEED
ketcher.mol:SUCCEED
stereo-different-ketcher-marvin.mol:SUCCEED
stereo-different-ketcher-marvin2.mol:SUCCEED
t4_R.mol:SUCCEED
Expand Down
282 changes: 162 additions & 120 deletions api/tests/integration/ref/basic/molfile_stereo_desc.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,168 @@ M V30 END SGROUP
M V30 END CTAB
M END

cip_bonds

-INDIGO-01000000002D

12 9 0 0 0 0 0 0 0 0999 V2000
5.1635 -5.5125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.0295 -6.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.8955 -5.5125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.7615 -6.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
11.0135 -5.6875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
11.8795 -6.1875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
12.7455 -5.6875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
13.6115 -6.1875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17.1885 -5.7875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
18.0545 -6.2875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
18.9205 -5.7875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
19.7865 -6.2875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 2 0 0 0 0
3 4 1 0 0 0 0
5 6 1 0 0 0 0
6 7 2 0 0 0 0
7 8 1 0 0 0 0
9 10 1 0 0 0 0
10 11 2 0 0 0 0
11 12 1 0 0 0 0
M STY 3 1 DAT 2 DAT 3 DAT
M SLB 3 1 1 2 2 3 3
M SAL 1 2 2 3
M SDT 1 INDIGO_CIP_DESC
M SDD 1 0.0000 0.0000 DR ALL 1 1
M SED 1 (E)
M SAL 2 2 6 7
M SDT 2 INDIGO_CIP_DESC
M SDD 2 0.0000 0.0000 DR ALL 1 1
M SED 2 (E)
M SAL 3 2 10 11
M SDT 3 INDIGO_CIP_DESC
M SDD 3 0.0000 0.0000 DR ALL 1 1
M SED 3 (E)
M END

cip_high_load

-INDIGO-01000000002D

0 0 0 0 0 0 0 0 0 0 0 V3000
M V30 BEGIN CTAB
M V30 COUNTS 36 35 15 0 0
M V30 BEGIN ATOM
M V30 1 C 7.8 -7.025 0.0 0
M V30 2 C 8.666 -7.525 0.0 0 CFG=1
M V30 3 C 9.5321 -7.025 0.0 0 CFG=2
M V30 4 C 10.3981 -7.525 0.0 0 CFG=1
M V30 5 C 11.2641 -7.025 0.0 0 CFG=2
M V30 6 C 12.1301 -7.525 0.0 0 CFG=2
M V30 7 C 12.9962 -8.025 0.0 0 CFG=1
M V30 8 C 13.8622 -7.525 0.0 0 CFG=2
M V30 9 C 14.7282 -8.025 0.0 0 CFG=1
M V30 10 C 15.5942 -7.525 0.0 0 CFG=2
M V30 11 C 16.4603 -8.025 0.0 0 CFG=2
M V30 12 C 17.3264 -8.525 0.0 0 CFG=1
M V30 13 C 18.1924 -8.025 0.0 0 CFG=2
M V30 14 C 19.0584 -8.525 0.0 0 CFG=1
M V30 15 C 19.9245 -8.025 0.0 0 CFG=2
M V30 16 C 20.7905 -8.525 0.0 0 CFG=2
M V30 17 C 8.666 -8.525 0.0 0
M V30 18 C 9.5321 -6.025 0.0 0
M V30 19 C 10.3981 -8.525 0.0 0
M V30 20 C 11.2641 -6.025 0.0 0
M V30 21 C 12.9962 -9.025 0.0 0
M V30 22 C 13.8622 -6.525 0.0 0
M V30 23 C 14.7282 -9.025 0.0 0
M V30 24 C 15.5942 -6.525 0.0 0
M V30 25 C 17.3264 -9.525 0.0 0
M V30 26 C 18.1924 -7.025 0.0 0
M V30 27 C 19.0584 -9.525 0.0 0
M V30 28 C 21.4976 -9.2321 0.0 0 CFG=1
M V30 29 C 22.4635 -8.9733 0.0 0 CFG=2
M V30 30 C 23.1706 -9.6804 0.0 0
M V30 31 C 19.9245 -7.025 0.0 0
M V30 32 C 22.7223 -8.0074 0.0 0
M V30 33 C 21.2388 -10.198 0.0 0
M V30 34 C 21.2905 -7.659 0.0 0
M V30 35 C 12.6301 -6.659 0.0 0
M V30 36 C 16.9603 -7.159 0.0 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 1 2
M V30 2 1 2 3
M V30 3 1 3 4
M V30 4 1 4 5
M V30 5 1 5 6
M V30 6 1 6 7
M V30 7 1 7 8
M V30 8 1 8 9
M V30 9 1 9 10
M V30 10 1 10 11
M V30 11 1 11 12
M V30 12 1 12 13
M V30 13 1 13 14
M V30 14 1 14 15
M V30 15 1 15 16
M V30 16 1 2 17 CFG=1
M V30 17 1 3 18 CFG=1
M V30 18 1 4 19 CFG=1
M V30 19 1 5 20 CFG=1
M V30 20 1 7 21 CFG=1
M V30 21 1 8 22 CFG=1
M V30 22 1 9 23 CFG=1
M V30 23 1 10 24 CFG=1
M V30 24 1 12 25 CFG=1
M V30 25 1 13 26 CFG=1
M V30 26 1 14 27 CFG=1
M V30 27 1 16 28
M V30 28 1 28 29
M V30 29 1 29 30
M V30 30 1 15 31 CFG=1
M V30 31 1 29 32 CFG=1
M V30 32 1 28 33 CFG=1
M V30 33 1 16 34 CFG=1
M V30 34 1 6 35 CFG=1
M V30 35 1 11 36 CFG=1
M V30 END BOND
M V30 BEGIN COLLECTION
M V30 MDLV30/STERAC1 ATOMS=(17 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 28 29)
M V30 END COLLECTION
M V30 BEGIN SGROUP
M V30 1 DAT 1 ATOMS=(1 3) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 2 DAT 2 ATOMS=(1 4) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 3 DAT 3 ATOMS=(1 5) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 4 DAT 4 ATOMS=(1 6) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 5 DAT 5 ATOMS=(1 7) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 6 DAT 6 ATOMS=(1 8) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 7 DAT 7 ATOMS=(1 9) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 8 DAT 8 ATOMS=(1 10) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 9 DAT 9 ATOMS=(1 11) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 10 DAT 10 ATOMS=(1 12) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 11 DAT 11 ATOMS=(1 13) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 12 DAT 12 ATOMS=(1 14) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 13 DAT 13 ATOMS=(1 15) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 14 DAT 14 ATOMS=(1 16) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 15 DAT 15 ATOMS=(1 28) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 END SGROUP
M V30 END CTAB
M END

cis

-INDIGO-01000000002D
Expand Down Expand Up @@ -1714,126 +1876,6 @@ M V30 END SGROUP
M V30 END CTAB
M END

ketcher

-INDIGO-01000000002D

0 0 0 0 0 0 0 0 0 0 0 V3000
M V30 BEGIN CTAB
M V30 COUNTS 36 35 15 0 0
M V30 BEGIN ATOM
M V30 1 C 7.8 -7.025 0.0 0
M V30 2 C 8.666 -7.525 0.0 0 CFG=1
M V30 3 C 9.5321 -7.025 0.0 0 CFG=2
M V30 4 C 10.3981 -7.525 0.0 0 CFG=1
M V30 5 C 11.2641 -7.025 0.0 0 CFG=2
M V30 6 C 12.1301 -7.525 0.0 0 CFG=2
M V30 7 C 12.9962 -8.025 0.0 0 CFG=1
M V30 8 C 13.8622 -7.525 0.0 0 CFG=2
M V30 9 C 14.7282 -8.025 0.0 0 CFG=1
M V30 10 C 15.5942 -7.525 0.0 0 CFG=2
M V30 11 C 16.4603 -8.025 0.0 0 CFG=2
M V30 12 C 17.3264 -8.525 0.0 0 CFG=1
M V30 13 C 18.1924 -8.025 0.0 0 CFG=2
M V30 14 C 19.0584 -8.525 0.0 0 CFG=1
M V30 15 C 19.9245 -8.025 0.0 0 CFG=2
M V30 16 C 20.7905 -8.525 0.0 0 CFG=2
M V30 17 C 8.666 -8.525 0.0 0
M V30 18 C 9.5321 -6.025 0.0 0
M V30 19 C 10.3981 -8.525 0.0 0
M V30 20 C 11.2641 -6.025 0.0 0
M V30 21 C 12.9962 -9.025 0.0 0
M V30 22 C 13.8622 -6.525 0.0 0
M V30 23 C 14.7282 -9.025 0.0 0
M V30 24 C 15.5942 -6.525 0.0 0
M V30 25 C 17.3264 -9.525 0.0 0
M V30 26 C 18.1924 -7.025 0.0 0
M V30 27 C 19.0584 -9.525 0.0 0
M V30 28 C 21.4976 -9.2321 0.0 0 CFG=1
M V30 29 C 22.4635 -8.9733 0.0 0 CFG=2
M V30 30 C 23.1706 -9.6804 0.0 0
M V30 31 C 19.9245 -7.025 0.0 0
M V30 32 C 22.7223 -8.0074 0.0 0
M V30 33 C 21.2388 -10.198 0.0 0
M V30 34 C 21.2905 -7.659 0.0 0
M V30 35 C 12.6301 -6.659 0.0 0
M V30 36 C 16.9603 -7.159 0.0 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 1 2
M V30 2 1 2 3
M V30 3 1 3 4
M V30 4 1 4 5
M V30 5 1 5 6
M V30 6 1 6 7
M V30 7 1 7 8
M V30 8 1 8 9
M V30 9 1 9 10
M V30 10 1 10 11
M V30 11 1 11 12
M V30 12 1 12 13
M V30 13 1 13 14
M V30 14 1 14 15
M V30 15 1 15 16
M V30 16 1 2 17 CFG=1
M V30 17 1 3 18 CFG=1
M V30 18 1 4 19 CFG=1
M V30 19 1 5 20 CFG=1
M V30 20 1 7 21 CFG=1
M V30 21 1 8 22 CFG=1
M V30 22 1 9 23 CFG=1
M V30 23 1 10 24 CFG=1
M V30 24 1 12 25 CFG=1
M V30 25 1 13 26 CFG=1
M V30 26 1 14 27 CFG=1
M V30 27 1 16 28
M V30 28 1 28 29
M V30 29 1 29 30
M V30 30 1 15 31 CFG=1
M V30 31 1 29 32 CFG=1
M V30 32 1 28 33 CFG=1
M V30 33 1 16 34 CFG=1
M V30 34 1 6 35 CFG=1
M V30 35 1 11 36 CFG=1
M V30 END BOND
M V30 BEGIN COLLECTION
M V30 MDLV30/STERAC1 ATOMS=(17 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 28 29)
M V30 END COLLECTION
M V30 BEGIN SGROUP
M V30 1 DAT 1 ATOMS=(1 3) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 2 DAT 2 ATOMS=(1 4) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 3 DAT 3 ATOMS=(1 5) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 4 DAT 4 ATOMS=(1 6) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 5 DAT 5 ATOMS=(1 7) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 6 DAT 6 ATOMS=(1 8) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 7 DAT 7 ATOMS=(1 9) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 8 DAT 8 ATOMS=(1 10) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 9 DAT 9 ATOMS=(1 11) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000 -
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 10 DAT 10 ATOMS=(1 12) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 11 DAT 11 ATOMS=(1 13) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 12 DAT 12 ATOMS=(1 14) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 13 DAT 13 ATOMS=(1 15) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 14 DAT 14 ATOMS=(1 16) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(S)"
M V30 15 DAT 15 ATOMS=(1 28) FIELDNAME=INDIGO_CIP_DESC FIELDDISP=" 0.0000-
M V30 0.0000 DR ALL 1 1 " FIELDDATA="(R)"
M V30 END SGROUP
M V30 END CTAB
M END

stereo-different-ketcher-marvin

-INDIGO-01000000002D
Expand Down
6 changes: 4 additions & 2 deletions api/tests/integration/tests/basic/ketfile_stereo_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ def stereo_desc_test(py_file, out_queue):
os.path.join(ref_path, filename[:-4] + ".ket"), __file__
)
mol = indigo.loadMoleculeFromFile(os.path.join(root, filename))
with open(ketfile, "r") as file:
ket_ref = file.read()
mol_json_no_cip = mol.json()
indigo.setOption("json-saving-add-stereo-desc", True)
mol_json_cip = mol.json()
# with open(ketfile, "w") as file:
# file.write(mol_json_cip)
with open(ketfile, "r") as file:
ket_ref = file.read()
diff = find_diff(ket_ref, mol_json_cip)
if not diff:
diff = find_diff(mol_json_no_cip, mol_json_cip)
Expand Down
26 changes: 26 additions & 0 deletions api/tests/integration/tests/basic/molecules/CIP/cip_bonds.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

Ketcher 92624 4412D 1 1.00000 0.00000 0

12 9 0 0 0 0 0 0 0 0999 V2000
5.1635 -5.5125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.0295 -6.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.8955 -5.5125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.7615 -6.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
11.0135 -5.6875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
11.8795 -6.1875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
12.7455 -5.6875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
13.6115 -6.1875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17.1885 -5.7875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
18.0545 -6.2875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
18.9205 -5.7875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
19.7865 -6.2875 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0
2 3 2 0 0 0
3 4 1 0 0 0
5 6 1 0 0 0
6 7 2 0 0 0
7 8 1 0 0 0
9 10 1 0 0 0
10 11 2 0 0 0
11 12 1 0 0 0
M END
Loading

0 comments on commit ede947a

Please sign in to comment.