Hi Arun, The command "label delete" deletes all labels because you didn't specify any particular ones in the command. If you only want to delete the ones for selected residues, you would have to use: label delete sel I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Mar 9, 2026, at 8:43 AM, Arun Gupta via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX Team, I am currently working on visualizing peptide/Protein complexes and I’m having some trouble maintaining specific residue labels while clearing others. My Goal: I want to label: • Protein (Chain A) residues that are within 5.0Å of the Peptide (Chain C) residue 1. • The Peptide (Chain C) P1 residue itself. • I want to ensure residues P2–P9 remain unlabeled. Below is the script I am currently using: set bg white graphics silhouettes t lighting depthCue f size #1 ballScale 0.20 stickRadius 0.2 select /A & (/C:1 :<5.0) show sel style sel ball color byhet view sel label sel text "{0.label_one_letter_code}{0.number}" label @@display residues bgColor white label height 1.0 sel #1/C: 2-9 label delete The issue I am encountering is that when I execute: sel #1/C: 2-9
label delete
it deletes not only the labels for peptide residues P2–P9, but also the labels for the protein interface residues that were previously defined and labeled. Question: • Should I be using a more specific selector in the label command itself to avoid using select and label delete sequentially? Any advice on the cleanest syntax to achieve this would be greatly appreciated! Best regards, Arun