Python Functions implementing User Commands

The chimerax.std_commands and chimerax.core.commands modules contain Python functions for the standard commands available from the ChimeraX command-line. Tools define additional commands noted with a (*) and their code location is described with the function descriptions.

2dlabels * - Show text labels with graphics
alias - Define aliases for commands
align - Align one set of atoms to another
bumps * - Mark cell protrusions in 3D light microscopy
cage * - Place models on polygonal cages
camera - Change camera settings
cartoon * - Display atomic structure ribbons or pipes/planks
cd - Change working directory
clip - Clip models
close - Close models
cofr - Set center of rotation method
color - Color atoms, ribbons and surfaces
coordset - Play through structure coordinate sets
crossfade - Fade between scenes for movie making
crosslinks * - Move atomic structures to minimize crosslinks
delete - Delete models
devel - For developers to package tools
device * - Enable devices such virtual reality headsets and space navigator
distance * - Show distances between atoms
echo - Write message to log
exit - Quit
fitmap - fit atomic structures in density maps
graphics - set graphics rendering parameters
help - Show documentation
hide - Hide atoms, ribbons, models
info * - Report model info
interfaces * - Make a buried area contact graph
ks * - Enable keyboard shortcuts
label * - Show text labels on atoms
lighting - Change lighting parameters
log * - Clear or save the log
material - Change surface material light reflection properties
measure - Calculate properties of models
mlp * - Color surfaces by molecular lipophilicity
molmap - Calculate a density map from atoms
morph * - Morph between atomic models
move - Move camera
movie * - Record videos
mseries * - Display a series of models
open - Open data files
pdbimages - Render PDB assembly images
perframe - Run a command for every rendered frame
pwd - Print working directory
rainbow - Color residues and chains
rename - Rename models
resfit * - Show density around residues
roll - Rotate models
run - Run a user command string
save - Save sessions, images, density maps…
select - Select objects
set - Set rendering effects (background color, silhouettes)
show - Show atoms, ribbons, models
style - Set rendering style for atoms, ribbons, models
size - Change atom, bond, pseudobond sizes
smoothlines * - Smooth paths in line drawings
split - Split atomic structures into pieces
stop - Stop motion
struts * - Add struts between atoms for 3d printing
style - Change atom display style and sizes
surface - Compute a molecular surface
sym - Show molecular assemblies involving symmetry
time - Time a command
toolshed * - Control the Tool Shed user interface
transparency - Set transparency of atoms, ribbons and surfaces
turn - Rotate models
ui * - Control tool windows and set mouse modes
view - Move camera to view specified objects
volume - Change density map settings and filter maps
vseries - Play density map time series
wait - Wait before executing next command
windowsize - Set or report graphics window size
zoom - Zoom in or out


Function found in chimerax.label.label2d

label_create(session, name, text='', color=None, bg_color=None, size=24, font='Arial', bold=None, italic=None, xpos=0.5, ypos=0.5, visibility=True, margin=0, outline=0)

Experimental API . Create a label at a fixed position in the graphics window.


Identifier for the label used to change or delete label.


Displayed text of the label.


Color of the label text. If no color is specified black is used on light backgrounds and white is used on dark backgrounds.


Draw rectangular label background in this color. If omitted, background is transparent.


Font size in points.


Font name. This must be a true type font installed on Mac in /Library/Fonts and is the name of the font file without the “.ttf” suffix.


Placement of left edge of text. Range 0 - 1 covers full width of graphics window.


Placement of bottom edge of text. Range 0 - 1 covers full height of graphics window.


Whether or not to display the label.


Amount of padding to add around text


width of contrasting outline to place around background/margin

label_change(session, labels, *, text=None, color=None, bg_color=None, size=None, font=None, bold=None, italic=None, xpos=None, ypos=None, visibility=None, margin=None, outline=None, frames=None)

Experimental API . Change label parameters.

label_delete(session, labels=None)

Experimental API . Delete label.


alias(session, name, text='')

Experimental API . Create command alias

  • name – name of the alias

  • text – optional text of the alias

If the alias name is not given, then a text list of all the aliases is shown. If alias text is not given, the text of the named alias is shown. If both arguments are given, then a new alias is made.


align(session, atoms, to_atoms=None, move=None, each=None, match_chain_ids=False, match_numbering=False, match_atom_names=False, sequence=None, cutoff_distance=None, report_matrix=False)

Experimental API . Move atoms to minimize RMSD with to_atoms. Returns matched atoms and matched to_atoms, matched atom rmsd, paired atom rmsd, and a chimerax.core.geometry.Place instance (i.e. the transform to place the match atoms onto the “to” atoms). The matched atoms can be fewer than the paired atoms if cutoff distance is specified. If “each” is not None then nothing is returned.

If ‘move’ is ‘structures’, superimpose the models by changing the model positions. If it is ‘atoms’, ‘residues’, ‘chains’ or ‘structure atoms’, then atoms promoted extended to this level are moved. If move is False move nothing or True move structures. If move is an Atoms collection then move only the specified atoms.

If ‘each’ is “structure” then each structure of atoms is separately aligned to the to_atoms. If ‘each’ is “chain” then each chain is aligned separately. If ‘each’ is “coordset” then each coordinate set of the first set of atoms (which must belong to a single structure) is aligned. Default is that all atoms are aligned as one group.

If ‘match_chain_ids’ is true then only atoms with matching chain identifiers are paired. Unpaired atoms or to_atoms are not used for alignment.

If ‘match_numbering’ is true then only atoms with matching residue numbers are paired. It is assumed the atoms are in residue number order. Unpaired atoms or to_atoms are not used.

If ‘match_atom_names’ is true then only atoms with matching names are paired. Unpaired atoms or to_atoms are not used for alignment.

If ‘sequence’ names a reference sequence then the previously calculated alignment of atoms and to_atoms to that reference sequence is used to pair the atoms.

If ‘report_matrix’ is True, report the transformation matrix to the Reply Log.


bumps(session, volume, center=None, range=None, base_area=10.0, height=1.0, marker_radius=1.0, marker_color=(100, 200, 100, 255), color_surface=True, name='bumps', all_extrema=False)

Experimental API . Find protrusions on T-cells in 3d light microscopy.

Algorithm finds points on contour surface whose distance from a center point is locally maximal then extends to neighbor grid points inside the surface as long as the border area (ie protrusion base area) is less than a specified value. Protrusions of sufficient height are marked. A marker closer to the center and within another protrusion is not marked.


Map to find protrusions on. Highest surface contour level used.


Point which is the cell center for finding radial protrusions.

rangefloat or None

How far out from center to look for protrusions.


Area of base of protrusion. Protrusion is extended inward until this area is attained and that defines the protrusion height.


Minimum height of a protrusion to be marked.


Size of marker spheres to place at protrusion tips.

marker_coloruint8 4-tuple

Color of markers. Default light green.


Whether to color the protrusion surface near the protrusion grid points. Each protrusion is assigned a random color. Default true.


Name of created marker model. Default “bumps”.


Whether to mark all radial extrema even if the don’t meet the protrusion height minimum. Markers within another protrusion are colored yellow, ones that never attain the specified protrusion base_area (often smal disconnected density blobs) are colored pink, markers on protrusions that are too short are colored blue.


cage(session, cage, place_model=None, polygon_sides=6, surface_only=False, resolution=None)

Experimental API . Build polygonal cages and place molecules on faces.


Cage model.


Place copies of model on each n-sided polygon of cage.


Place on polygons with this number of sides.


Instead of showing instances of the molecule, show instances of surfaces of each chain. The chain surfaces are computed if they do not already exist.


Resolution for computing surfaces when surface_only is true.


camera(session, type=None, field_of_view=None, eye_separation=None, pixel_eye_separation=None)

Experimental API . Change camera parameters.


Controls type of projection, currently “mono”, “360”, “360tb” (stereoscopic top-bottom layout), “360sbs” (stereoscopic side-by-side layout), “stereo”, “sbs” (side by side stereo), “tb” (top bottom stereo)


Horizontal field of view in degrees.


Distance between left/right eye cameras for stereo camera modes in scene distance units.


Physical distance between viewer eyes for stereo camera modes in screen pixels. This is needed for shutter glasses stereo so that an object very far away appears has left/right eye images separated by the viewer’s physical eye spacing. Usually this need not be set and will be figured out from the pixels/inch reported by the display. But for projectors the size of the displayed image is unknown and it is necessary to set this option to get comfortable stereoscopic viewing.


cartoon(session, atoms=None, smooth=None, suppress_backbone_display=None, spine=False)

Experimental API . Display cartoon for specified residues.

atomsatom specifier

Show ribbons for the specified residues. If no atom specifier is given then ribbons are shown for all residues. Residues that are already shown as ribbons remain shown as ribbons.

smoothfloating point number

Adjustment factor for strand and helix smoothing. A factor of zero means the cartoon will pass through the atom position. A factor of one means the cartoon will pass through the “ideal” position, e.g., center of the cylinder that best fits a helix. A factor of “default” means to return to default (0.7 for strands and 0 for everything else).


Set whether displaying a ribbon hides the sphere/ball/stick representation of backbone atoms.


Display ribbon “spine” (horizontal lines across center of ribbon). This parameter applies at the atomic structure level, so setting it for any residue sets it for the entire structure.

uncartoon(session, atoms=None)

Experimental API . Undisplay ribbons for specified residues.

atomsatom specifier

Hide ribbons for the specified residues. If no atom specifier is given then all ribbons are hidden.


cd(session, directory=None)

Experimental API . Change working directory.


clip(session, near=None, far=None, front=None, back=None, slab=None, position=None, axis=None, coordinate_system=None, cap=None)

Experimental API . Enable or disable clip planes.

near, far, front, backfloat or “off”

Distance to move near, far, front or back clip planes. Near and far clip planes remain perpendicular to the view direction. Front and back planes rotate with models. If a plane is not currently enabled then the offset value is from the center of rotation. Positive distances are further away, negative are closer.


Plane offsets are relative to this point. If not give then offsets are relative to current plane positions. If plane is not enabled then offset is relative to center of bounding box of displayed models.


Normal to clip plane for planes front and back. Not used for near and far planes.


Coordinate system for axis and position, if none then screen coordinates are used.


close(session, models=None)

Experimental API . Close models.

modelslist of models

These models and any submodels are closed. If models is none all models are closed.


cofr(session, method=None, objects=None, pivot=None, coordinate_system=None, show_pivot=None)

Experimental API . Set center of rotation method to “front center” or “fixed”. For fixed can specify the pivot point as the center of specified displayed objects, or as a 3-tuple of numbers and optionally a model whose coordinate system is used for 3-tuples.


“front center” or “fixed” specifies how the center of rotation point is defined.


Set the method to “fixed” and use the center of the bounding box of these objects as the pivot point.

pivot3 floats

Set the method to “fixed” and used the specified point as center of rotation.


The pivot argument is given in the coordinate system of this model. If this option is not specified then the pivot is in scene coordinates.

show_pivotbool or 2 floats

Whether to draw the center of rotation point in the scene as 3 colored axes. If two floats are given, they are axes length and radius of the pivot point indicator and the pivot is shown.


color(session, objects, color=None, what=None, target=None, transparency=None, halfbond=None, undo_name='color')

Experimental API . Color atoms, ribbons, surfaces, ….


Which objects to color.


Color can be a standard color name or “byatom”, “byelement”, “byhetero”, “bychain”, “bypolymer”, “bynucleotide”, “bymodel”.

what‘atoms’, ‘cartoons’, ‘ribbons’, ‘surfaces’, ‘bonds’, ‘pseudobonds’, ‘labels’ or None

What to color. Everything is colored if option is not specified.

targetstring containing letters ‘a’, ‘b’, ‘c’, ‘p’, ‘r’, ‘s’, ‘f’

Alternative to the “what” option for specifying what to color. Characters indicating what to color, a = atoms, c = cartoon, r = cartoon, s = surfaces, b = bonds, p = pseudobonds, f = (filled) rings Everything except labels is colored if no target is specified.


Percent transparency to use. If not specified current transparency is preserved.


Whether to color each half of a bond to match the connected atoms. If halfbond is false the bond is given the single color assigned to the bond.

color_electrostatic(session, surfaces, map, palette=None, range=None, offset=1.4, transparency=None, update=True)

Experimental API . ..

!! processed by numpydoc !!

color_sample(session, surfaces, map, palette=None, range=None, offset=0, transparency=None, update=True)

Experimental API . Color surfaces using a palette and interpolated map value at each surface vertex.

surfaceslist of models

Surfaces to color.


Color map.

range2 comma-separated floats or “full”

Specifies the range of map values used for sampling from a palette.


Color specified surfaces by sampling from this density map using palette, range, and offset options.


Displacement distance along surface normals for sampling map when using map option. Default 0.


Percent transparency to use. If not specified current transparency is preserved.

color_gradient(session, surfaces, map, palette=None, range=None, offset=0, transparency=None, update=True)

Experimental API . ..

!! processed by numpydoc !!

color_radial(session, surfaces, center=None, coordinate_system=None, palette=None, range=None, update=True)

Experimental API . ..

!! processed by numpydoc !!

color_cylindrical(session, surfaces, center=None, axis=None, coordinate_system=None, palette=None, range=None, update=True)

Experimental API . ..

!! processed by numpydoc !!

color_height(session, surfaces, center=None, axis=None, coordinate_system=None, palette=None, range=None, update=True)

Experimental API . ..

!! processed by numpydoc !!

color_zone(surface, points, point_colors, distance, sharp_edges=False, auto_update=True)

Experimental API . ..

!! processed by numpydoc !!


coordset(session, structures, index_range, hold_steady=None, pause_frames=1, loop=1, bounce=False, compute_ss=False)

Experimental API . Change which coordinate set is shown for a structure. Can play through a range of coordinate sets.

structureslist of Structure

List of structures to show as assemblies.

index_range3-tuple with integer or None elements, or just None

Starting, ending and step coordinate set ids. If starting id is None start with the currently shown coordinate set. If ending id is None treat it as the last coordset. If step id is None use step 1 if start < end else step -1. Otherwise coordinate set is changed from start to end incrementing by step with one step taken per graphics frame. Negative start / end ids are relative to the (one past) the last coordinate set, so -1 refers to the last coordinate set. If index_range is just None, then treated as 1,None,None.


Collection of atoms to hold steady while changing coordinate set. The atomic structure is repositioned to minimize change in RMSD of these atoms.


Stay at each coordset for this number of graphics frames. This is to slow down playback. Default 1.


How many times to repeat playing through the coordinates in the specified range.


Whether to reverse direction instead of jumping to beginning when looping. Default false.


Whether to recompute secondary structure using dssp for every new frame. Default false.


crossfade(session, frames=30)

Experimental API . Fade from the current view to the next drawn view. Used in movie recording.


Linear interpolate between the current and next image over this number of frames.


delete(session, atoms, attached_hyds=True)

Experimental API . Delete atoms.

atomsAtoms collection

Delete these atoms. If all atoms of a model are closed then the model is closed.


devel_build(session, path, test=True, debug=False, exit=False)

Experimental API . Build a wheel in for the source code in bundle path.


Path to folder containing bundle source code or bundle alias.


Whether to run test after building wheel

devel_install(session, path, test=True, user=None, debug=False, exit=False)

Experimental API . Build and install a wheel in for the source code in bundle path.


Path to folder containing bundle source code or bundle alias.


Whether to run test after building wheel

devel_alias(session, name=None, path=None)

Experimental API . Define an alias for a folder for use in other “devel” commands.


Alias for bundle path.


Path to folder containing bundle source code.

devel_unalias(session, name)

Experimental API . Remove a bundle alias.


Alias for bundle path.

devel_clean(session, path, exit=False)

Experimental API . Remove build files from the source code in bundle path.


Path to folder containing bundle source code or bundle alias.

devel_dump(session, path)

Experimental API . Dump the bundle information for the source code in bundle path.


Path to folder containing bundle source code or bundle alias.


device_snav(session, enable=None, fly=None, speed=None)

Experimental API . Enable or disable moving models with Space Navigator input device.


Enable (true) or disable (false) use of the Space Navigator device.


Enable flying mode where the Space Navigator motions control the camera, for example pushing forward flies the camera forward. If fly is false, then the device controls the models, pushing forward would push the models away from the camera. In both cases it is actually the camera that moves.


Controls device sensitive, how fast the models move for a given device motion. Default 1.0.

vr(session, enable=None, room_position=None, display=None, show_controllers=True, gui=None, click_range=None, multishadow_allowed=False, simplify_graphics=True, toolbar_panels=True)

Experimental API . Enable stereo viewing and head motion tracking with virtual reality headsets using SteamVR.


Enable or disable use of an HTC Vive headset or Oculus Rift headset using SteamVR. The device must be connected and powered on to enable it. Graphics will not be updated in the main ChimeraX window because the different rendering rates of the headset and a conventional display will cause stuttering of the headset graphics. Also the Side View panel in the main ChimeraX window should be closed to avoid stuttering.

room_positionPlace or “report”

Maps physical room coordinates to molecular scene coordinates. Room coordinates have origin at center of room and units are meters.

display“mirror”, “independent”, or “blank”

Controls what is shown on the desktop display. The default “mirror” shows the right eye view seen in the VR headset. With “independent” the desktop display shows a separate camera view fixed in the VR room coordinates set to match the viewpoint of the VR headset when the command is issued. The value “blank” displays no graphics on the desktop display which allows all graphics computing resources to be dedicated to the VR headset rendering.


Whether to show the hand controllers in the scene. Default true.


Name of a tool instance which will be shown as the VR gui panel. If not specified then the VR gui panel consists of all tools docked on the right side of the main window.


How far away hand controller tip can be when clicking an atom in scene units (Angstroms). Default 5.


If this option is false and multi-shadow lighting is enabled (ambient occlusion) when vr is enabled, then lighting is switched to simple lighting. If the option is true then no changes to lighting mode are made. Often rendering is not fast enough to support multishadow lighting so this option makes sure it is off so that stuttering does not occur. Default False.


Adjust level-of-detail total number of triangles for atoms and bonds to a reduced value when VR is enabled, and restore to default value when VR disabled. This helps maintain full rendering speed in VR. Default true.


Whether to hide mouse modes and shortcut toolbars and instead show them as tool panels. This is useful for consolidating the controls in the VR gui panel. Default true.


distance(session, atoms, *, color=None, dashes=None, decimal_places=None, radius=None, symbol=None)

Experimental API . Show/report distance between two atoms.


Equivalent to the “log text” command.



Experimental API . Quit the program.


fitmap(session, atoms_or_map, in_map=None, subtract_maps=None, metric=None, envelope=True, zeros=False, resolution=None, shift=True, rotate=True, symmetric=False, move_whole_molecules=True, search=0, placement='sr', radius=None, cluster_angle=6, cluster_shift=3, asymmetric_unit=True, level_inside=0.1, sequence=0, max_steps=2000, grid_step_min=0.01, grid_step_max=0.5, list_fits=None, each_model=False)

Experimental API . Fit an atomic model or a map in a map using a rigid rotation and translation by locally optimizing correlation. There are four modes: 1) fit all models into map as a single rigid group, 2) fit each model into the map separately, 3) fit each model separately while subtracting others (sequence mode), or 4) use random starting positions when fitting (search mode).


Atoms or map that will be moved.


Target density map to fit into.


Subtract these maps or maps for these atoms from the target map before fitting.


Whether to fit each model independently or all as one rigid group.


Fit each model in sequence subtracting other models first for this number of specified fits.


Fit using N randomized initial placements and cluster similar results.

Fitting settings
metric‘overlap’, ‘correlation’, or ‘cam’

Optimization function to use. Overlap is pointwise sum. Cam is correlation about mean (ie. mean value is subtracted from maps before computing correlation).


Whether to consider fit only within lowest displayed contour level of moving map. If no surface exists then all grid points are used.


If envelope is false, then the zeros option determines whether grid points of the moving map with zero values are used in the fit. Default false. If envelope is true, this option is ignored and zeros inside the envelope are used.


Resolution for making simulated maps from atomic models. Required when correlation or cam metric is used and atomic models are being fit.


Allow translation when fitting.


Allow rotation when fitting.


Whether to use symmetry of the target map to take account of clashes between copies of the fit models.

max_steps: integer

Maximum number of gradient ascent steps to take


Maximum motion during a fitting step in grid index units.


The fit is considered converged when Motion less than this value (grid index units).

Search options
placement‘sr’, ‘s’, or ‘r’

Whether random placements should include shift and rotation


Limits the random placements to within this distance of the starting position.


Rotational difference for a fit to form a new cluster.


Shift difference for a fit to form a new cluster.


List only one symmetrically equivalent fit position if the target map has symmetry.


Fraction of fit atoms or map that must be inside the target map contour level in order to keep the fit.

Output options

Move entire molecules, or only the atoms that were specified.


Show the fits in a dialog.


graphics(session, background_color=None)

Experimental API . Set graphics parameters. With no options reports the current settings.


Set the graphics window background color.


help(session, topic=None, *, option=None)

Experimental API . Display help


Show documentation for the specified topic. If no topic is specified then the overview is shown. Topics that are command names can be abbreviated.


hide(session, objects=None, what=None, target=None)

Experimental API . Hide specified atoms, bonds or models.

objectsObjects or None

Atoms, bonds or models to hide. If None then all are hidden.

what‘atoms’, ‘bonds’, ‘pseudobonds’, ‘pbonds’, ‘cartoons’, ‘ribbons’, ‘models’ or None

What to hide. If None then ‘atoms’ if any atoms specified otherwise ‘models’.

targetset of “what” values, or None

Alternative to the “what” option for specifying what to hide.


info(session, models=None)

Experimental API . Report state of models, such as whether they are displayed, color, number of children, number of instances…

modelslist of models
info_bounds(session, models=None)

Experimental API . Report bounds of displayed parts of models in scene coordinates. If not models are given the bounds for the entire scene is reported.

modelslist of models


Function found in chimerax.interfaces.cmd

contacts(session, atoms=None, probe_radius=1.4, area_cutoff=300, interface_residue_area_cutoff=15)

Experimental API . Compute buried solvent accessible surface areas between chains and show a 2-dimensional network graph depicting the contacts.



ks(session, shortcut=None)

Experimental API . Enable keyboard shortcuts. Keys typed in the graphics window will be interpreted as shortcuts.


Keyboard shortcut to execute. If no shortcut is specified switch to shortcut input mode.


Function found in chimerax.label.label3d

label(session, objects=None, object_type=None, text=None, offset=None, color=None, bg_color=None, size=None, height=None, font=None, on_top=None)

Experimental API . Create atom labels. The belong to a child model named “labels” of the structure.

objectsObjects or None

Create labels on specified atoms, residues, pseudobonds, or bonds. If None then adjust settings of all existing labels.

object_type‘atoms’, ‘residues’, ‘pseudobonds’, ‘bonds’

What type of object to label.

textstring or “default”

Displayed text of the label.

offsetfloat 3-tuple or “default”

Offset of label from atom center in screen coordinates in physical units (Angstroms)

colorColor or “default”

Color of the label text. If no color is specified black is used on light backgrounds and white is used on dark backgrounds.

bg_colorColor or “none”

Draw rectangular label background in this color, or if “none”, background is transparent.

sizeint or “default”

Font size in points (1/72 inch). Default 48.

heightfloat or “fixed”

Text height in scene units. Or if “fixed” use fixed pixel height on screen. Initial value 0.7.

fontstring or “default”

Font name. This must be a true type font installed on Mac in /Library/Fonts and is the name of the font file without the “.ttf” suffix. Default “Arial”.


Whether labels always appear on top of other graphics (cannot be occluded). This is a per-structure attribute. Default True.

label_delete(session, objects=None, object_type=None)

Experimental API . Delete object labels.

objectsObjects or None

Delete labels for specified atoms, residues, pseudobonds or bonds. If None delete all labels.

object_type‘atoms’, ‘residues’, ‘pseudobonds’, ‘bonds’

What type of object label to delete.


lighting(session, preset=None, direction=None, intensity=None, color=None, fill_direction=None, fill_intensity=None, fill_color=None, ambient_intensity=None, ambient_color=None, depth_cue=None, depth_cue_start=None, depth_cue_end=None, depth_cue_color=None, move_with_camera=None, shadows=None, quality_of_shadows=None, depth_bias=None, multi_shadow=None, ms_map_size=None, ms_depth_bias=None)

Experimental API . Set lighting parameters. There are 2 directional lights, a key light and a fill light, in addition to ambient lighting. The key light can cast a shadow, and shadows cast from multiple uniformly distributed directions can produce ambient shadowing (aka “ambient occlusion”). Parameters that are not specified retain their current value. If no options are specified then the current settings are printed to the log.


Names a standard set of lighting parameters. Allowed values are “default”, “simple”, “full”, “soft” and “flat”. Simple is the same as default and has no shadows. Full includes direct and ambient shadows. Soft includes ambient shadows from 64 directions and no direct lighting. Flat has only anbient lighting and no shadows with silhouettes enabled. Specifying a preset only specifies some of the lighting parameters. Specifying other options overrides the preset values.

direction3 floats

Key light direction as vector. Does not have to have unit length. Points in the direction the light shines. The viewing direction is along -z. Initially is pointing down to the right (1,-1,-1).


Key light intensity. This is a brightness scale factor. Initial value 1.


Key light color, initial value RGB = (1,1,1).

fill_direction3 floats

Fill light direction. Initially is pointing from lower left (-0.2,-0.2,-0.959).


Fill light intensity. Initial value 0.5.


Fill light color, initial value RGB = (1,1,1).


Ambient light intensity. Initial value 0.4.


Ambient color, initial value RGB = (1,1,1).


Whether to dim scene with depth.


Fraction of distance from near to far clip plane where dimming starts. Initial value 0.5


Fraction of distance from near to far clip plane where dimming ends. Initial value 1.


Color to fade towards, initial value RGB = (0,0,0).


Whether light directions move with the camera or are fixed in scene coordinates. Initial value true.


Whether to show shadows. Initial value false.

quality_of_shadowsstring or int

Shadows are rendered with a 2 dimensional texture. Pixelated shadow edges result from using small texture sizes. Value can be “coarse” (1024), “normal” (2048), “fine” (4096), “finer” (8192), or an integer value can be specified.


To avoid a surface shadowing itself due to numerical rounding errors an bias distance is used. This is a fraction of the scene diameter. Initial value 0.005.


How many directions to use for casting ambient shadows. Value 0 means no ambient shadows. The soft preset uses 64 directions. Initial value 0.


Size of one 2-dimensional texture holding all the ambient shadow maps. Small values give coarser shadows that give a smoother appearance when many shadows ar rendered. Initial value 1024.


Depth bias to avoid surface self shadowing for ambient shadows as a fraction of the scene diameter. Because small shadow map sizes are typically used a larger bias is needed than for directional shadows. Initial value 0.01.


Function found in chimerax.log.cmd

log(session, thumbnail=False, text=None, html=None, width=100, height=100, warning_dialog=None, error_dialog=None)

Experimental API . Operations on the Log window.


Save log contents as html to a file.


Place a thumbnail image of the current graphics in the log.


Height in pixels of thumbnail image.


Width in pixels of thumbnail image.


If true, warnings popup a separate dialog, if false no warning dialog is shown. In either case the warning appears in the log text.


If true, errors popup a separate dialog, if false no error dialog is shown. In either case the errors appears in the log text.


material(session, preset=None, reflectivity=None, specular_reflectivity=None, exponent=None, ambient_reflectivity=None, transparent_cast_shadows=None)

Experimental API . Change surface material properties controlling the reflection of light. Currently all models use the same material properties.


Can be “default”, “shiny” or “dull”. Default sets all material properties to there default values. Shiny sets specular reflectivity to 1. Dull sets specular reflectivity to 0.


Fraction of directional light reflected diffusely (reflected equally in all directions). Initial value 0.8.


Fraction of key light reflected specularly (mirror reflection with some spread given by exponent. Initial value 0.8.


Controls specularly reflected light scaling intensity by a factor of cosine(x) raised to the exponent power, where x is the between the mirror reflection direction and the view direction. Larger values produce smaller specular highlight spots on surfaces. Initial value 30.


Fraction of ambient light reflected. Initial value 0.8.


Whether transparent objects cast shadows. If set to true then transparent objects cast a shadows as if the objects are opaque making everything inside appear black. Raytracing would be required to render a partial shadow, and we don’t support that. Initial value is false.


measure_buriedarea(session, atoms1, with_atoms2=None, probe_radius=1.4, list_residues=False, cutoff_area=1, color=None, select=False)

Experimental API . Compute buried solvent accessible surface (SAS) area between two sets of atoms. This is the sum of the SAS area of each set of atoms minus the SAS area of the combined sets of atoms, that difference divided by two since each set of atoms has surface at the interface, so the interface area is defined as half the buried area. Atoms not specified in either atom set are ignored when considering where the probe sphere can reach.


First set of atoms.


Second set of atoms – must be disjoint from first set.


Radius of the probe sphere.


Whether to report a list of contacting residues for each set of atoms.


Per-residue minimum area for listing residues.

colorColor or None

Color contacting residues.


Whether to select contacting residues.

measure_convexity(session, surfaces, palette=None, range=None, smoothing_iterations=5, write_surface_data=None, patches=None)

Experimental API . Compute the convexity at each surface vertex defined as 2*pi minus the cone-angle spanned by the triangles incident at the vertex. The surface vertices are colored based on convexity value.

This definition of convexity is not standard and gives mottled coloring because the values depend strongly on the triangulation. Vertices surrounded by large triangles on a smooth surface will have sharper cone angles then vertices surrounded by small triangles. (Normalizing by vertex triangle areas does not help because the patch about a vertex is often irregular in shape.) To ameliorate this the “smoothing_iterations” option is useful.

surfaceSurface list

Default color palette is cyan-gray-maroon.

range2-tuple of float or “full”

Minimum and maximum convexity values corresponding to ends of color palette.


Convexity values are averaged with neighbor vertices connected by an edge. This value specifies how many rounds of smoothing to perform. Default 5.


File path to write a text file containing surface data. One line for each surface vertex gives vertex number (starting at 0), xyz position, normal vector, and (smoothed) convexity value. Vertex lines are followed by surface triangle data, one line per triangle giving triangle number and 3 vertex numbers for the triangle corners. The vertex data and triangle data begin with comment lines starting with the “#” character. If multiple surfaces are specified the vertex/triangle data sections for each surface are appended to the file.


Instead of coloring by convexity value, color each connected patch with convexity above the specified value a unique color.

measure_length(session, bonds)

Experimental API . Compute sum of length of bonds.

measure_sasa(session, atoms=None, probe_radius=1.4, sum=None, set_attribute=True)

Experimental API . Compute solvent accessible surface area.


A probe sphere is rolled over these atoms ignoring collisions with any other atoms.


Radius of the probe sphere.


Sum the accessible areas per atom only over these atoms.


Whether to set atom.area and residue.area values.


Function found in chimerax.mlp.mlp

mlp(session, atoms=None, method='fauchere', spacing=1.0, max_distance=5.0, nexp=3.0, color=True, palette=None, range=None, map=False)

Experimental API . Display Molecular Lipophilic Potential for a single model.


Color surfaces for these atoms using MLP map. Only amino acid residues are used.


Distance dependent function to use for calculation


Grid spacing, default 1 Angstrom.


Maximum distance from atom to sum lipophilicity. Default 5 Angstroms.


The buckingham method uses this numerical exponent.


Whether to color molecular surfaces. They are created if they don’t yet exist.


Color palette for coloring surfaces. Default is lipophilicity colormap (orange lipophilic, blue lipophobic).

range2-tuple of float

Range of lipophilicity values defining ends of color map. Default is -20,20


Whether to open a volume model of lipophilicity values


molmap(session, atoms, resolution, grid_spacing=None, edge_padding=None, on_grid=None, cutoff_range=5, sigma_factor=0.22507907903927651, balls=False, symmetry=None, center=None, axis=None, coordinate_system=None, display_threshold=0.95, model_id=None, replace=True, show_dialog=True)

Experimental API . Create a density map by placing Gaussians centered on atoms.


Default is 1/3 resolution.


Default is 3 times resolution.


In standard deviations.


Scale factor equal to standard deviation / resolution, default 1/(pi*sqrt(2)).


Use balls instead of Gaussians

symmetrySymmetry object or None.

Apply symmetry operations to atoms

centerCenter object or None

Center of symmetry.

axisAxis object or None

Axis of symmetry.


Coordinate system of symmetry.


Initial contour level as fraction of total density, default 0.95.

model_idlist of integers

Default true

show_dialogbool, not supported


Function defined in chimerax.morph.morph

morph(session, structures, frames=20, wrap=False, rate='linear', method='corkscrew', cartesian=False, same=False, core_fraction=0.5, min_hinge_spacing=6, hide_models=True, play=True, slider=True, color_segments=False, color_core=None)

Experimental API . Morph between atomic models using Yale Morph Server algorithm.

structureslist of Structure

Configurations to morph


Number of frames for each morph segment. One less than this value is new configurations are inserted between every pair of structures given.


If true then morph continues from last structure to first. This is the same as if the first structure is appended to structures to morph.

rate‘linear’, ‘ramp down’, ‘ramp up’ or ‘sinusoidal’

The rate of morphing from one state to the next.

method‘corkscrew’, ‘linear’

How hinged groups of atoms are morphed.


Whether to interpolate x,y,z atom coordinates or use internal coordinates which preserve bond lengths.


Whether to match atoms with same chain id, same residue number and same atom name. Default false.


Fraction of residues of each chain that align best used to define core and non-core residues which are then split into contiguous residues stretches where the chain crosses between the two residue sets. Default 0.5.


Minimum number of consecutive residues when splitting chains into rigidly moving segments at boundaries between core and non-core residues. Default 6.


Whether to hide the input models after morph model is created. Default true.


Whether to play the morph. Default true.


Whether to show a slider to play through the morph. Default true.


Whether to color the residues for each rigid segment with a unique color. This is to see how the morph algorithm divided the structure into segments. For morphing a sequence of 3 or more structures only the residues segments for the morph between the first two in the sequence is shown. Segments are recomputed for each consecutive pair in the sequence. Default false.

color_coreColor or None

Color the core residues the specified color. This is to understand what residues the algorithm calculates to be the core.


move(session, axis, distance=None, frames=None, coordinate_system=None, models=None, atoms=None)

Experimental API . Shift the scene. Actually the camera is shifted and the models stay fixed unless the models option is specified in which case the model coordinate systems are moved, or if atoms is specifed the atom coordinates are moved.


Defines the axis in scene coordinates to shift along.


Distance to shift in scene units.


Repeat the shift for N frames.


The coordinate system for the axis. If no coordinate system is specified then scene coordinates are used.

modelslist of Models

Move the coordinate systems of these models. Camera is not moved.


Change the coordinates of these atoms. Camera is not moved.


Functions defined in

movie_record(session, directory=None, pattern=None, format=None, size=None, supersample=1, limit=90000)

Experimental API . Start recording a movie.


A temporary directory for saving image files before the movie is encoded. If a directory is specified, it must already exist – it will not be created. If no directory is specified a temporary system directory is created.


File name including a “*” character that is substituted with the frame number when saving images.


Image file format (default ppm) for saving frames. Possible values ppm, png, jpeg. ppm is fastest but takes the most disk space because it is not compressed.

size2 int

Width and height in pixels of movie.


Amount of supersampling when saving individual image frames.


Maximum number of frames to save. This is a safe guard so that the entire computer disk storage is not filled with images if a movie recording is never stopped.

movie_encode(session, output=None, format=None, quality=None, qscale=None, bitrate=None, framerate=25, round_trip=False, reset_mode='clear', wait=False, verbose=False)

Experimental API . Enode images captured with movie record command creating a movie file. This uses the standalone video encoding program ffmpeg which is included with ChimeraX.

outputlist of strings

Filenames of movie output files. By specifying multiple files, different video encoding formats can be made.


Format of video file to write. If not specified, the file suffix determines the format. Use of a .mp4 file suffix and h264 format is by far the best choice. Allowed formats (file suffix) are: h264 (.mp4), mov (.mov), avi (.avi), wmv (.wmv).


Quality of video, higher quality results in larger file size. Qualities are “highest”, “higher”, “high”, “good”, “medium”, “fair”, “low”. Default “good”. This overrides the qscale and bitrate options.


Quality scale parameter used by some video codecs. This overrides the bitrate option.


Target bit rate for video encoding in Kbits/second.


Frames per second that video should playback at in a video player.


If true, the images are played forward and than backward so movie ends where it began. This is used for making movies that loop without a jump between the last frame and first frame.


Whether to keep or delete the image files that were captured after the video files is made. Values are “clear”, “keep” or “none”. Default “clear” means the image files are deleted.


Whether to wait until movie encoding is finished before the command returns. Default false means the command can return before the video encoding is complete.

movie_crossfade(session, frames=25)

Experimental API . Linear interpolate between the current graphics image and the next image over a specified number of frames.

movie_duplicate(session, frames=25)

Experimental API . Repeat the current image frame a specified number of frames so that the video does not change during playback.


Experimental API . Stop recording video frames. Using the movie encode command also stops recording.


Experimental API . Stop movie recording and delete any recorded frames.

movie_reset(session, reset_mode='clear')

Experimental API . Clear images saved with movie record.

movie_ignore(session, ignore=True)

Experimental API . Ignore subsequent movie commands except for the movie ignore command. This can be used to run a movie recording script without recording the movie.


Experimental API . Report recording status such as number of frames saved to the log.


Experimental API . Report the available video formats to the log.


mseries(session, models, pause_frames=10, loop=1, step=1)

Experimental API . Display series of models one after another.

modelslist of Model

Sequence of models to show.


Number of frames to show each model. Default 10.


How many times to repeat playing through the models. Default 1.


Show every Nth model with N given by step, default 1.

mseries_slider(session, models, pause_frames=10, step=1, movie_framerate=25)

Experimental API . Show slider to play through (i.e. display) a series of models.

modelslist of Model

Sequence of models to show.


Number of frames to show each model. Default 10.


Show every Nth model with N given by step, default 1.


Frames per second used when playing back a movie recorded with the record button.


open(session, filename, format=None, name=None, from_database=None, ignore_cache=False, **kw)

Experimental API . Open a file.

filenamestring or list of strings

A path to a file (relative to the current directory), or a database id code to fetch prefixed by the database name, for example, pdb:1a0m, mmcif:1jj2, emdb:1080. A 4-letter id that is not a local file is interpreted as an mmCIF fetch. Also allows a list of filenames and ids.


Read the file using this format, instead of using the file suffix to infer the format.


Name to use for data set. If none specified then filename is used.


Database to fetch from. The filename is treated as a database identifier.


Whether to fetch files from cache. Fetched files are always written to cache.


pdbimages(session, directory='.', subdirectories=True, width=400, height=400, supersample=2, image_suffix='.png', exclude=['1m4x.cif'], log_file=None)

Experimental API . Assembly images command for batch rendering mmCIF assembly images. This is for the Protein DataBank to render images.


Find all files with suffix .cif in this directory and recursively in subdirectories.


Whether to recursively search subdirectories for .cif files.


Width in pixels of saved image.


Height in pixels of saved image.


Supersampling makes image N-fold larger than averages down to smooth object images.


File suffix for images, used to determine image format (e.g. .png, .jpg, .tif)

excludelist of strings

File names to exclude from rendering (some large files cause graphics crashes).


Path to file to write log messages as each mmCIF file is rendered.


perframe(session, command, frames=None, interval=1, format=None, zero_pad_width=None, ranges=None, show_commands=False)

Experimental API . Execute specified command each frame, typically used during movie recording.


The command to be run each frame, optionally containing “$1” which will be replaced by the frame number starting at 0.


Number of frames to execute the specified command.


Run the command only every Kth frame.


Printf style format (e.g. %d, %.3f) for substituting value in for $1.


Field width in characters used when substituting $1 left padded with zeros.

rangeslist of tuples of 2 or 3 int

start,end[,step] integer or float range of values to substitute for $1 instead of frame number.


Whether to echo commands to log.



Experimental API . Report the current directory to the log.


rainbow(session, objects, level='residues', target=None, transparency=None, palette=None)

Experimental API . Color residues or chains by sequence using a color map. Arguments are the same as for the color command.


rename(session, models, name=None, id=None)

Experimental API . Rename a model. Might extend this command in the future to rename chains, residues, atoms…

modelslist of models
idtuple of integers


resfit(session, atoms, map=None, residue_range=(-2, 1), motion_frames=50, pause_frames=50, movie_framerate=2)

Experimental API . Display fit of each residue in a density map.


Atoms from one chain or part of a chain.


Density map to show near each residue.


roll(session, axis=<chimerax.core.commands.Axis object at 0x128475350>, angle=1, frames=-1, rock=None, center=None, coordinate_system=None, models=None, atoms=None)

Experimental API . Rotate the scene. Same as the turn command with infinite frames argument and angle step 1 degree.


Defines the axis to rotate about.


Rotation angle in degrees.


Repeat the rotation for N frames, typically used in recording movies.


Repeat the rotation reversing the direction every N/2 frames. The first reversal occurs at N/4 frames so that the rocking motion is centered at the current orientation.


Specifies the center of rotation. If not specified, then the current center of rotation is used.


The coordinate system for the axis and optional center point. If no coordinate system is specified then scene coordinates are used.

modelslist of Models

Move the coordinate systems of these models. Camera is not moved.


Change the coordinates of these atoms. Camera is not moved.


run(session, text, *, log=True, downgrade_errors=False)

Experimental API . execute a textual command


The text of the command to execute.


Print the command text to the reply log.


True if errors in the command should be logged as informational.


save(session, filename, models=None, format=None, **kw)

Experimental API . Save data, sessions, images.


File to save. File suffix determines what type of file is saved unless the format option is given. For sessions the suffix is .cxs. Image files can be saved with .png, .jpg, .tif, .ppm, .gif suffixes.

modelslist of Model or None

Models to save


Recognized formats are session, or for saving images png, jpeg, tiff, gif, ppm, bmp. If not specified, then the filename suffix is used to identify the format.


select(session, objects=None, polymer=None, residues=False, minimum_length=None, maximum_length=None, sequence=None)

Experimental API . Select specified objects.


Replace the current selection with the specified objects (typically atoms). If no objects are specified then everything is selected.


Extend atoms that are selected to containing residues if true (default false).


Reduce the selection to include only atoms belonging to chains having a sequence that is the same as one of the sequences specified by the polymer option.

minimum_lengthfloat or None

Exclude pseudobonds shorter than the specified length. If this option is specified all non-pseudobond objects are also excluded.

maximum_lengthfloat or None

Exclude pseudobonds longer than the specified length. If this option is specified all non-pseudobond objects are also excluded.

sequencestring or None

Regular expression of sequence to match. Will be automatically upcased.


set(session, bg_color=None, silhouettes=None, silhouette_width=None, silhouette_color=None, silhouette_depth_jump=None, selection_color=None, selection_width=None, subdivision=None, max_frame_rate=None)

Experimental API . Set global parameters. With no options reports the current settings.


Set the graphics window background color.


Enable or disable silhouette edges (black lines drawn at boundaries of objects where the depth of the scene jumps.


Width in pixels of silhouette edges. Minimum width is 1 pixel.


Color of silhouette edges.


Fraction of scene depth giving minimum depth change to draw a silhouette edge. Default 0.03.


Color to use when outlining selected objects. Initially green.


Width in pixels of the selection outline. Initially 1 (or 2 for high DPI screens).


Controls the rendering quality of spheres and cylinders for drawing atoms and bonds. Default value is 1, higher values give smoother spheres and cylinders.


Maximum frames per second to render graphics. The default frame rate is 60 frames per second. A slower rate is sometimes useful when making movies to preview at the slower movie playback rate.


show(session, objects=None, what=None, target=None, only=False)

Experimental API . Show specified atoms, bonds or models.

objectsObjects or None

Atoms, bonds or models to show. If None then all are shown. Objects that are already shown remain shown.

what‘atoms’, ‘bonds’, ‘pseudobonds’, ‘pbonds’, ‘cartoons’, ‘ribbons’, ‘surfaces’, ‘models’ or None

What to show. If None then ‘atoms’ if any atoms specified otherwise ‘models’.

targetset of “what” values, or None

Alternative to the “what” option for specifying what to show.


Show only the specified atoms/bonds/residues in each specified molecule. If what is models then hide models that are not specified.


size(session, objects=None, atom_radius=None, stick_radius=None, pseudobond_radius=None, ball_scale=None)

Experimental API . Set the sizes of atom and bonds.


Change the size of these atoms, bonds and pseudobonds. If not specified then all are changed.

atom_radiusfloat or “default”

New radius value for atoms.


New radius value for bonds shown in stick style.


New radius value for pseudobonds.


Multiplier times atom radius for determining atom size in ball style (default 0.3).


smoothlines(session, models, step_factor=0.1, iterations=10, replace=False)

Experimental API . Smooth surface models consisting of lines. Each vertex is moved the fraction step_factor towards the average position of it and its connected neighbors. This is repeated for the specified number of iterations. A new model is created unless the replace option is given in which case the current model is changed.

modelslist Surface

The surfaces must consist of line segments.


Fraction of distance to move each vertex toward average of itself and connected neighbors. Default 0.1


Number of times to repeat smoothing. Default 10.


Whether to replace the lines in the existing model, or make a new model.


split(session, structures=None, chains=None, ligands=False, connected=False, atoms=None)

Experimental API . Partition atoms into separate structures. If only the first argument is given then those structures are split into a separate structure for each chain. If chains, ligands, connected, or atoms keywords are given then additional partitioning into smaller subsets is performed.

StructuresStructures or None

Structures to split. If no structures specified then all are used.


Split each chain into into a separate atomic structure.


Split each connected ligand into a separate atomic structure.


Split each connected subset of atoms into a separate atomic structure.

atomslist of Atoms

Split specified atoms into separate atomic structures. This option can be specified multiple times.



Experimental API . Stop a motion initiated with turn, roll or move with the frames argument.


struts(session, atoms, length=7.0, loop=30.0, radius=0.6, color=None, fatten_ribbon=True, replace=True, name=None, model_id=None)

Experimental API . Create fake bonds between atoms of a structure in order to strengthen it for 3d printing.


Set of atoms to use as strut end-points.


The maximum length of a strut. Default 7.0.


Add struts between atoms when their through-bond distance from each other is greater than this loop distance. Default 30.


Radius for drawing the strut cylinders. Default 0.6.


Make the struts this color. Default gray.


Increase ribbon thickness to make it stronger for printing. Default true.


Whether to replace or keep previously calculated struts.


Name for the strut model.

model_idtuple of integers

Model id number for strut model.

struts_delete(session, atoms=None)

Experimental API . Delete struts between the specified atoms.


style(session, objects=None, atom_style=None, dashes=None, ring_fill=None)

Experimental API . Set the atom and bond display styles.


Change the style of these atoms, bonds and pseudobonds. If not specified then all atoms are changed.

atom_style“sphere”, “ball” or “stick”

Controls how atoms and bonds are depicted.


Optional number of dashes shown for pseudobonds.

ring_fillOptional “thick”, “thin”, or “off”.


surface(session, atoms=None, enclose=None, include=None, probe_radius=None, grid_spacing=None, resolution=None, level=None, color=None, transparency=None, visible_patches=None, sharp_boundaries=None, nthread=None, replace=True)

Experimental API . Compute and display solvent excluded molecular surfaces.


Atoms controlling which surface patch is shown. Surfaces are computed for each chain these atoms belong to and patches of these surfaces near the specifed atoms are shown. Solvent, ligands and ions are excluded from each chain surface.


Make a surface enclosing exactly these specified atoms excluding solvent, ligands and ions


Solvent, ligands or ions to include in the surface.


Radius of probe sphere rolled over atoms to produce surface. Only used for solvent excluded surfaces. Default is 1.4 Angstroms.


Surface is computed on 3-dimensional grid with this spacing between grid points along each axis.


Specifying a resolution value (Angstroms) causes the surface calculation to use a contour surface of a 3-d grid of a sum of Gaussians one centered at each atom instead of a solvent excluded surface. See the molmap command for details. A resolution of 0 computes an SES surface.


Contour level for Gaussian surface in atomic number units. Each Gaussian has height scaled by the atom atomic number.


Colors surfaces using this color.


Percentage transparency for surfaces.


Maximum number of connected surface pieces per chain to show.


Make the surface triangulation have edges exactly between atoms so per-atom surface colors and surface patches have smoother edges.


Number of CPU threads to use in computing surfaces.


Whether to replace an existing surface for the same atoms or make a copy.

surface_close(session, objects=None)

Experimental API . Close molecular surfaces.


Close specified molecular surfaces and surfaces for specified atoms.

surface_hide(session, objects=None)

Experimental API . Hide patches of existing surfaces for specified atoms.


Hide atom patches for specified molecular surfaces or for specified atoms.

surface_show(session, objects=None)

Experimental API . Show surface patches for atoms of existing surfaces.


Show atom patches for existing specified molecular surfaces or for specified atoms.

surface_style(session, surfaces, style)

Experimental API . Show surface patches for atoms of existing surfaces.

surfacesModel list
style“mesh”, “dot” or “solid”
surface_cap(session, enable=None, offset=None, subdivision=None)

Experimental API . Control whether clipping shows surface caps covering the hole produced by the clip plane.


Caps are current enabled or disabled for all models, not on a per-model basis.


Offset of clipping cap from plane in physical units. Some positive offset is needed or the clip plane hides the cap. Default 0.01.


How small to make the triangles that compose the cap. Smaller triangles give finer appearance with per-vertex coloring. Default 1.0. Value of 0 means no subdivision and the triangles are long and skinny with one triangle spanning from edge to edge of the cap. Higher values give smaller triangles, for example a value of 2 gives triangles twice as small a value of 1. A value of 1 makes triangles with edges that are about the length of the edge lengths on the perimeter of the cap which are usually comparable to the size of the triangles of the surface that is being clipped.

surface_dust(session, surfaces, metric='size', size=5, update=True)

Experimental API . Hide connected surface patchs smaller than a specified size.

surfacesModels list

Surface models to act on.

metricOne of ‘size’, ‘area’, ‘volume’, ‘size rank’, ‘area rank’, ‘volume rank’

Use this size metric. Rank metrics hide patches smaller than the N largest.


Hide patches smaller than this size.


Whether to update dust hiding when surface shape changes.

surface_undust(session, surfaces)

Experimental API . ..

!! processed by numpydoc !!

surface_zone(session, surfaces, near_atoms=None, distance=2, max_components=None, bond_point_spacing=None, update=True)

Experimental API . Hide parts of a surface beyond a given distance from specified atoms.

surfacesModel list

Surface models to act on.


Display only surface triangles that have all vertices within a specified distance of at least one of these atoms.


Maximum distance from atoms.


Show at most this number of connected surface patches, hiding the smaller ones. The limit applies for each surface model.


Include points along bonds between the given atoms at this spacing.


Whether to recompute the zone when the surface geometry changes.

surface_unzone(session, surfaces)

Experimental API . ..

!! processed by numpydoc !!


sym(session, structures, symmetry=None, center=None, axis=None, coordinate_system=None, assembly=None, copies=False, new_model=None, surface_only=False, resolution=None, grid_spacing=None)

Experimental API . Show molecular assemblies of molecular models defined in mmCIF files. These can be subassemblies or symmetrical copies with individual chains placed according to matrices specified in the mmCIF file.

structureslist of AtomicStructure

List of structures to show as assemblies.


Desired symmetry to display


Center of symmetry. Default 0,0,0.


Axis of symmetry. Default z.


Transform mapping coordinates for center and axis arguments to scene coordinates.


The name of assembly in the mmCIF file. If this parameter is None then the names of available assemblies are printed in log.


Whether to make copies of the molecule chains. If copies are not made then graphical instances of the original molecule are used. Copies are needed to give different colors or styles to each copy. When copies are made a new model with submodels for each copy are created.


Copy the structure to create the assembly. Default is True if an assembly is specified and false if the symmetry option is given. If the copies option is true then new_model is automatically true. If copies is false and new_model is true then one copy of the structure for each set of position matrices is used, and additional copies use graphical instances. If copies is false and new_model is false then instances of the original structure is used. If there is more than one set of position matrices, then copies are required and an error message is given.


Instead of showing instances of the molecule, show instances of surfaces of each chain. The chain surfaces are computed if they do not already exist. It is an error to request surfaces only and to request copies.


Resolution for computing surfaces when surface_only is true.


Grid spacing for computing surfaces when surface_only is true.


time(session, command)

Experimental API . Time a command.


toolshed_list(session, bundle_type='installed', full=False, outdated=False, newest=True)

Experimental API . List installed bundles in the log.


Types are “installed”, “available”, or “all”

toolshed_reload(session, reload_type='installed')

Experimental API . Rebuild the bundle metadata cache using information from currently installed bundle.

toolshed_install(session, bundle_name, user_only=True, reinstall=None, version=None)

Experimental API . Install a bundle.


Install for this user only, or install for all users.

toolshed_uninstall(session, bundle_name, force_remove=False)

Experimental API . Uninstall an installed bundle.

toolshed_url(session, url=None, wait=False)

Experimental API . Show or set toolshed URL

toolshed_show(session, tool_name, _show=True)

Experimental API . Show a tool, or start one if none is running.

toolshed_hide(session, tool_name)

Experimental API . Hide tool.



transparency(session, objects, percent, what=None, target=None)

Experimental API . Set transparency of atoms, ribbons, surfaces, ….

objectsObjects or None

Which objects to set transparency.


Percent transparent from 0 completely opaque, to 100 completely transparent.


Characters indicating what to make transparent: a = atoms, b = bonds, p = pseudobonds, c = cartoon, r = cartoon, s = surfaces, A = all


turn(session, axis=<chimerax.core.commands.Axis object at 0x128606190>, angle=90, frames=None, rock=None, center=None, coordinate_system=None, models=None, atoms=None)

Experimental API . Rotate the scene. Actually the camera is rotated about the scene center of rotation unless the models argument is specified in which case the model coordinate systems are moved, or if atoms is specifed the atom coordinates are moved.


Defines the axis to rotate about.


Rotation angle in degrees.


Repeat the rotation for N frames, typically used in recording movies.


Rotate +/- angle degrees repeating, one cycle every specified number of frames. The rocking steps are small at the ends of the rock, using sine modulation. If the frames option is not given the rocking continues indefinitely.


Specifies the center of rotation. If not specified, then the current center of rotation is used.


The coordinate system for the axis and optional center point. If no coordinate system is specified then scene coordinates are used.

modelslist of Models

Move the coordinate systems of these models. Camera is not moved.


Change the coordinates of these atoms. Camera is not moved.


ui_autostart(session, do_start, tool_name)

Experimental API . Control whether a tool is launched at ChimeraX startup

ui_dockable(session, dockable, tool_name)

Experimental API . Control whether a tool’s windows are dockable

ui_mousemode(session, left_mode=None, middle_mode=None, right_mode=None, wheel_mode=None, pause_mode=None, alt=None, command=None, control=None, shift=None)

Experimental API . Set or list mouse modes. If no options given lists mouse modes.


Bind the left mouse button to mouse mode.


Bind the middle mouse button to mouse mode.


Bind the right mouse button to mouse mode.


Bind the mouse wheel to mouse mode.


Bind mouse hover to mouse mode.


view(session, objects=None, frames=None, clip=True, cofr=True, orient=False, pad=0.05, need_undo=True)

Experimental API . Move camera so the displayed models fill the graphics window. Also camera and model positions can be saved and restored. Adjust camera to view all models if objects is None.


Move camera so the bounding box of specified objects fills the window.


Interpolate to the desired view over the specified number of frames.


Turn on clip planes in front and behind objects.


Set center of rotation to center of objects.


Specifying the orient keyword moves the camera view point to look down the scene z axis with the x-axis horizontal and y-axis vertical.


When making objects fit in window use a window size reduced by this fraction. Default value is 0.05. Pad is ignored when restoring named views.


Whether to create undo action

view_delete(session, name)

Experimental API . Delete named saved view.


Name of the view. “all” deletes all named views.

view_initial(session, models=None)

Experimental API . Set models to initial positions.


Set model positions to no rotation, no shift.


Experimental API . Print the named camera views in the log.

The names are links and clicking them show the corresponding view.

view_matrix(session, camera=None, models=None, coordinate_system=None)

Experimental API . Set model and camera positions. With no options positions are reported for the camera and all models. Positions are specified as 12-numbers, the rows of a 3-row, 4-column matrix where the first 3 columns are a rotation matrix and the last column is a translation applied after the rotation.


Set the camera position.

modelslist of (Model, Place)

Set model positions.


Treat camera and model positions relative to this coordinate system. If none, then positions are in scene coordinates.

view_name(session, name)

Experimental API . Save current view as given name.


Name the current camera view and model positions so they can be shown later with the “show” option.


volume(session, volumes=None, style=None, show=None, hide=None, toggle=None, level=None, rms_level=None, sd_level=None, enclose_volume=None, fast_enclose_volume=None, color=None, brightness=None, transparency=None, appearance=None, step=None, region=None, name_region=None, expand_single_plane=None, origin=None, origin_index=None, voxel_size=None, planes=None, dump_header=None, pickable=None, symmetry=None, center=None, center_index=None, axis=None, coordinate_system=None, data_cache_size=None, show_on_open=None, voxel_limit_for_open=None, show_plane=None, voxel_limit_for_plane=None, show_outline_box=None, outline_box_rgb=None, outline_box_linewidth=None, limit_voxel_count=None, voxel_limit=None, color_mode=None, colormap_on_gpu=None, colormap_size=None, blend_on_gpu=None, projection_mode=None, plane_spacing=None, full_region_on_gpu=None, bt_correction=None, minimal_texture_memory=None, maximum_intensity_projection=None, linear_interpolation=None, dim_transparency=None, dim_transparent_voxels=None, line_thickness=None, smooth_lines=None, mesh_lighting=None, two_sided_lighting=None, flip_normals=None, subdivide_surface=None, subdivision_levels=None, surface_smoothing=None, smoothing_iterations=None, smoothing_factor=None, square_mesh=None, cap_faces=None, box_faces=None, orthoplanes=None, position_planes=None, calculate_surfaces=None)

Experimental API . Control the display of density maps.

volumeslist of maps
style“surface”, “mesh”, or “image”
levelsequence of 1 or 2 floats

In image style 2 floats are used the first being a density level and second 0-1 brightness value.

stepsequence of 3 integers
regionsequence of 6 integers

3 minimum grid indices and 3 maximum grid indices for x,y,z axes.

originsequence of 3 floats
origin_indexsequence of 3 floats
voxel_sizesequence of 3 floats
planestuple of (axis, start, end, increment, depth), last 3 are optional
Symmetry assignment options

Parsed as 3 comma-separated floats, or an atom specifier

center_indexsequence of 3 floats
axissequence of 3 floats

Coordinate system for axis and center symmetry options

Global options

In Mbytes

Rendering options

Auto-adjust step size.

voxel_limitfloat (Mvoxels)

Image rendering pixel formats: ‘auto4’, ‘auto8’, ‘auto12’, ‘auto16’, ‘opaque4’, ‘opaque8’, ‘opaque12’, ‘opaque16’, ‘rgba4’, ‘rgba8’, ‘rgba12’, ‘rgba16’, ‘rgb4’, ‘rgb8’, ‘rgb12’, ‘rgb16’, ‘la4’, ‘la8’, ‘la12’, ‘la16’, ‘l4’, ‘l8’, ‘l12’, ‘l16’


Whether colormapping is done on gpu or cpu for image rendering.


Size of colormap to use for image rendering.


Whether image blending is done on gpu or cpu.


One of ‘auto’, ‘2d-xyz’, ‘2d-x’, ‘2d-y’, ‘2d-z’, ‘3d’

plane_spacing“min”, “max”, “mean” or float

Spacing between planes when using 3d projection mode. “min”, “max”, “mean” use minimum, maximum or average grid spacing along x,y,z axes.


Whether to cache data on GPU for fast cropping.


Brightness and transparency view angle correction for image rendering mode.


Reduce graphics memory use for image rendering at the expense of rendering speed.


Interpolate gray levels in image style rendering.


Makes transparent surfaces dimmer


For image rendering.

orthoplanesOne of ‘xyz’, ‘xy’, ‘xz’, ‘yz’, ‘off’
position_planessequence of 3 integers

Intersection grid point of orthoplanes display


Whether to calculate surfaces immediately instead of waiting until they are drawn.

volume_add(session, volumes, on_grid=None, bounding_grid=None, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, in_place=False, scale_factors=None, model_id=None)

Experimental API . Add maps.

volume_bin(session, volumes, subregion='all', step=1, bin_size=(2, 2, 2), model_id=None)

Experimental API . Reduce map by averaging over rectangular bins.

volume_boxes(session, volumes, centers, size=0, isize=None, use_marker_size=False, subregion='all', step=1, model_id=None)

Experimental API . Extract boxes centered at marker positions.

volume_cover(session, volumes, atom_box=None, pad=5.0, box=None, x=None, y=None, z=None, f_box=None, fx=None, fy=None, fz=None, i_box=None, ix=None, iy=None, iz=None, use_symmetry=True, cell_size=None, step=(1, 1, 1), model_id=None)

Experimental API . Extend a map using symmetry to cover a specified region.

volume_falloff(session, volumes, iterations=10, in_place=False, subregion='all', step=1, model_id=None)

Experimental API . Smooth edges of a masked map.

volume_flatten(session, volumes, method='multiplyLinear', fitregion=None, subregion='all', step=1, model_id=None)

Experimental API . Make map background flat.

volume_flip(session, volumes, axis='z', subregion='all', step=1, in_place=False, model_id=None)

Experimental API . Flip a map axis reversing the hand.

volume_fourier(session, volumes, subregion='all', step=1, model_id=None, phase=False)

Experimental API . Fourier transform a map

volume_gaussian(session, volumes, s_dev=(1.0, 1.0, 1.0), subregion='all', step=1, value_type=None, invert=False, model_id=None)

Experimental API . Smooth maps by Gaussian convolution.

volume_laplacian(session, volumes, subregion='all', step=1, model_id=None)

Experimental API . Detect map edges with Laplacian filter.

volume_local_correlation(session, volumes, window_size=5, subtract_mean=False, model_id=None)

Experimental API . Compute correlation between two maps over a sliding window.

volume_maximum(session, volumes, on_grid=None, bounding_grid=None, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, in_place=False, scale_factors=None, model_id=None)

Experimental API . Pointwise maximum of maps.

volume_median(session, volumes, bin_size=(3, 3, 3), iterations=1, subregion='all', step=1, model_id=None)

Experimental API . Replace map values with median of neighboring values.

volume_minimum(session, volumes, on_grid=None, bounding_grid=None, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, in_place=False, scale_factors=None, model_id=None)

Experimental API . Pointwise minimum of maps.

volume_morph(session, volumes, frames=25, start=0, play_step=0.04, play_direction=1, play_range=None, add_mode=False, constant_volume=False, scale_factors=None, hide_original_maps=True, interpolate_colors=True, subregion='all', step=1, model_id=None)

Experimental API . Linearly interpolate pointwise between maps.

volume_multiply(session, volumes, on_grid=None, bounding_grid=None, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, in_place=False, scale_factors=None, model_id=None)

Experimental API . Pointwise multiply maps.

volume_octant(session, volumes, center=None, i_center=None, subregion='all', step=1, in_place=False, fill_value=0, model_id=None)

Experimental API . Extract an octant from a map.

volume_permute_axes(session, volumes, axis_order='xyz', subregion='all', step=1, model_id=None)

Experimental API . Permute map axes.

volume_resample(session, volumes, on_grid=None, bounding_grid=False, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, model_id=None)

Experimental API . Interoplate a map on a new grid.

volume_ridges(session, volumes, level=None, subregion='all', step=1, model_id=None)

Experimental API . Find ridges in a map.

volume_scale(session, volumes, shift=0, factor=1, sd=None, rms=None, value_type=None, subregion='all', step=1, model_id=None)

Experimental API . Scale, shift and convert number type of map values.

volume_subtract(session, volumes, on_grid=None, bounding_grid=False, subregion='all', step=1, grid_subregion='all', grid_step=1, value_type=None, in_place=False, scale_factors=None, min_rms=False, model_id=None)

Experimental API . Subtract two maps.

volume_threshold(session, volumes, minimum=None, set=None, maximum=None, set_maximum=None, subregion='all', step=1, model_id=None)

Experimental API . Set map values below or above a threshold to a constant.

volume_tile(session, volumes, axis='z', pstep=1, trim=0, columns=None, rows=None, fill_order='ulh', subregion='shown', step=1, model_id=None)

Experimental API . Concatenate maps along an axis.

volume_unbend(session, volumes, path, yaxis=None, xsize=None, ysize=None, grid_spacing=None, subregion='all', step=1, model_id=None)

Experimental API . Unbend a map near a smooth splined path.

volume_unroll(session, volumes, inner_radius=None, outer_radius=None, length=None, grid_spacing=None, axis=None, center=None, coordinate_system=None, subregion='all', step=(1, 1, 1), model_id=None)

Experimental API . Flatten a cylindrical shell within a map.

volume_zone(session, volumes, near_atoms=None, range=None, bond_point_spacing=None, minimal_bounds=False, new_map=True, invert=False, subregion='all', step=1, model_id=None)

Experimental API . Mask a map keeping only parts close to specified atoms.


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

Bases: AtomSpecArg

classmethod parse(text, session)

Experimental API . Parse text and return an atomspec parse tree

vseries_align(session, series, enclose_volume=None, fast_enclose_volume=None)

Experimental API . Align each frame of a map series to the preceeding frame.

vseries_measure(session, series, output=None, centroids=True, color=None, radius=None)

Experimental API . Report centroid motion of a map series.

vseries_play(session, series, direction='forward', loop=False, max_frame_rate=None, pause_frames=0, jump_to=None, range=None, start_time=None, normalize=False, markers=None, preceding_marker_frames=0, following_marker_frames=0, color_range=None, cache_frames=1)

Experimental API . Show a sequence of maps from a volume series.

vseries_save(session, series, path, subregion=None, step=None, value_type=None, threshold=None, zero_mean=False, scale_factor=None, match_scale=None, enclose_volume=None, fast_enclose_volume=None, normalize_level=None, align=False, on_grid=None, mask=None, final_value_type=None, compress=False)

Experimental API . Process the frames of a map series and save the result to a a file. Processing can normalize, align, mask and change the numeric value type of maps.

vseries_slider(session, series)

Experimental API . Display a graphical user interface slider to play through frames of a map series.

vseries_stop(session, series)

Experimental API . Stop playing a map series.


wait(session, frames=None)

Experimental API . Wait before proceeding to the next command. Used in movie recording scripts.


Wait until this many frames have been rendered before executing the next command in a command script.


window_size(session, width=None, height=None)

Experimental API . Report or set graphics window size in pixels.


zoom(session, factor=None, frames=None, pixel_size=None)

Experimental API . Move the camera toward or away from the center of rotation to make the objects appear bigger by a specified factor.


Factor by which to change apparent object size.


Perform the specified zoom over N frames.

pixel_sizefloat or None

Zoom so that the pixel size in physical units (Angstroms) is this value. For perspective camera modes the pixel size is set at the center of rotation depth. If factor is also given then it multiplies pixel size.