-
Notifications
You must be signed in to change notification settings - Fork 20
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
EZ isomerism and chirality #39
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, just some very small comments.
Could you also update the README on how to interpret the 'stereo' attributes?
msg = (f"Chiral node {node} has {n} neighbors, which " | ||
"is different than the four expected for " | ||
"tetrahedral chirality. If the chiral center " | ||
"contains hydrogen you need to set explicit_hydrogen " | ||
"to True.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't there be an implicit hydrogen? That would by definition get the lowest priority, IIRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's not how the open smiles definition works though; the chirality is not according to R/S but a local reference frame that is arbitrary viewed from the first atom which may or may not have lowest priority
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one of the neighbor atoms is a hydrogen and is represented as an atomic property of the chiral center (rather than explicitly as [H]), then it is considered to be the first atom in the clockwise or anticlockwise accounting.
So if the smiles is: N[C@H](O)Br
, then N=0, H=1, O=2, Br=3
. i.e., look along N-C bond, and the rotation is H-O-Br
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is actually even more crazy:
N[C@H](O)Br --> here it is H0 N1 O2 Br3
N[C][H](O)Br --> here it is N0 H1 O2 Br3
the text reads:
If one of the neighbor atoms is a hydrogen and is represented as an atomic property of the chiral center (rather than explicitly as [H]), then it is considered to be the first atom in the clockwise or anticlockwise accounting. Now the question is how do we figure that out in the workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right.
Maybe have the central atom with implicit H itself as first "neighbour"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is best to tag the node when it has the implicit hydrogen def. This does not change the fact that you cannot have implicit hydrogen here. The entire annotation only makes sense for when you have all hydrogen present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand the "you cannot have implicit hydrogen". To me "implicit" means that the hydrogen is not an explicit node in the graph, but rather a node attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should hide this chirality assignment behind a flag, which then requires explicit hydrogen atoms. Basically, the point being that the assignment of node indices makes only sense if these nodes are actually present.
address comments Co-authored-by: Peter C Kroon <[email protected]>
@pckroon the current state is that I think it correctly interprets the chirality but there is no way I can figure out how to get an absolute assignment from this, which means it is nice but also useless |
Implementation for storing chirality and E/Z isomers across double bonds.
Chirallity is simply annotated onto the chiral center with the ordering of nodes giving the improper dihedral defining that center. Note that in order to get R/S classification one still needs to correctly interpret the chiral center. For building coordinates it should be enough to take the imporper dihedral angle defined by the atoms and give it a positive value.
E/Z isomers are annotated to the outermost atoms, which define the isomerism. The annotation consists of the 4 atoms that would form a proper dihedral angle whose value is either cis=0 degrees or trans=180 degrees.