Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#16950 closed enhancement (fixed)

Allow residue labels to be position at C-alpha atom

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Depiction Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I wish there was an option or preference or attribute for residue-label position based on CA instead of centroid of all displayed atoms. I keep trying to mock up feature highlight images with 3D labels and they're always plopped right on top of the sidechain so you can't see what's going on, whereas if they were pinned at the CA it would be less likely to block.

Yes, I can use "offset" but as soon as you rotate it's wrong again. It's one of the few capabilities of Chimera that I miss in ChimeraX (along with the dreaded "set independent" rotation method). In Chimera, there's a model attribute to use centroid of displayed atoms, or primary atom, or centroid of displayed backbone atoms.
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/moleculeattrib.html#rlabelpos>

Would this be feasible as a command option and/or Labels preference? I could make a ticket, just thought I'd put out a feeler rather than making a ticket if it was going to be shot down immediately...

I realize that 2D labels are preferred for nice images, but again, hard to set up in a script only and I like to provide cxc files that do most of the setup for highlight images.

Elaine

Change History (4)

comment:1 by Tom Goddard, 8 months ago

Resolution: fixed
Status: assignedclosed

Done.

The label command now has a "position" keyword option with values "centroid" (default) or "primary atom". This keyword only effects residue labels. It does not give an error if used for non-residue labels. Primary atom will put the lower left corner of the label at the C-alpha atom position for a protein. Centroid is at the average atom position of the residue atoms.

comment:2 by Elaine Meng, 8 months ago

I guess the build failed so I can't try it yet. One thought is that in general, it may be better to avoid spaces in option values so people don't waste time trying to enter them without quotation marks and wondering why it doesn't work. Most people aren't sure about what you can and can't truncate, so it just adds another hurdle to actually using the option. However, in this case I guess I could just document the choices as "centroid" and "primary" to skirt the issue.

Last edited 8 months ago by Tom Goddard (previous) (diff)

comment:3 by Tom Goddard, 8 months ago

I went with "primary atom" because it is what Chimera used. I like to keep things the same as Chimera unless there is a strong reason to do otherwise. It can be abbreviated to primary. I think most users figure out commands by example so if they encounter an example, like in a future feature highlight it will either use "primary atom" with quotes or primary and the users will copy that. At any rate, I think it best to stick with "primary atom".

comment:4 by Elaine Meng, 8 months ago

OK, the implementer has the prerogative to decide on the details!  I would only add that it is not like Chimera because it's not an attribute, in that people have to type it in commands rather than simply choosing it from a menu in a selection inspector GUI.
Note: See TracTickets for help on using tickets.