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

Bug in image rendering of dative bonds #3056

Closed
IvanChernyshov opened this issue Mar 31, 2020 · 3 comments
Closed

Bug in image rendering of dative bonds #3056

IvanChernyshov opened this issue Mar 31, 2020 · 3 comments
Labels
Milestone

Comments

@IvanChernyshov
Copy link

In some cases, dative bonds are painted in the wrong color of the end atom:

Chem.MolFromSmiles('N->1CCN->[Cu++]1')

image

or are even invisible, while the molecular graph is correct:

mol = Chem.MolFromSmiles('[Cu++]->1->2.N1CCN2')
mol

image

mol.Debug()
RDKit INFO: Atoms:
RDKit INFO: 	0 29 Cu chg: 2  deg: 2 exp: 0 imp: 0 hyb: 6 arom?: 0 chi: 0
RDKit INFO: 	1 7 N chg: 0  deg: 2 exp: 2 imp: 1 hyb: 4 arom?: 0 chi: 0
RDKit INFO: 	2 6 C chg: 0  deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
RDKit INFO: 	3 6 C chg: 0  deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
RDKit INFO: 	4 7 N chg: 0  deg: 2 exp: 2 imp: 1 hyb: 4 arom?: 0 chi: 0
RDKit INFO: Bonds:
RDKit INFO: 	0 1->2 order: 1 conj?: 0 aromatic?: 0
RDKit INFO: 	1 2->3 order: 1 conj?: 0 aromatic?: 0
RDKit INFO: 	2 3->4 order: 1 conj?: 0 aromatic?: 0
RDKit INFO: 	3 0->1 order: 17 conj?: 0 aromatic?: 0
RDKit INFO: 	4 0->4 order: 17 conj?: 0 aromatic?: 0

Unfortunately, I was not able to find any specific pattern of this bug.

@greglandrum greglandrum added this to the 2020_03_2 milestone Mar 31, 2020
@DavidACosgrove
Copy link
Collaborator

DavidACosgrove commented Apr 2, 2020

I'll have a look at this. It was my fault, more than likely. I don't think the dative bonds split the bond into 2 different colours depending on the ends, and it looks like it doesn't set the draw colour to anything sensible, just uses whatever it was using last. If the dative bond is the first one it draws, then the colour will be the background colour.

@DavidACosgrove
Copy link
Collaborator

Ivan, can you say which version of RDKIt you're using, please? This is something I thought I'd fixed in 2020.03.1 (at least, the missing bonds bit) and I'm not reproducing the problem in the new version.

@greglandrum
Copy link
Member

Closed by #3066

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

3 participants