-
Notifications
You must be signed in to change notification settings - Fork 110
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
Incorrect phosphorus valence #2746
Labels
Export to SVG/PNG
Bucket: Bugs related to SVG/PNG export
Micromolecules canvas
Bucket: Micromolecules canvas related issues
User`s Feedback
Comments
jblack-mestre
added a commit
to mestrelab-chemoinformatics/Indigo
that referenced
this issue
Feb 5, 2025
Could you send me the file for this picture so I can reproduce the issue? The problem is that the molecules at the top should have the same oxidation state as the ones at the bottom? |
Just add correspondig count of
|
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Export to SVG/PNG
Bucket: Bugs related to SVG/PNG export
Micromolecules canvas
Bucket: Micromolecules canvas related issues
User`s Feedback
Summary
When generating an .svg image with indigo-depict phosphorus_valence.cml, the phosphorus is incorrectly depicted as having a wrong valence of 5. It should have a valence of 3, with no added hydrogens.
Steps to Reproduce
Actual behavior
![Image](https://private-user-images.githubusercontent.com/196164237/408073673-f989381c-8aa0-4b2d-bc0f-572875ff7091.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Nzg3MzcsIm5iZiI6MTczOTQ3ODQzNywicGF0aCI6Ii8xOTYxNjQyMzcvNDA4MDczNjczLWY5ODkzODFjLThhYTAtNGIyZC1iYzBmLTU3Mjg3NWZmNzA5MS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QyMDI3MTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYzU2MjZmY2Y1Njg1NTQ2MmRkNWZjZjU0YzIyMmExODgzZWMzMDc3NTkxMjM5NzYyYzYwOWM3ZjExNTgyNjIzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7nRteh7TW5yRIE8A22wZ5yb9-imXMFrgZvuF5Z4GUms)
The phosphorus is depicted as having a valence of 5 with two added hydrogens.
Expected behavior
![Image](https://private-user-images.githubusercontent.com/196164237/408073567-6a18e0fd-6c0d-44c3-8dc7-c9065fea552d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Nzg3MzcsIm5iZiI6MTczOTQ3ODQzNywicGF0aCI6Ii8xOTYxNjQyMzcvNDA4MDczNTY3LTZhMThlMGZkLTZjMGQtNDRjMy04ZGM3LWM5MDY1ZmVhNTUyZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QyMDI3MTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wOGE4Mzg1ODhmNTMyZGZlOTBlMThhZGIyOWM1ZjZkZDc1N2I3NjZhNDM0MzU5YjhmOGU5YzU1MTkzOTJlZGNjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.JW3m-5zytuPlJ3d78gYkzKCM9yE4g-peuga2H_i8PYQ)
The phosphorus should be depicted as having a valence of 3 with no added hydrogens.
Environment details:
Attachments
phosphorus_valence.cml.txt
Additional context
When adding sgroup bonds, indigo recalculates the valence and implicit hydrogens before it has removed the bond to the atom connecting to the sgroup. So P initially has a valence of 3, then this is raised to 4 when adding the bond to the new sgroup. Once the valence is recalculated, this is increased to 5.
The text was updated successfully, but these errors were encountered: