Command Argument Types

The chimerax.core.commands module defines argument types such as FloatArg, StringArg, AtomsArg, ModelArg, ColorArg, PlaceArg, … which are Python classes used for parsing typed command arguments.

AtomicStructuresArg - Atomic structures
AtomsArg - Atoms
AtomSpecArg - Atom specifier
AxisArg - Axis vector
BoolArg - True/false values
CenterArg - Point
ColorArg - Color
ColormapArg - Color maps
EmptyArg - Allows missing argument
IntArg - Integer
ModelArg - Single model
ModelPlacesArg - Models and positions
ModelsArg - Any number of models
NoArg - Keyword with no value
ObjectsArg - Models or atoms
PlaceArg - Orientation and position
PseudobondGroupsArg - Pseudobond groups
StringArg - Axis vector
TopModelsArg - Top level models in tree

Color arguments

class ColorArg(name=None, url=None, html_name=None)

Support color names and CSS3 color specifications.

The CSS3 color specifications supported are: rgb, rgba, hsl, hsla, and gray from CSS4.

The following examples are all red, except for the gray ones:

rgb(255, 0, 0)
rgb(100%, 0, 0)
rgba(100%, 0, 0, 1)
rgba(100%, 0, 0, 100%)
hsl(0, 100%, 50%)
class ColormapArg(name=None, url=None, html_name=None)

Support color map names and value-color pairs specifications.

Accepts name of a standard color map:

grayscale, gray
red-white-blue, redblue,
blue-white-red, bluered
cyan-white-maroon, cyanmaroon

Or a custom color map can be specified as colon-separated colors, or as colon-separated (value, color) pairs with values ranging from 0 to 1.

Example colormap specifications:


Model positions

class ModelPlacesArg(name=None, url=None, html_name=None)

Annotation for model id and positioning matrix as 12 floats.