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

Fix _smilesAtomOutputOrder parsing for RDKit 2024.03.6 or newer (Issue #7749) #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ricrogz
Copy link

@ricrogz ricrogz commented Oct 30, 2024

Fixes #65

RDKit's rdkit/rdkit#7749 fixed an issue with the formatting of _smilesAtomOutputOrder: before this bugfix, the code added an extra comma at the end of the list of atom indexes, which required some custom parsing code such as the one in get_atom_order_in_smiles().

Once that patch was merged, the parsing code broke, as it expects the comma to be there.

After the patch, _smilesAtomOutputOrder can be parsed as json, or using ast.literal_eval(), which is what I'm adding here. For backwards compatibility with RDKit builds that do not include that patch, I added a couple of lines that remove the extra comma before using ast.literal_eval() to parse the list.

@ricrogz
Copy link
Author

ricrogz commented Oct 30, 2024

Please note the only real changes here are in get_atom_order_in_smiles(). The rest are just changes due to format on save.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mmpdb fragment fails with RDKit 2024.03.6 or newer
1 participant