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

Inconsistent serialization to mol format of undefined double bond stereochemisty depending on direction of adjacent wavy bond #7366

Open
rvianello opened this issue Apr 17, 2024 · 0 comments
Labels

Comments

@rvianello
Copy link
Contributor

rvianello commented Apr 17, 2024

Describe the bug
When a molecule is instantiated from an input mol block, double bonds with an adjacent wavy bond are interpreted as having an undefined/unknown stereochemical configuration (regardless the direction of the wavy bond and whether it originates from a nearby potential stereocenter or not). If wedging is re-applied and the molecule is serialized back to mol format, the wavy single bond is restored and the double bond is not assigned any explicit stereo type if the wavy bond begins from one the double bond ends, but is marked with an explicitly unknown stereo configuration if the wavy bond begins from the substituent.

To Reproduce

# CC=CF w/ wavy bond to F
mblock_a = '''
  MJ240100                      

  4  3  0  0  0  0  0  0  0  0999 V2000
   -8.5042    2.6558    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    2.2433    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -8.5042    3.4808    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    3.8933    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  2  1  1  0  0  0  0
  1  3  2  0  0  0  0
  3  4  1  4  0  0  0
M  END
'''
mol = Chem.MolFromMolBlock(mblock_a)
Chem.ReapplyMolBlockWedging(mol)
print(Chem.MolToMolBlock(mol))

outputs


     RDKit          2D

  4  3  0  0  0  0  0  0  0  0999 V2000
   -8.5042    2.6558    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    2.2433    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -8.5042    3.4808    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    3.8933    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  2  1  1  0
  1  3  2  0
  3  4  1  4
M  END

but

# CC=CF again, wavy bond going from F to C
mblock_b = '''
  MJ240100                      

  4  3  0  0  0  0  0  0  0  0999 V2000
   -8.5042    2.6558    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    2.2433    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -8.5042    3.4808    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    3.8933    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  2  1  1  0  0  0  0
  1  3  2  0  0  0  0
  4  3  1  4  0  0  0
M  END
'''
mol = Chem.MolFromMolBlock(mblock_b)
Chem.ReapplyMolBlockWedging(mol)
print(Chem.MolToMolBlock(mol))

outputs:


     RDKit          2D

  4  3  0  0  0  0  0  0  0  0999 V2000
   -8.5042    2.6558    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    2.2433    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -8.5042    3.4808    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -9.2187    3.8933    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  2  1  1  0
  1  3  2  3
  4  3  1  4
M  END

Expected behavior
The behavior on input makes sense to me, and I think the double bond shouldn't be tagged with an "either" stereo type in the output molblock if an adjacent wavy bond is present, independently from the direction of the wavy bond.

Configuration (please complete the following information):

  • RDKit version: current tip of the master branch
  • OS: Fedora 39
  • Python version (if relevant): 3.12 (probably not relevant)
  • Are you using conda? no
  • If you are not using conda: how did you install the RDKit? from source code
@rvianello rvianello added the bug label Apr 17, 2024
@rvianello rvianello changed the title Inconsistent serialization to mol format of undefined double bond stereochemisty depending on direction of incident wavy bond Inconsistent serialization to mol format of undefined double bond stereochemisty depending on direction of adjacent wavy bond Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant