-
Notifications
You must be signed in to change notification settings - Fork 128
#1256 - Inability to save a structure with R-Group in the SDF file format #3763
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
Changes from 11 commits
c664b73
f7e8a14
d77d18e
e689983
7132642
a505a94
728c7c7
22bdad7
fc02cac
8df7810
a44e5ea
42df4a7
aefff60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -304,6 +304,17 @@ def cml(self): | |
|
|
||
| return IndigoLib.checkResultString(self._lib().indigoCml(self.id)) | ||
|
|
||
| def fragmentedSdf(self): | ||
| """Structure method returns the structure as a string in SDF format, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocker: Let's either add comment in all wrappers or take it off from all places.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is depended from file. indigo_object.py has comments in this style. |
||
| splitting it into fragments. | ||
|
|
||
| Returns: | ||
| str: SDF string | ||
| """ | ||
| return IndigoLib.checkResultString( | ||
| self._lib().indigoFragmentedSdf(self.id) | ||
| ) | ||
|
|
||
| def saveCdxml(self, filename): | ||
| """Molecule method saves the structure into a CDXML file | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| *** KET to SDF *** | ||
| 1256-ketR20-from2815.sdf:SUCCEED | ||
| 1256-salt-attached-rgroup.sdf:SUCCEED | ||
| 1256-standard-plus-two-independent.sdf:SUCCEED | ||
| 1256-two-independent-rgroups.sdf:SUCCEED | ||
| 1256-reaction-one-independent-rgroup.sdf:SUCCEED | ||
| 1256-reaction-two-independent-rgroups.sdf:SUCCEED |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import os | ||
| import sys | ||
|
|
||
| sys.path.append( | ||
| os.path.normpath( | ||
| os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") | ||
| ) | ||
| ) | ||
| from common.util import compare_diff | ||
| from env_indigo import * # noqa | ||
|
|
||
| indigo = Indigo() | ||
| indigo.setOption("json-saving-pretty", True) | ||
| indigo.setOption("molfile-saving-skip-date", True) | ||
| indigo.setOption("ignore-stereochemistry-errors", True) | ||
|
|
||
| print("*** KET to SDF ***") | ||
|
|
||
| root = joinPathPy("molecules/", __file__) | ||
| ref_path = joinPathPy("ref/", __file__) | ||
|
|
||
| files = [ | ||
|
NikolaiBalabanov marked this conversation as resolved.
|
||
| "1256-ketR20-from2815", | ||
| "1256-salt-attached-rgroup", | ||
| "1256-two-independent-rgroups", | ||
| "1256-standard-plus-two-independent", | ||
| ] | ||
|
|
||
| files.sort() | ||
| for filename in files: | ||
| try: | ||
| ket = indigo.loadMoleculeFromFile( | ||
| os.path.join(root, filename + ".ket") | ||
| ) | ||
| except IndigoException: | ||
| ket = indigo.loadQueryMoleculeFromFile( | ||
| os.path.join(root, filename + ".ket") | ||
| ) | ||
|
|
||
| sdf = ket.fragmentedSdf() | ||
| compare_diff(ref_path, filename + ".sdf", sdf) | ||
|
|
||
| root = joinPathPy("reactions/", __file__) | ||
| ref_path = joinPathPy("ref/", __file__) | ||
|
|
||
| files = [ | ||
| "1256-reaction-one-independent-rgroup", | ||
| "1256-reaction-two-independent-rgroups", | ||
| ] | ||
|
|
||
| files.sort() | ||
| for filename in files: | ||
| try: | ||
| ket = indigo.loadReactionFromFile( | ||
| os.path.join(root, filename + ".ket") | ||
| ) | ||
| except IndigoException: | ||
| ket = indigo.loadQueryReactionFromFile( | ||
| os.path.join(root, filename + ".ket") | ||
| ) | ||
|
|
||
| sdf = ket.fragmentedSdf() | ||
| compare_diff(ref_path, filename + ".sdf", sdf) | ||
Uh oh!
There was an error while loading. Please reload this page.