Chimera Commands Index

setattr ( a | r | m | M | b | p | g | s )  attr_name  attr_value  atom-spec

~setattr ( a | r | m | M | b | p | g | s )  attr_name

The command setattr sets an attribute (existing or new) to a specified single value. The attribute may remain multi-valued, however, as the assignment may affect only a subset of the entities with the attribute. To assign multiple values simultaneously, use defattr. For attr_name (attribute name) lookup, see the balloon help of attribute inspector dialogs (more...).

Although setattr does not contain restrictions on which attributes can be affected, it may not make sense to change certain attributes. It is possible, however, to set an attribute that is also used in the atom-spec because the specification will be evaluated before the attribute value is changed.

The attribute level can specified as:

The attribute name (attr_name) can be existing or new. It should be an alphanumeric string without spaces; it can include underscores, but cannot begin with a digit, underscore, or capital letter. An attribute with attr_name ending in color (case-independent) will be interpreted as a color-valued attribute.

If the attribute already exists, attr_value should be of the appropriate type. Allowed attribute types:

The value can be specified as none (no value) for attributes that are allowed to have no value. Certain attributes (for example, atom radius) and attribute types (for example, strings) cannot have no value.

The ~setattr command deletes the attribute entirely.


setattr a label "pick me!" element.S
- label all sulfur atoms with the text pick me!
setattr s density 5.0
- set molecular surface vertex density to 5.0
setattr r isHelix false :30-45.a
- remove any helix assignment from residues 30-45 in chain A (without changing the structure itself)
setattr p color hot pink ions za<5
- color pseudobonds between atoms within 5 Å of ions hot pink
setattr g lineWidth 3
- use linewidth 3 for all pseudobond groups