Skip to content

Commit

Permalink
#1183 Support monomer templates import from KET-format (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
even1024 authored Oct 17, 2023
1 parent 94bce83 commit eb6c27a
Show file tree
Hide file tree
Showing 16 changed files with 1,871 additions and 3 deletions.
6 changes: 6 additions & 0 deletions api/tests/integration/ref/formats/ket_to_mol.py.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
*** KET to MOL ***
chem.ket:SUCCEED
cysteine.ket:SUCCEED
dala.ket:SUCCEED
dcysteine.ket:SUCCEED
dthymine.ket:SUCCEED
suplabel.ket:SUCCEED
thymine.ket:SUCCEED
empty_apid.ket:SUCCEED
ket-reaction-arrow.ket:SUCCEED
13 changes: 12 additions & 1 deletion api/tests/integration/tests/formats/ket_to_mol.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@ def find_diff(a, b):
ref_path = joinPathPy("ref/", __file__)
root_rea = joinPathPy("reactions/", __file__)

files = ["suplabel"]
files = [
"suplabel",
"cysteine",
"dcysteine",
"thymine",
"dthymine",
"dala",
"chem",
]

files.sort()
for filename in files:
mol = indigo.loadMoleculeFromFile(os.path.join(root, filename + ".ket"))
# with open(os.path.join(ref_path, filename) + ".mol", "w") as file:
# file.write(mol.molfile())

with open(os.path.join(ref_path, filename) + ".mol", "r") as file:
ket_ref = file.read()
ket = mol.molfile()
Expand Down
183 changes: 183 additions & 0 deletions api/tests/integration/tests/formats/molecules/chem.ket
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"root": {
"nodes": [],
"templates": [
{
"$ref": "monomerTemplate-cch_3"
}
]
},
"monomerTemplate-cch_3": {
"type": "monomerTemplate",
"id": "cch_3",
"class": "Chem",
"classHELM": "CHEM",
"alias": "cch",
"attachmentPoints": [
{
"type": "right",
"label": "R2",
"attachmentAtom": 8,
"leavingGroup": {
"atoms": [
1
]
}
},
{
"type": "side",
"label": "R3",
"attachmentAtom": 6,
"leavingGroup": {
"atoms": [
2
]
}
},
{
"type": "side",
"label": "R5",
"attachmentAtom": 3,
"leavingGroup": {
"atoms": [
0
]
}
}
],
"atoms": [
{
"label": "H",
"location": [
9.201199531555176,
-7.158699989318848,
0.0
]
},
{
"label": "H",
"location": [
8.374699592590332,
-7.985400199890137,
0.0
]
},
{
"label": "O",
"location": [
10.02810001373291,
-7.985400199890137,
0.0
]
},
{
"label": "S",
"location": [
9.718199729919434,
-6.737199783325195,
0.0
]
},
{
"label": "C",
"location": [
9.194899559020996,
-7.6427001953125,
0.0
],
"stereoLabel": "abs"
},
{
"label": "O",
"location": [
9.698399543762207,
-8.580300331115723,
0.0
]
},
{
"label": "C",
"location": [
9.698399543762207,
-7.97629976272583,
0.0
]
},
{
"label": "C",
"location": [
9.194899559020996,
-7.03879976272583,
0.0
]
},
{
"label": "N",
"location": [
8.704099655151368,
-7.994699954986572,
0.0
]
}
],
"bonds": [
{
"type": 1,
"atoms": [
3,
0
]
},
{
"type": 1,
"atoms": [
6,
2
]
},
{
"type": 1,
"atoms": [
8,
1
]
},
{
"type": 2,
"atoms": [
6,
5
]
},
{
"type": 1,
"atoms": [
4,
7
],
"stereo": 1
},
{
"type": 1,
"atoms": [
7,
3
]
},
{
"type": 1,
"atoms": [
4,
6
]
},
{
"type": 1,
"atoms": [
8,
4
]
}
]
}
}
2 changes: 1 addition & 1 deletion api/tests/integration/tests/formats/molecules/chem.mol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ M V30 2 SUP 2 ATOMS=(1 3) XBONDS=(1 2) LABEL=OH CSTATE=(4 2 -0.825 0 0) -
M V30 CLASS=LGRP
M V30 3 SUP 3 ATOMS=(1 1) XBONDS=(1 1) LABEL=H CSTATE=(4 1 0 -0.8267 0) -
M V30 CLASS=LGRP
M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) LABEL=Cys CSTATE=(4 3 -
M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) LABEL=cch CSTATE=(4 3 -
M V30 -0.8265 0 0) CSTATE=(4 2 0.825 0 0) CSTATE=(4 1 0 0.8267 0) CLASS=AA -
M V30 SAP=(3 9 2 Br) SAP=(3 7 3 Cx) SAP=(3 4 1 Ex)
M V30 END SGROUP
Expand Down
Loading

0 comments on commit eb6c27a

Please sign in to comment.