Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1994 - Micro and macro structures connected through attachment points cannot be opened after save in CDX and Base 64CDX format in micro mode #2024

Merged
merged 22 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/tests/integration/ref/formats/cdx_export.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
enhanced_stereo1:success
enhanced_stereo2:success
enhanced_stereo3:success
macro/sa-mono:success
rgroup:success
stereo_either-0020:success
two_bn:success
Expand Down
3 changes: 2 additions & 1 deletion api/tests/integration/ref/formats/ket_to_cml.py.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*** KET to CML ***
1878-ket-to-cml.cml:SUCCEED
1878-ket-to-cml.cml:SUCCEED
macro/sa-mono.cml:SUCCEED
1 change: 1 addition & 0 deletions api/tests/integration/ref/formats/ket_to_mol.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ macro/modified/mod_rna_peptide.ket:SUCCEED
macro/peptide-rna/peptide-rna.ket:SUCCEED
macro/peptide-rna/peptide-rna-ac.ket:SUCCEED
macro/polyphosphate/polyphosphate_rna.ket:SUCCEED
macro/sa-mono.ket:SUCCEED
macro/terminators/terms_peptide.ket:SUCCEED
mon_long_id.ket:SUCCEED
pepchem.ket:SUCCEED
Expand Down
1 change: 1 addition & 0 deletions api/tests/integration/ref/formats/mol_to_smiles.py.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
C1%82(C%83O%84%85)OC%86(C(O%87%88%89)C(O%90%91)C%921O%93%94%95)O%96%97%98.[*:1]%96.[*:2]%93.[*:3]%84.[*:4]%90.[*:5]%87.[*:6]%94%85.[*:7]%95%97.[*:8]%83.[*:9]%91%88.[*:10]%89%98.[*:11]%86.[*:12]%92.[*:13]%82 |$;;;;;;;;;;;;_R1;_R2;_R3;_R4;_R5;_R6;_R7;_R8;_R9;_R10;_R11;_R12;_R13$|
[O-][N+](C1=NN=NN1CC1N=NNN=1)=O
C1C(O)=C(C2C=CC(C)=CC=2N)C(C)=CC=1 |o1:3,r,wU:3.12,(25.51,-10.61,;25.51,-12.12,;24.22,-12.87,;26.82,-12.86,;26.82,-14.36,;25.51,-15.12,;25.52,-16.62,;26.82,-17.36,;26.82,-18.86,;28.12,-16.61,;28.12,-15.11,;29.18,-14.05,;28.11,-12.11,;29.41,-12.86,;28.11,-10.61,;26.82,-9.86,)|
C1C=CC=CC=1*
24 changes: 12 additions & 12 deletions api/tests/integration/ref/formats/rxn_to_cdxml.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -730,16 +730,16 @@ CN_Bond-S-GRP.rxn
</fragment>
<fragment id="11">
<n id="31" NodeType="Fragment">
<fragment id="32">
<fragment id="33">
<n id="14" p="444.486023 159.261002"/>
<n id="33" NodeType="ExternalConnectionPoint"/>
<b id="35" B="33" E="14"/>
<n id="34" NodeType="ExternalConnectionPoint"/>
<b id="36" B="34" E="14"/>
</fragment>
<t LabelJustification="Left" LabelAlignment="Above">
<s>R2</s>
</t>
</n>
<n id="36" NodeType="Fragment">
<n id="32" NodeType="Fragment">
<fragment id="37">
<n id="12" p="413.790009 212.423996"/>
<n id="38" NodeType="ExternalConnectionPoint"/>
Expand All @@ -754,8 +754,8 @@ CN_Bond-S-GRP.rxn
<s font="3" size="10" face="96">NH</s>
</t>
</n>
<b id="34" B="13" E="31"/>
<b id="39" B="13" E="36"/>
<b id="35" B="13" E="31"/>
<b id="39" B="13" E="32"/>
</fragment>
<t p="198.396011 175.387482" Justification="Center" InterpretChemically="no">
<s font="3" size="10" face="96">+</s>
Expand Down Expand Up @@ -831,16 +831,16 @@ CN_Bond-S-GRP.rxn
</fragment>
<fragment id="11">
<n id="31" NodeType="Fragment">
<fragment id="32">
<fragment id="33">
<n id="14" p="444.486023 159.261002"/>
<n id="33" NodeType="ExternalConnectionPoint"/>
<b id="35" B="33" E="14"/>
<n id="34" NodeType="ExternalConnectionPoint"/>
<b id="36" B="34" E="14"/>
</fragment>
<t LabelJustification="Left" LabelAlignment="Above">
<s>R2</s>
</t>
</n>
<n id="36" NodeType="Fragment">
<n id="32" NodeType="Fragment">
<fragment id="37">
<n id="12" p="413.790009 212.423996"/>
<n id="38" NodeType="ExternalConnectionPoint"/>
Expand All @@ -855,8 +855,8 @@ CN_Bond-S-GRP.rxn
<s font="3" size="10" face="96">NH</s>
</t>
</n>
<b id="34" B="13" E="31"/>
<b id="39" B="13" E="36"/>
<b id="35" B="13" E="31"/>
<b id="39" B="13" E="32"/>
</fragment>
<t p="198.396011 175.387482" Justification="Center" InterpretChemically="no">
<s font="3" size="10" face="96">+</s>
Expand Down
3 changes: 2 additions & 1 deletion api/tests/integration/tests/formats/cdx_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def find_diff(a, b):
"enhanced_stereo3",
"two_bn",
"rgroup",
"macro/sa-mono",
]

ref_path = joinPathPy("ref/", __file__)
Expand Down Expand Up @@ -153,7 +154,7 @@ def test_file(filename, suffix=".mol"):
)
resb64 = rea.b64cdx()
# with open(os.path.join(ref_path, filename + ".b64cdx"), "w") as file:
# file.write(resb64)
# file.write(resb64)
with open(os.path.join(ref_path, filename + ".b64cdx"), "r") as file:
refb64 = file.read()
print(filename + (":success" if refb64 == resb64 else ":failed"))
Expand Down
7 changes: 5 additions & 2 deletions api/tests/integration/tests/formats/ket_to_cml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ def find_diff(a, b):
root = joinPathPy("molecules/", __file__)
ref_path = joinPathPy("ref/", __file__)

files = ["1878-ket-to-cml"]
files = ["1878-ket-to-cml", "macro/sa-mono"]

files.sort()
for filename in files:
ket = indigo.loadMoleculeFromFile(os.path.join(root, filename + ".ket"))

cml = ket.cml()
# with open(os.path.join(ref_path, filename) + ".cml", "w") as file:
# file.write(cml)

with open(os.path.join(ref_path, filename) + ".cml", "r") as file:
cml_ref = file.read()
cml = ket.cml()
diff = find_diff(cml_ref, cml)
if not diff:
print(filename + ".cml:SUCCEED")
Expand Down
1 change: 1 addition & 0 deletions api/tests/integration/tests/formats/ket_to_mol.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def find_diff(a, b):
"macro/peptide-rna/peptide-rna-ac",
"macro/polyphosphate/polyphosphate_rna",
"macro/terminators/terms_peptide",
"macro/sa-mono",
]

files.sort()
Expand Down
6 changes: 6 additions & 0 deletions api/tests/integration/tests/formats/mol_to_smiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@
joinPathPy("molecules/atropisomer.mol", __file__)
).smiles()
)

print(
indigo.loadMoleculeFromFile(
joinPathPy("molecules/macro/sa-mono.mol", __file__)
).smiles()
)
69 changes: 69 additions & 0 deletions api/tests/integration/tests/formats/molecules/macro/sa-mono.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

-INDIGO-06262408322D

0 0 0 0 0 0 0 0 0 0 0 V3000
M V30 BEGIN CTAB
M V30 COUNTS 7 7 1 0 0
M V30 BEGIN ATOM
M V30 1 C 14.6598 -10.3251 0.0 0
M V30 2 C 16.3902 -10.3246 0.0 0
M V30 3 C 15.5266 -9.82497 0.0 0
M V30 4 C 16.3902 -11.3255 0.0 0
M V30 5 C 14.6598 -11.33 0.0 0
M V30 6 C 15.5288 -11.825 0.0 0
M V30 7 A 16.775 -7.75 0.0 0 CLASS=AA SEQID=1 ATTCHORD=(2 3 Al)
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 2 3 1
M V30 2 1 1 5
M V30 3 2 5 6
M V30 4 1 6 4
M V30 5 2 4 2
M V30 6 1 2 3
M V30 7 1 3 7
M V30 END BOND
M V30 BEGIN SGROUP
M V30 1 SUP 1 ATOMS=(6 3 1 5 6 4 2) BRKXYZ=(9 0.000000 0.000000 0.000000 0.0-
M V30 00000 0.000000 0.000000 0.000000 0.000000 0.000000) BRKXYZ=(9 0.000000-
M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0000-
M V30 00) ESTATE=E SAP=(3 3 0 1)
M V30 END SGROUP
M V30 END CTAB
M V30 BEGIN TEMPLATE
M V30 TEMPLATE 1 AA/Ala/A/ NATREPLACE=AA/A
M V30 BEGIN CTAB
M V30 COUNTS 7 6 3 0 0
M V30 BEGIN ATOM
M V30 1 N -0.980533 -0.306295 0.0 0
M V30 2 C -0.212531 0.205733 0.0 0 CFG=1
M V30 3 C -0.242457 1.35903 0.0 0
M V30 4 C 0.822229 -0.306295 0.0 0
M V30 5 O 0.846139 -1.22846 0.0 0
M V30 6 O 1.59031 0.205733 0.0 0
M V30 7 H -1.82323 0.0707134 0.0 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 2 1
M V30 2 1 2 3 CFG=1
M V30 3 1 2 4
M V30 4 2 4 5
M V30 5 1 4 6
M V30 6 1 1 7
M V30 END BOND
M V30 BEGIN COLLECTION
M V30 MDLV30/STEABS ATOMS=(1 2)
M V30 END COLLECTION
M V30 BEGIN SGROUP
M V30 1 SUP 1 ATOMS=(1 7) XBONDS=(1 6) BRKXYZ=(9 0.421350 -0.188504 0.000000-
M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=-
M V30 LGRP
M V30 2 SUP 2 ATOMS=(1 6) XBONDS=(1 5) BRKXYZ=(9 -0.384040 -0.256014 0.00000-
M V30 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLAS-
M V30 S=LGRP
M V30 3 SUP 3 ATOMS=(5 1 2 3 4 5) XBONDS=(2 6 5) BRKXYZ=(9 -0.421350 0.18850-
M V30 4 0.000000 0.384040 0.256014 0.000000 0.000000 0.000000 0.000000) LABE-
M V30 L=A CLASS=AA SAP=(3 1 7 Al) SAP=(3 4 6 Br) NATREPLACE=AA/A
M V30 END SGROUP
M V30 END CTAB
M V30 END TEMPLATE
M END
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<bond atomRefs2="a2 a0" order="1"/>
</bondArray>
</molecule>
</cml>
</cml>
20 changes: 10 additions & 10 deletions api/tests/integration/tests/formats/ref/963-super.cdxml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<page HeightPages="1" WidthPages="1">
<fragment id="4">
<n id="48" NodeType="Fragment">
<fragment id="49">
<fragment id="51">
<n id="11" p="59.835632 109.329903"/>
<n id="50" NodeType="ExternalConnectionPoint"/>
<n id="52" NodeType="ExternalConnectionPoint"/>
<n id="12" Element="8" NumHydrogens="0" p="30.202303 104.643272">
<t p="30.202303 104.643272" LabelJustification="Left">
<s font="3" size="10" face="96">O</s>
Expand All @@ -42,20 +42,20 @@
<b id="37" B="14" E="15"/>
<b id="38" B="14" E="16"/>
<b id="39" B="14" E="17"/>
<b id="52" B="50" E="11"/>
<b id="54" B="52" E="11"/>
</fragment>
<t LabelJustification="Left" LabelAlignment="Above">
<s>CO2tBu</s>
</t>
</n>
<n id="53" NodeType="Fragment">
<fragment id="54">
<n id="49" NodeType="Fragment">
<fragment id="55">
<n id="18" Element="16" NumHydrogens="0" p="59.998569 229.331665">
<t p="59.998569 229.331665" LabelJustification="Left">
<s font="3" size="10" face="96">S</s>
</t>
</n>
<n id="55" NodeType="ExternalConnectionPoint"/>
<n id="56" NodeType="ExternalConnectionPoint"/>
<n id="19" p="60.107033 259.326599"/>
<n id="20" Element="8" NumHydrogens="0" p="30.000000 229.440125">
<t p="30.000000 229.440125" LabelJustification="Left">
Expand All @@ -70,13 +70,13 @@
<b id="41" B="19" E="18"/>
<b id="42" B="18" E="20" Order="2"/>
<b id="43" B="18" E="21" Order="2"/>
<b id="57" B="55" E="18"/>
<b id="58" B="56" E="18"/>
</fragment>
<t LabelJustification="Left" LabelAlignment="Above">
<s>Ms</s>
</t>
</n>
<n id="58" NodeType="Fragment">
<n id="50" NodeType="Fragment">
<fragment id="59">
<n id="22" Element="16" NumHydrogens="0" p="168.518234 145.330887">
<t p="168.518234 145.330887" LabelJustification="Left">
Expand Down Expand Up @@ -120,8 +120,8 @@
<b id="30" B="6" E="7"/>
<b id="31" B="9" E="10" Order="2"/>
<b id="32" B="10" E="8"/>
<b id="51" B="7" E="48"/>
<b id="56" B="10" E="53"/>
<b id="53" B="7" E="48"/>
<b id="57" B="10" E="49"/>
</fragment>
</page>
</CDXML>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading