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

Handling of non-standard or variable valency, like tetra-valent Nitrogen? #358

Open
rwest opened this issue Oct 23, 2014 · 1 comment
Open

Comments

@rwest
Copy link
Contributor

rwest commented Oct 23, 2014

Posting this now in case it inspires work at the RDKit UGM hackathon tomorrow (sorry I couldn't join you).

We use RDKit in a number of places in our Reaction Mechanism Generator RMG-Py (https://github.com/GreenGroup/RMG-Py), such as:

  • reading and writing SMILES strings
  • generating 2D geometries for our pictures (much better at fused rings than our home-grown code!)
  • generating 3D geometries to start quantum mechanics calculations

It's great, and we are investigating using it in more places, such as aromaticity perception.

However, we recently extended our code to now include reactions containing nitrogen. We now often generate species that invalidate RDKit's fixed valency rules for Nitrogen, leading to
Sanitization error: Explicit valence for atom # 1 N, 4, is greater than permitted
(it was a big change for us too, to be able to cope with it). So we have had to code work-arounds and fall-backs for all the places we had started to use RDKit (eg. using OpenBabel for SMILES, or generating our own 2D pictures).
Obviously we would rather use RDKit without fall-backs (and we have no fall-back for 3D structures).

Is coping with Nitrogen's variable valency something that could be added to RDKit, or at least put on the wish-list? We can contribute some effort and programming time if it'll help, but we'd need guidance.
Something to chew on at your round-tables or hackathon... 😉

Relevant RMG-Py issues, dating back a year or more:
ReactionMechanismGenerator/RMG-Py#135 The change to RDKit
ReactionMechanismGenerator/RMG-Py#156 Initial realization of Nitrogen conflict
ReactionMechanismGenerator/RMG-Py#257 Sanitization issues cropping up again

@malteseunderdog
Copy link
Contributor

Yes, me too. Today I sit in the office day-dreaming I was in a conference hall in Germany.

The "Explicit Valence" comes up every so often. I dont know if you have seen the excellent sanifix4.py script by James. It is in the "Cleaning up Heterocycles" section in the cookbook (http://www.rdkit.org/docs/Cookbook.html). IIRC it is also in contrib. This works for most cases, and it drastically reduces these kind of errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants