[Chimera-users] Remove shapes programmatically

Elaine Meng meng at cgl.ucsf.edu
Wed Oct 8 12:01:59 PDT 2014

Hello Javier,
The “shape” command creates surface models.  You can close (delete) or hide a model with commands “close” and “~modeldisplay”, respectively.  You would specify the model by its ID number in the command; these IDs are shown in the Model Panel (open from Favorites menu), or to make it easier to know the IDs of each shape, you could assign the ID number at the time of creating each model with the “shape” command “modelid” option.

For example:

shape tube @ca rad 0.75 color red modelid 5
~modeldisp #5
modeldisp #5
color hot pink #5
close #5

Although you can change the color, you can’t change the shape itself (radius etc.), only close that one and create another new one.

Your example command is a little strange, it just creates a cylinder between two atoms :1 at ca and :100 at ca … is that what you wanted?  (you don’t need the # in that command).  If so, you could do something similar with a pseudobond, which would be more manipulable, for example:

distance :5,100 at ca
setattr p label " " :5,100 at ca
setattr p drawMode 1 :5,100 at ca
setattr p radius 0.5 :5,100 at ca
setattr p color dodger blue :5,100 at ca

I hope this helps,
Elaine C. Meng, Ph.D.                       
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Oct 8, 2014, at 10:29 AM, jiserte at unq.edu.ar wrote:

> Hello.
> I'm having a problem working with shapes in chimera. I'm adding shapes with a script using commands like:
> shape tube #:1 at CA#:100 at CA radius 0.1
> I want to remove some of the shapes later in the script, however i can not find the proper way to do it.
> I know is posible to do it using the GUI (picking the shape with control key and then "Actions>Surfce>Hide" in the menu bar), but i dont know how to do the same with the command line.
> Also, i can not find the way to manipulate existing shapes (increase radius, change color, etc).
> There is a way to delele, hide or manipualte shapes?
> Thank you all.
> Javier Iserte PhD

More information about the Chimera-users mailing list