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

Add options for explicit hydrogen #58

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Conversation

Acylation
Copy link
Owner

Closes #56

Test cases

Check these cases with the config enabled/disabled to see the difference:

  • Chiral center related: N[C@@H](C)C(=O)O & N[C@H](C)C(=O)O
  • Explicit: [H][O]C(=O)C(C)=CC1=CC=CC=C1
  • Implicit: OC(=O)C(C)=CC1=CC=CC=C1

Explaination

The term explicit hydrogen is a little bit confusing. Here's a brief intro quoted from https://www.herongyang.com/Cheminformatics/SMILES-Hydrogen-Representations.html

How Hydrogens Are Represented in SMILES? - Hydrogen are represented according to the following rules:

  1. Explicitly as Atoms - A hydrogen can be represented by its atomic symbol in square brackets [H]. For example, [H][O][H] for water; [2H]O[2H] for heavy water; [H][H] for hydrogen molecule.
  2. Explicitly as Counts - When hydrogens are connected to an atom, which is represented in square brackets, those hydrogens must be represented a count in the form of [xHn]. For example, "[OH2]" is the same as "O([H])[H]"
  3. Implicitly - When hydrogens are connected to an atom, which is represented without square brackets, those hydrogens are implicitly represented according to normal valence assumptions. For example, "O" is the same as "O([H])[H]"

@Acylation Acylation added the category/enhancement Improvements on existing features label Feb 2, 2024
@Acylation Acylation merged commit 85a07c4 into main Feb 2, 2024
1 check passed
@Acylation Acylation deleted the config-explicit-hydrogen branch February 2, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/enhancement Improvements on existing features
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Please add an option to choose whether to display hydrogen used for chirality
1 participant