Attribute assignment files are simple user- or program-generated text files that can be read using the open command to create attributes and assign their values to atomic structures in ChimeraX. The format can be indicated with filename suffix .defattr or the open command option format defattr. It is the same format as used by Chimera, although the atom specification strings within may differ.
Several example files are provided. Existing attributes can be saved in this format by using the save command or the general file-saving dialog shown with File... Save in the main menu or the Save File button in Render/Select by Attribute.
Example commands showing how such a file could be used:
open 1pho
open kdHydrophobicity.defattr
color byattribute kdHydrophobicity palette ^RdYlBu
select ::kdHydrophobicity>2.0
A hash symbol # at the beginning of a line indicates a comment. Basic properties of an attribute are described in control lines of the form:
identifier: valuePossible control line contents:
identifier | value | description |
attribute (required) |
alphanumeric string without spaces; can include underscores; cannot begin with a digit | attribute name, existing or new |
match mode (optional) |
any (default) non-zero 1-to-1 |
expected matches per assignment line (an error message will be sent to the Log when a line's match behavior differs from the match mode) |
recipient (optional) |
atoms (default) residues chains structures† bonds pseudobonds |
level of attribute assignment |
none handling (optional) |
None (default) string delete |
treatment of values given as none or None: as the Python value None, as a string, or as removal of any assignment of that attribute from the specified item |
The attribute assignments are described in assignment lines of the form:
(Tab)atom-spec(Tab)attr-valueAny kind of atom specification can be used.
Control lines and comments can be interspersed with assignment lines, except that the attribute control line should precede all assignment lines for the corresponding attribute.
Allowed attr-value types are:
A simple text format is used for attribute assignment. These files can be opened with the open command to assign the corresponding attributes.