Conversation
for more information, see https://pre-commit.ci
…elax-oe-nitrogen-stereo
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
Fingers crossed that the docs build issues are transient - I'll try a rebuild after the long weekend. |
Yoshanuikabundi
left a comment
There was a problem hiding this comment.
I've found one class of false negatives introduced by this change, but am unsure how much of a dealbreaker this is. Otherwise, LGTM! The DrugBank entries removed from the test files is very pleasing. The tests look right to me and pass.
New false negative
(by false negative, I mean an inarguably chiral molecule that is allowed to be constructed with ambiguous stereochemistry without the allow_undefined_stereo switch turned on)
If it's important that all chiral molecules be detected, then I believe this change introduces a failure mode in the form of bridgehead amines in conjugated systems such as Troger's base. This is a bridgehead, which makes it pyramidal, but is still bonded to an sp2 carbon, so I believe it would be detected as chiral before this change but slip by after this change. As this change is advertised as reducing overpolicing, it might be surprising or undesirable that it introduces a false negative.
You can see this by adding
# Troger's base (bridgehead conjugated tertiary amine)
("c1(ccc3c(c1)C[N@]4c2ccc(cc2C[N@]3C4)C)C", ["S", "R"], None),
("c1(ccc3c(c1)CN4c2ccc(cc2CN3C4)C)C", [None, None], "unspecified stereochemistry"),to the test_smiles_nitrogen_chirality_skip parametrization and changing [expected_stereo] to expected_stereo in the test body. The first new line succeeds both before and after the change, and the second succeeds only before the change.
My only proffered alternative (that I'm not sure is in scope or rises to the level of a suggestion) is that we could go further. There's an argument that basically all tertiary amines are achiral, as the planar ones are planar and the pyramidal ones interconvert rapidly. This seems to be what's suggested by the "spec for undefined chemistry" issue's table (#146, line with SMILES N(Cl)(F)C).
We could follow RDKit's example and specify that a chiral tertiary nitrogen must either be in a 3-membered ring or be a bridgehead.
OpenEyeToolkitWrapper.from_openeyenot raise an undefined-stereo error/warning for planar Ns if they have at least one trivalent carbon neighbor (This isn't a perfect solution but does cover a large fraction of the annoying over-policing of nitrogen stereo by OETKW)