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

Converting atoms with high radical counts to InChI generates incorrect results #3365

Closed
greglandrum opened this issue Aug 26, 2020 · 0 comments
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Configuration:

  • RDKit Version: all, tested on 2020.03.5
  • Operating system: all

Description:

Here's the demo:

In [20]: m = Chem.MolFromSmiles('[C]')                                                                                                              

In [21]: m.Debug()                                                                                                                                  
Atoms:
	0 6 C chg: 0  deg: 0 exp: 0 imp: 0 hyb: 4 arom?: 0 chi: 0 rad: 4
Bonds:

In [22]: Chem.MolToInchi(m)                                                                                                                         
[08:58:18] WARNING: Radical center type replaced: 5->3
Out[22]: 'InChI=1S/CH2/h1H2'

Working directly from a mol block is fine:

In [23]: print(Chem.MolToMolBlock(m))                                                                                                               

     RDKit          2D

  1  0  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 C   0  0  0  0  0 15  0  0  0  0  0  0
M  END


In [24]: Chem.MolBlockToInchi(Chem.MolToMolBlock(m))                                                                                                
Out[24]: 'InChI=1S/C'

and we can parse the InChI correctly:

In [25]: nm = Chem.MolFromInchi(Chem.MolBlockToInchi(Chem.MolToMolBlock(m)))                                                                        

In [26]: nm.Debug()                                                                                                                                 
Atoms:
	0 6 C chg: 0  deg: 0 exp: 0 imp: 0 hyb: 4 arom?: 0 chi: 0 rad: 4
Bonds:

Thanks to @vfscalfani for noticing and reporting this.

@greglandrum greglandrum added this to the 2020_03_6 milestone Aug 26, 2020
greglandrum added a commit to greglandrum/rdkit that referenced this issue Aug 26, 2020
greglandrum added a commit that referenced this issue Sep 19, 2020
* Fixes #3365

* update expected inchi results

Note that this actually increases the number of failures with one of the tests.
That's because I believe the expected InChIs to be wrong and these new results to be correct.
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