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: Add aromatic aluminium token #7428

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

Conversation

iwyoo
Copy link

@iwyoo iwyoo commented May 9, 2024

Reference Issue

Fixes #3697

What does this implement/fix? Explain your changes.

By Huckel's rule, rdkit sometimes converts [Al+] to [al+], but current rdkit cannot read [al because there is no lex rule for it.

Any other comments?

@greglandrum
Copy link
Member

greglandrum commented May 10, 2024

@iwyoo , thanks for the contribution.
I think a better fix for this would be to avoid generating the aromatic token for Al in the first place.
So the modification would be to SmilesWrite.cpp, around line 231, to make sure that it only changes the first letter in the atomic symbol to be aromatic if the atomic number is 5, 6, 7, 8, 14, 15, 16, 33, 34, or 52

Otherwise we'll constantly have to add new aromatic tokens, and that cause us to move further and and further away from what the old daylight documentation says: section 3.4.2 here https://daylight.com/dayhtml/doc/theory/theory.smiles.html

@iwyoo iwyoo force-pushed the aromatic-aluminium-token branch from bd2d560 to b087f24 Compare May 13, 2024 00:50
@iwyoo
Copy link
Author

iwyoo commented May 13, 2024

@greglandrum Thanks! I just deleted the previous changes and applied the correct revision to SmilesWrite.cpp you mentioned.

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the PR.

The one piece which is missing for this to be added is a test to demonstrate that the changes work (and make sure that if the behavior changes in the future we will detect it).

Please add the new test(s) to v2catch_tests.cpp in the SmilesParse directory; you can use the tests that are there or in catch_tests.cpp as a template for what the tests should look like.

Let me know if you have any questions.

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.

Lower case symbols in SMILES for bracket atoms in aromatic rings
2 participants