Define Attribute
Atoms, residues, and molecule models have attributes
(properties) that can be:
- defined automatically (see the lists for
atoms,
residues, and
molecule models)
- generated by using some Chimera tools
- created arbitrarily with Define Attribute
Attribute values can be rendered visually
(Render by Attribute,
rangecolor)
and used in
atom
specification and selection
(Select by Attribute).
Define Attribute allows assignment of attribute values to
atoms, residues, and models. New attributes can be created or values
(re)assigned for existing attributes.
Define Attribute is also implemented as the command
defattr.
There are several ways to start
Define Attribute, a tool in the Programming and
Utilities categories.
Starting Define Attribute brings up a dialog for
opening
an input attribute assignment file.
One or more molecule models should be chosen from
the Restrict to models list; only these will be considered
during attribute assignment. Individual models
or blocks of models can be chosen with the left mouse
button. Ctrl-click toggles the status of an individual model.
To choose a block of models without dragging,
click on the first (or last) and then Shift-click
on the last (or first) in the desired block.
Additional options:
- Open Render/Select by Attribute - whether to open the
Render/Select by Attribute tool
after assigning attribute values. Even when this option is off,
the attribute(s) will be available within the
Render/Select
by Attribute tool if it is opened later in the session.
- Send match info to Reply Log - whether to send details
about the attribute assignments to the
Reply Log
OK performs the assignment and dismisses the dialog,
whereas Apply performs the assignment without dismissing the dialog.
Close simply dismisses the dialog. Help opens
this manual page in a browser window.
Assignments can only affect molecule models that are open when
the attribute is defined/assigned.
For example, atoms in models opened after radii have been
assigned by element will have the
default radii,
not the element-based ones.
Examples are provided below.
Comment lines begin with # and can be placed anywhere in the file.
Otherwise, the file starts with one or more
control lines
of the form:
identifier: value
Possible control line contents are:
identifier |
value (defaults in bold) |
description |
attribute |
alphanumeric string without spaces |
attribute name (existing or new) |
match mode |
any non-zero 1-to-1 |
expected matches per
assignment line
(an error message will be sent to the
Reply Log
when a line's match behavior differs from the match mode) |
recipient |
atoms residues molecules |
level of attribute assignment |
The control lines can be in any order, and only the
attribute line is required.
The attribute assignments are described in
assignment lines:
(Tab)atom-spec(Tab)attr-value
Additional control lines and comments can
be interspersed with the assignments. Any kind of
atom
specification can be used.
Allowed attr-value types are:
- real number (float)
- integer
- boolean (true or false, case-independent)
- color - an attribute whose name
ends with color (case-independent) will be interpreted as
a color-valued attribute. A color value can be expressed as:
- a color name (a
built-in name
or one defined previously with
colordef)
- RGBA values, four space-separated numbers each ranging from 0 to 1
(inclusive) that represent the red, green, blue, and opacity
components of the color; if the last number is omitted, the opacity is
set to 1 (completely opaque)
- string - a string of any characters except tabs;
values that might be interpreted as one of the other types
should be enclosed in double quotes
New numerical attributes will appear in the attribute lists of
Render/Select by Attribute;
string attributes will be listed only in the
Select by Attribute
portion; boolean and color attributes will not be listed.
- percentExposed.txt
creates a new residue attribute, percentExposed, and assigns
values previously calculated by
Getarea for the protein structure 121p.
The figure at the top of the page was generated
by opening the structure, defining the attribute, and then using
Render by Attribute
to color the structure and render it as a worm. Atoms are undisplayed
except for the ligand (yellow spheres).
- midasrad.txt
assigns atomic radii, i.e., sets values for the existing
atom attribute
radius. The first specification in the file is #, which
assigns a value to all atoms. Subsequent lines
reassign the radii of atoms of particular elements.
Remember that atoms in models opened after the assignment
will have the default radii
instead of those in midasrad.txt.
- rescol.txt sets values for the existing
atom attribute
color and the existing
residue attribute
ribbonColor according to amino acid type.
Non-amino-acid residues are colored dark gray.
The colors are specified with
built-in names.
Note that the same results can be achieved with a Chimera
command file
(rescol.com).
UCSF Computer Graphics Laboratory / November 2004