Setattr sets an attribute (existing or new) to a specified value. The attribute may remain multi-valued, however, as the assignment may affect only a subset of the atoms (or residues, etc.) with the attribute. To assign multiple values simultaneously, use defattr.
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:
If the attribute already exists, attr_value should be of the appropriate type. Allowed attribute types:
setattr a label "pick me!" element.S- label all sulfur atoms with the text pick me!
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
See also: defattr, the Selection Inspector, the molecule model attributes panel, the pseudobond group attributes panel