Opened 3 weeks ago

Closed 3 weeks 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 Eric Pettersen, 3 weeks ago

Status: assignedaccepted
Type: defectenhancement

comment:2 by Eric Pettersen, 3 weeks ago

Resolution: fixed
Status: acceptedclosed

Command now returns atom→chirality dictionary.

Change: https://github.com/RBVI/ChimeraX/commit/08785290b0187a73cfe3a81cf386f4816c601458

comment:3 by Tom Goddard, 3 weeks ago

Resolution: fixed
Status: closedreopened

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 Tom Goddard, 3 weeks 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 Tom Goddard, 3 weeks 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.

Version 0, edited 3 weeks ago by Tom Goddard (next)

comment:6 by Eric Pettersen, 3 weeks ago

Did you commit/push your fix? I'm not seeing it...

comment:7 by Tom Goddard, 3 weeks 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 Eric Pettersen, 3 weeks ago

Cc: Elaine Meng added
Resolution: fixed
Status: reopenedclosed

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

Note: See TracTickets for help on using tickets.