-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
b9b9386
commit 4909444
Showing
11 changed files
with
293 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*** 2713 star atom support *** | ||
star_atom ket : SUCCEED | ||
star_atom scxmiles : SUCCEED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import difflib | ||
import os | ||
import sys | ||
|
||
|
||
def find_diff(a, b): | ||
return "\n".join(difflib.unified_diff(a.splitlines(), b.splitlines())) | ||
|
||
|
||
sys.path.append( | ||
os.path.normpath( | ||
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") | ||
) | ||
) | ||
from env_indigo import Indigo, joinPathPy # noqa | ||
|
||
indigo = Indigo() | ||
indigo.setOption("json-saving-pretty", True) | ||
indigo.setOption("ignore-stereochemistry-errors", True) | ||
indigo.setOption("molfile-saving-skip-date", True) | ||
|
||
print("*** 2713 star atom support ***") | ||
|
||
root = joinPathPy("molecules/", __file__) | ||
ref_path = joinPathPy("ref/", __file__) | ||
|
||
filename = "star_atom" | ||
expected_smiles = "*C.*N.*O |$;;AH_p;;star_e;$|" | ||
|
||
mol = indigo.loadQueryMolecule(expected_smiles) | ||
|
||
# with open(os.path.join(ref_path, filename) + ".ket", "w") as file: | ||
# file.write(mol.json()) | ||
with open(os.path.join(ref_path, filename) + ".ket", "r") as file: | ||
ket_ref = file.read() | ||
ket = mol.json() | ||
diff = find_diff(ket_ref, ket) | ||
if not diff: | ||
print(filename + " ket : SUCCEED") | ||
else: | ||
print(filename + " ket : FAILED") | ||
print(diff) | ||
indigo.setOption("smiles-saving-format", "chemaxon") | ||
smiles3 = mol.smiles() | ||
diff = find_diff(smiles3, smiles3) | ||
if not diff: | ||
print(filename + " scxmiles : SUCCEED") | ||
else: | ||
print(filename + " scxmiles : FAILED") | ||
print(diff) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
168 changes: 84 additions & 84 deletions
168
api/tests/integration/tests/formats/ref/macro/sa-mono.cdxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,84 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE CDXML SYSTEM "http://www.cambridgesoft.com/xml/cdxml.dtd"> | ||
<CDXML BondLength="30.000000" LabelFont="3" CaptionFont="4"> | ||
<fonttable id="1"> | ||
<font id="2" charset="utf-8" name="Arial"/> | ||
<font id="3" charset="utf-8" name="Times New Roman"/> | ||
</fonttable> | ||
<colortable> | ||
<color r="1" g="1" b="1"/> | ||
<color r="0" g="0" b="0"/> | ||
<color r="1" g="0" b="0"/> | ||
<color r="1" g="1" b="0"/> | ||
<color r="0" g="1" b="0"/> | ||
<color r="0" g="1" b="1"/> | ||
<color r="0" g="0" b="1"/> | ||
<color r="1" g="0" b="1"/> | ||
<color r="0.5" g="0.5" b="0.5"/> | ||
</colortable> | ||
<page HeightPages="1" WidthPages="1" BoundingBox="439.795471 354.751007 503.250000 232.500000"> | ||
<fragment id="4"> | ||
<n id="29" NodeType="Fragment"> | ||
<fragment id="31"> | ||
<n id="16" Element="8" NumHydrogens="1" p="111.163788 -6.171985"> | ||
<t p="111.163788 -6.171985" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">OH</s> | ||
</t> | ||
</n> | ||
<n id="32" NodeType="ExternalConnectionPoint"/> | ||
<b id="34" B="32" E="16"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>OH</s> | ||
</t> | ||
</n> | ||
<n id="30" NodeType="Fragment" BondOrdering="37 33"> | ||
<fragment id="35" ConnectionOrder="36 38"> | ||
<n id="11" Element="7" NumHydrogens="1" p="34.038506 9.188833"> | ||
<t p="34.038506 9.188833" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">NH</s> | ||
</t> | ||
</n> | ||
<n id="36" NodeType="ExternalConnectionPoint"/> | ||
<n id="12" p="57.078609 -6.171985" Geometry="Tetrahedral" BondOrdering="11 13 14 5" EnhancedStereoType="Absolute"/> | ||
<n id="13" p="56.180820 -40.770763"/> | ||
<n id="14" p="88.121399 9.188833"/> | ||
<n id="38" NodeType="ExternalConnectionPoint"/> | ||
<n id="15" Element="8" NumHydrogens="0" p="88.838654 36.853783"> | ||
<t p="88.838654 36.853783" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">O</s> | ||
</t> | ||
</n> | ||
<b id="23" B="12" E="11"/> | ||
<b id="24" B="12" E="13" Display="WedgeBegin"/> | ||
<b id="25" B="12" E="14"/> | ||
<b id="26" B="14" E="15" Order="2"/> | ||
<b id="39" B="36" E="11"/> | ||
<b id="40" B="38" E="14"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>A</s> | ||
</t> | ||
</n> | ||
<n id="5" p="0.000000 77.252228"/> | ||
<n id="6" p="51.909027 77.237663"/> | ||
<n id="7" p="26.003637 62.248993"/> | ||
<n id="8" p="51.909027 107.265961"/> | ||
<n id="9" p="0.000000 107.400597"/> | ||
<n id="10" p="26.069155 122.250992"/> | ||
<b id="17" B="7" E="5" Order="2"/> | ||
<b id="18" B="5" E="9"/> | ||
<b id="19" B="9" E="10" Order="2"/> | ||
<b id="20" B="10" E="8"/> | ||
<b id="21" B="8" E="6" Order="2"/> | ||
<b id="22" B="6" E="7"/> | ||
<b id="33" B="30" E="29"/> | ||
<b id="37" B="7" E="30"/> | ||
<graphic BoundingBox="51.909027 62.248993 51.909027 62.248993" GraphicType="Symbol" SymbolType="Absolute" FrameType="None"> | ||
<t p="51.909027 62.248993" Justification="Center" InterpretChemically="no"> | ||
<s font="3" size="10" face="96">Chiral</s> | ||
</t> | ||
</graphic> | ||
</fragment> | ||
</page> | ||
</CDXML> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE CDXML SYSTEM "http://www.cambridgesoft.com/xml/cdxml.dtd"> | ||
<CDXML BondLength="30.000000" LabelFont="3" CaptionFont="4"> | ||
<fonttable id="1"> | ||
<font id="2" charset="utf-8" name="Arial"/> | ||
<font id="3" charset="utf-8" name="Times New Roman"/> | ||
</fonttable> | ||
<colortable> | ||
<color r="1" g="1" b="1"/> | ||
<color r="0" g="0" b="0"/> | ||
<color r="1" g="0" b="0"/> | ||
<color r="1" g="1" b="0"/> | ||
<color r="0" g="1" b="0"/> | ||
<color r="0" g="1" b="1"/> | ||
<color r="0" g="0" b="1"/> | ||
<color r="1" g="0" b="1"/> | ||
<color r="0.5" g="0.5" b="0.5"/> | ||
</colortable> | ||
<page HeightPages="1" WidthPages="1" BoundingBox="439.795471 354.751007 503.250000 232.500000"> | ||
<fragment id="4"> | ||
<n id="29" NodeType="Fragment"> | ||
<fragment id="31"> | ||
<n id="16" Element="8" NumHydrogens="1" p="111.163788 -6.171985"> | ||
<t p="111.163788 -6.171985" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">OH</s> | ||
</t> | ||
</n> | ||
<n id="32" NodeType="ExternalConnectionPoint"/> | ||
<b id="34" B="32" E="16"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>OH</s> | ||
</t> | ||
</n> | ||
<n id="30" NodeType="Fragment" BondOrdering="37 33"> | ||
<fragment id="35" ConnectionOrder="36 38"> | ||
<n id="11" Element="7" NumHydrogens="1" p="34.038506 9.188833"> | ||
<t p="34.038506 9.188833" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">NH</s> | ||
</t> | ||
</n> | ||
<n id="36" NodeType="ExternalConnectionPoint"/> | ||
<n id="12" p="57.078609 -6.171985" Geometry="Tetrahedral" BondOrdering="11 13 14 5" EnhancedStereoType="Absolute"/> | ||
<n id="13" p="56.180820 -40.770763"/> | ||
<n id="14" p="88.121399 9.188833"/> | ||
<n id="38" NodeType="ExternalConnectionPoint"/> | ||
<n id="15" Element="8" NumHydrogens="0" p="88.838654 36.853783"> | ||
<t p="88.838654 36.853783" LabelJustification="Left"> | ||
<s font="3" size="10" face="96">O</s> | ||
</t> | ||
</n> | ||
<b id="23" B="12" E="11"/> | ||
<b id="24" B="12" E="13" Display="WedgeBegin"/> | ||
<b id="25" B="12" E="14"/> | ||
<b id="26" B="14" E="15" Order="2"/> | ||
<b id="39" B="36" E="11"/> | ||
<b id="40" B="38" E="14"/> | ||
</fragment> | ||
<t LabelJustification="Left" LabelAlignment="Above"> | ||
<s>A</s> | ||
</t> | ||
</n> | ||
<n id="5" p="0.000000 77.252228"/> | ||
<n id="6" p="51.909027 77.237663"/> | ||
<n id="7" p="26.003637 62.248993"/> | ||
<n id="8" p="51.909027 107.265961"/> | ||
<n id="9" p="0.000000 107.400597"/> | ||
<n id="10" p="26.069155 122.250992"/> | ||
<b id="17" B="7" E="5" Order="2"/> | ||
<b id="18" B="5" E="9"/> | ||
<b id="19" B="9" E="10" Order="2"/> | ||
<b id="20" B="10" E="8"/> | ||
<b id="21" B="8" E="6" Order="2"/> | ||
<b id="22" B="6" E="7"/> | ||
<b id="33" B="30" E="29"/> | ||
<b id="37" B="7" E="30"/> | ||
<graphic BoundingBox="51.909027 62.248993 51.909027 62.248993" GraphicType="Symbol" SymbolType="Absolute" FrameType="None"> | ||
<t p="51.909027 62.248993" Justification="Center" InterpretChemically="no"> | ||
<s font="3" size="10" face="96">Chiral</s> | ||
</t> | ||
</graphic> | ||
</fragment> | ||
</page> | ||
</CDXML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"root": { | ||
"nodes": [ | ||
{ | ||
"$ref": "mol0" | ||
}, | ||
{ | ||
"$ref": "mol1" | ||
}, | ||
{ | ||
"$ref": "mol2" | ||
} | ||
] | ||
}, | ||
"mol0": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "A", | ||
"location": [ | ||
0.0, | ||
0.0, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
1.0, | ||
0.0, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
} | ||
] | ||
}, | ||
"mol1": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "AH", | ||
"location": [ | ||
3.0, | ||
0.0, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "N", | ||
"location": [ | ||
4.0, | ||
0.0, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
} | ||
] | ||
}, | ||
"mol2": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "*", | ||
"alias": "*", | ||
"location": [ | ||
0.0, | ||
2.0, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "O", | ||
"location": [ | ||
1.0, | ||
2.0, | ||
0.0 | ||
] | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
1 | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.