Opened 11 days ago
Closed 9 days ago
#19857 closed enhancement (fixed)
Make chirality command return pairs of atom and 'R' or 'S' for chiral centers
| Reported by: | Tom Goddard | Owned by: | Eric Pettersen |
|---|---|---|---|
| Priority: | moderate | Milestone: | |
| Component: | Structure Analysis | Version: | |
| Keywords: | Cc: | Elaine Meng | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
The chirality command currently just returns a list of "R" or "S". It would be useful in Python scripts to know the atoms too. Maybe return [(chiral_atom1, "R"), (chiral_atom2, "S"), ...]. Or a dictionary mapping the atom to the chirality.
Change History (8)
comment:1 by , 10 days ago
| Status: | assigned → accepted |
|---|---|
| Type: | defect → enhancement |
comment:2 by , 10 days ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
comment:3 by , 10 days ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Always returns an empty dictionary. Iterating through the ch_info=zip() iterator to print results reaches the end so dict(ch_info) produces an empty dictionary.
comment:4 by , 10 days ago
Also when I fix that it is a bit surprising that the dictionary contains atoms that are not chiral centers. I'd expect it to have only atoms which are chiral centers, or maybe all atoms. But apparently it includes atoms that have 4 bonded atoms which is surprising.
comment:5 by , 9 days ago
Would also be nice if the chirality command did not raise UserError when there are no centers but instead just logged an info message. This makes it easier to use in Python scripts.
I think as a user command a common use would be "chirality #1" where you are just asking which atoms are chiral centers. The Log output I think would just include chiral centers, not atoms with 4 substituents that are not chiral.
comment:7 by , 9 days ago
I did not push any fix. I only made a fix in my local ChimeraX since I am studying AlphaFold/Boltz/OpenFold chirality violations with Tristan.
comment:8 by , 9 days ago
| Cc: | added |
|---|---|
| Resolution: | → fixed |
| Status: | reopened → closed |
Okay, I changed it so that in the Python layer it no longer always returns an empty dictionary. I also added a "verbose" option to the command, defaulting to false. If verbose is true, it reports the same info as before, which includes the non-chiral 4-substituent atoms. Verbose false will omit those.
Having no 4-substituent atoms in the spec at all has been downgraded from an error to a warning.
Change: https://github.com/RBVI/ChimeraX/commit/0ba4395590ed3d61691bd8ca877b7e7f8b8c6fab
Command now returns atom→chirality dictionary.
Change: https://github.com/RBVI/ChimeraX/commit/08785290b0187a73cfe3a81cf386f4816c601458