atomic: Atomic structures

Atomic data, such as molecules read from a Protein Databank file, is managed in C++ data structures which are made available through the following equivalent Python classes:

Also lines between atoms depicting distances or missing segments of a protein backbone are represented as pseudobonds:

Efficient collections of molecular objects and molecular surfaces are also available

Atomic data classes

class AtomicStructure(*args, **kw)

Bases: chimerax.core.atomic.structure.Structure

Bases: StructureData, Model, Structure

Molecular model including atomic coordinates. The data is managed by the StructureData base class which provides access to the C++ structures.

all_atomic_structures(session)

List of all AtomicStructure objects.

all_atoms(session, atomic_only=False)

All atoms in all structures as an Atoms collection.

all_structures(session)

List of all Structure objects.

selected_atoms(session)

All selected atoms in all structures as an Atoms collection.

selected_bonds(session)

All selected bonds in all structures as an Bonds collection.

structure_atoms(structures)

Return all atoms in specified atomic structures as an Atoms collection.

structure_residues(structures)

Return all residues in specified atomic structures as an Atoms collection.

class Atom(c_pointer)

Bases: chimerax.core.state.State

An atom includes physical and graphical properties such as an element name, coordinates in space, and color and radius for rendering.

To create an Atom use the AtomicStructure new_atom() method.

HIDE_ISOLDE = 2

Hide mask for backbone atoms for ISOLDE.

HIDE_NUCLEOTIDE = 4

Hide mask for sidechain atoms in nucleotides.

HIDE_RIBBON = 1

Hide mask for backbone atoms in ribbon.

alt_loc

Alternate location indicator

alt_locs

Returns a list of the valid alt-loc characters for this Atom (which will be [‘ ‘] for a “non-alt-loc” atom).

aniso_u

Anisotropic temperature factors, returns 3x3 array of numpy float32 or None. Read only.

aniso_u6

Get anisotropic temperature factors as a 6 element numpy float32 array containing (u11, u22, u33, u12, u13, u23) or None.

bfactor

B-factor, floating point value.

bonds

Bonds connected to this atom as a list of Bond objects. Read only.

chain_id

Protein Data Bank chain identifier. Limited to 4 characters. Read only string.

clear_hide_bits(bit_mask)

Clear Atom’s hide bits in bit mask

color

Color RGBA length 4 numpy uint8 array.

connects_to(atom)

Whether this atom is directly bonded to a specified atom.

coord

Coordinates from the current coordinate set (or alt loc) as a numpy length 3 array, 64-bit float values. See get_coord method for other coordsets / alt locs.

coord_index

Coordinate index of atom in coordinate set.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

default_radii

Default atom radius.

delete()

Delete this Atom from it’s Structure

deleted

Has the C++ side been deleted?

display

Whether to display the atom. Boolean value.

draw_mode

Controls how the atom is depicted.

Possible values:

SPHERE_STYLE
Use full atom radius
BALL_STYLE
Use reduced atom radius, but larger than bond radius
STICK_STYLE
Match bond radius
element

Element corresponding to the chemical element for the atom.

element_name

Chemical element name. Read only.

element_number

Chemical element number. Read only.

get_altloc_coord(altloc)

Like the ‘coord’ property, but uses the given altloc (character) rather than the current altloc.

get_coordset_coord(crdset)

Like the ‘coord’ property, but uses the given coordset ID (integer) rather than the current coordset.

get_scene_coord(crdset_or_altloc)

Like the ‘scene_coord’ property, but uses the given coordset ID (integer) / altloc (character) rather than the current coordset / altloc.

has_selected_bond

Whether any connected bond is selected.

hide

Whether atom is hidden (overrides display). Integer bitmask.

Possible values:

HIDE_RIBBON
Hide mask for backbone atoms in ribbon.
HIDE_ISOLDE
Hide mask for backbone atoms for ISOLDE.
HIDE_NUCLEOTIDE
Hide mask for sidechain atoms in nucleotides.
in_chain

Whether this atom belongs to a polymer. Read only.

is_backbone(bb_extent=2)

Whether this Atom is considered backbone, given the ‘extent’ criteria.

Possible ‘extent’ values are:

BBE_MIN
Only the atoms needed to connect the residue chain (and their hydrogens)
BBE_MAX
All non-sidechain atoms
BBE_RIBBON
The backbone atoms that a ribbon depiction hides
is_ribose

Whether this atom is part of an nucleic acid ribose moiety. Read only.

is_side_chain

Whether this atom is part of an amino/nucleic acid sidechain. Includes atoms needed to connect to backbone (CA/ribose). Read only.

is_side_connector

Whether this atom is connects the side chain to the backbone e.g. CA/ribose. Read only.

is_side_only

Whether this atom is part of an amino/nucleic acid sidechain. Does not include atoms needed to connect to backbone (CA/ribose). Read only.

maximum_bond_radius(default_radius=0.2)

Return maximum bond radius. Used for stick style atom display.

name

Atom name. Maximum length 4 characters.

neighbors

Atoms connnected to this atom directly by one bond. Read only.

num_bonds

Number of bonds connected to this atom. Read only.

num_explicit_bonds

Number of bonds and missing-structure pseudobonds connected to this atom. Read only.

occupancy

Occupancy, floating point value.

radius

Radius of atom.

reset_state(session)

For when the session is closed

residue

Residue the atom belongs to.

rings(cross_residues=False, all_size_threshold=0)

Return Rings collection of rings this Atom participates in.

If ‘cross_residues’ is False, then rings that cross residue boundaries are not included. If ‘all_size_threshold’ is zero, then return only minimal rings, of any size. If it is greater than zero, then return all rings not larger than the given value.

The returned rings are quite emphemeral, and shouldn’t be cached or otherwise retained for long term use. They may only live until the next call to rings() [from anywhere, including C++].

scene_coord

Atom center coordinates in the global scene coordinate system. This accounts for the Drawing positions for the hierarchy of models this atom belongs to.

selected

Whether the atom is selected.

serial_number

Atom serial number from input file.

set_coord(xyz, cs_id)

Used to set the atom’s xyz for a particular coordset. Just use the ‘coord’ attr for changing the current coordinate set.

set_hide_bits(bit_mask)

Set Atom’s hide bits in bit mask

structure

AtomicStructure the atom belongs to

structure_category

Whether atom is ligand, ion, etc.

visible

Whether atom is displayed and not hidden.

class Bond(bond_pointer)

Bases: chimerax.core.state.State

Bond connecting two atoms.

To create a Bond use the AtomicStructure new_bond() method.

atoms

Two-tuple of Atom objects that are the bond end points.

clear_hide_bits(bit_mask)

Clear Atom’s hide bits in bit mask

color

Color RGBA length 4 numpy uint8 array.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

delete()

Delete this Bond from it’s Structure

deleted

Has the C++ side been deleted?

display

Whether to display the bond if both atoms are shown. Can be overriden by the hide attribute.

ends_selected

Whether both bond end atoms are selected.

halfbond

Whether to color the each half of the bond nearest an end atom to match that atom color, or use a single color and the bond color attribute. Boolean value.

hide

Whether bond is hidden (overrides display). Integer bitmask. Use Atom.HIDE_* constants for hide bits.

length

Bond length. Read only.

other_atom(atom)

Return the Atom at the other end of this bond opposite the specified atom.

radius

Displayed cylinder radius for the bond.

rings(cross_residues=False, all_size_threshold=0)

Return Rings collection of rings this Bond is involved in.

If ‘cross_residues’ is False, then rings that cross residue boundaries are not included. If ‘all_size_threshold’ is zero, then return only minimal rings, of any size. If it is greater than zero, then return all rings not larger than the given value.

The returned rings are quite emphemeral, and shouldn’t be cached or otherwise retained for long term use. They may only live until the next call to rings() [from anywhere, including C++].

selected

Whether the bond is selected.

set_hide_bits(bit_mask)

Set Atom’s hide bits in bit mask

shown

Whether bond is visible and both atoms are shown and at least one is not Sphere style. Read only.

structure

AtomicStructure the bond belongs to.

visible

Whether bond is display and not hidden. Read only.

class Chain(sseq_pointer=None, *, chain_id=None, structure=None)

Bases: chimerax.core.atomic.molobject.StructureSeq

A single polymer chain such as a protein, DNA or RNA strand. A chain has a sequence associated with it. A chain may have breaks. Chain objects are not always equivalent to Protein Databank chains.

class ChangeTracker

Bases: object

Per-session singleton change tracker keeps track of all atomic data changes

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

class CoordSet(cs_pointer)

Bases: chimerax.core.state.State

The coordinates for one frame of a Structure

To create a Bond use the AtomicStructure new_coordset() method.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

id

ID number of coordset

structure

AtomicStructure the coordset belongs to

class Element(element_pointer)

Bases: object

A chemical element having a name, number, mass, and other physical properties.

static bond_length(e1, e2)

Standard single-bond length between two elements

Arguments can be element instances, atomic numbers, or element names

static bond_radius(e)

Standard single-bond ‘radius’ (the amount this element would contribute to bond length)

Argument can be an element instance, atomic number, or element name

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

static get_element(name_or_number)

Get the Element that corresponds to an atomic name or number

is_alkali_metal

Is atom an alkali metal. Read only.

is_halogen

Is atom a halogen. Read only.

is_metal

Is atom a metal. Read only.

is_noble_gas

Is atom a noble_gas. Read only.

mass

Element atomic mass, taken from http://en.wikipedia.org/wiki/List_of_elements_by_atomic_weight. Read only.

name

Element name, for example C for carbon. Read only.

names = {'Eu', 'Am', 'Ru', 'Rh', 'Be', 'V', 'Lr', 'La', 'Na', 'Sn', 'Co', 'Cu', 'Si', 'Ar', 'Al', 'Ga', 'Hf', 'Mg', 'At', 'Au', 'I', 'Bi', 'Ag', 'Zn', 'Cd', 'Uup', 'As', 'Ba', 'Ir', 'C', 'Ta', 'Fl', 'Cm', 'Zr', 'Uut', 'Sm', 'In', 'Pr', 'Np', 'Th', 'Fr', 'Dy', 'Gd', 'Ca', 'P', 'K', 'Se', 'He', 'Nd', 'Es', 'O', 'Pm', 'Cf', 'Te', 'F', 'Bh', 'Md', 'Cs', 'Ac', 'N', 'Y', 'H', 'Sb', 'Cn', 'Ce', 'Rb', 'Sr', 'Nb', 'Mt', 'Ho', 'S', 'B', 'Pu', 'Ra', 'Lu', 'U', 'Ge', 'Fm', 'Uuh', 'Uuo', 'Cr', 'Pb', 'Hg', 'Tb', 'Pd', 'Rg', 'No', 'Os', 'Ti', 'W', 'Hs', 'Kr', 'Er', 'Xe', 'Sg', 'Rn', 'Tm', 'Fe', 'Cl', 'Li', 'Bk', 'Pa', 'Pt', 'Db', 'Po', 'Tc', 'Tl', 'Br', 'Ds', 'Mn', 'Yb', 'Sc', 'Uus', 'Ne', 'Re', 'Ni', 'Mo', 'Rf'}

Set of known element names

number

Element atomic number, for example 6 for carbon. Read only.

valence

Element valence number, for example 7 for chlorine. Read only.

class ExtrudeValue(vertices, normals, triangles, colors, front_band, back_band)

Bases: tuple

back_band

Alias for field number 5

colors

Alias for field number 3

front_band

Alias for field number 4

normals

Alias for field number 1

triangles

Alias for field number 2

vertices

Alias for field number 0

class Pseudobond(pbond_pointer)

Bases: chimerax.core.state.State

A Pseudobond is a graphical line between atoms for example depicting a distance or a gap in an amino acid chain, often shown as a dotted or dashed line. Pseudobonds can join atoms belonging to different AtomicStructures which is not possible with a Bond.

To create a Pseudobond use the PseudobondGroup new_pseudobond() method.

atoms

Two-tuple of Atom objects that are the bond end points.

color

Color RGBA length 4 numpy uint8 array.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

delete()

Delete this pseudobond from it’s group

deleted

Has the C++ side been deleted?

display

Whether to display the bond if both atoms are shown. Can be overriden by the hide attribute.

group

pbgroup.PseudobondGroup that this pseudobond belongs to

halfbond

Whether to color the each half of the bond nearest an end atom to match that atom color, or use a single color and the bond color attribute. Boolean value.

length

Distance between centers of two bond end point atoms.

other_atom(atom)

Return the Atom at the other end of this bond opposite the specified atom.

radius

Displayed cylinder radius for the bond.

selected

Whether the pseudobond is selected.

shown

Whether bond is visible and both atoms are shown. Read only.

shown_when_atoms_hidden

Normally, whether a pseudbond is shown only depends on the endpoint atoms’ ‘display’ attribute and not on those atoms’ ‘hide’ attribute, on the theory that the hide bits are only set when the atoms are being depicted by some non-default representation (such as ribbons) and that therefore the pseudobonds should still display to “hidden” atoms. However, if ‘shown_when_atoms_hidden’ is False then the pseudobonds will never be displayed if either endpoint atom is hidden (regardless of the display attribute), but will honor the ‘display’ attribute when the atoms aren’t hidden. Defaults to True.

class PseudobondGroupData(pbg_pointer)

Bases: object

A group of pseudobonds typically used for one purpose such as display of distances or missing segments. The category attribute names the group, for example “distances” or “missing segments”.

This base class of PseudobondGroup represents the C++ data while the derived class handles rendering the pseudobonds.

To create a PseudobondGroup use the PseudobondManager get_group() method.

category

Name of the pseudobond group. Read only string.

clear()

Delete all pseudobonds in group

color

Sets the color attribute of current pseudobonds and new pseudobonds

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

delete_pseudobond(pb)

Delete a specific pseudobond from a group

deleted

Has the C++ side been deleted?

get_num_pseudobonds(cs_id)

Get the number of pseudobonds for a particular coordinate set. Use the ‘num_pseudobonds’ property to get the number of pseudobonds for the current coordinate set.

get_pseudobonds(cs_id)

Get the pseudobonds for a particular coordinate set. Use the ‘pseudobonds’ property to get the pseudobonds for the current coordinate set.

group_type

PseudobondGroup.GROUP_TYPE_NORMAL is a normal group,PseudobondGroup.GROUP_TYPE_COORD_SET is a per-coord-set pseudobond group

halfbond

Sets the halfbond attribute of current pseudobonds and new pseudobonds

new_pseudobond(atom1, atom2, cs_id=None)

Create a new pseudobond between the specified Atom objects. If the pseudobond group supports per-coordset pseudobonds, you may specify a coordinate set ID (defaults to the current coordinate set).

num_pseudobonds

Number of pseudobonds in group. Read only.

pseudobonds

Group pseudobonds as a Pseudobonds collection. Read only.

radius

Sets the radius attribute of current pseudobonds and new pseudobonds

structure

Structure that pseudobond group is owned by. Returns None if called on a group managed by the global pseudobond manager

class PseudobondManager(session)

Bases: chimerax.core.state.State

Per-session singleton pseudobond manager keeps track of all PseudobondGroupData objects.

get_group(category, create=True)

Get an existing PseudobondGroup or create a new one given a category name.

group_map

Returns a dict that maps from PseudobondGroup category to group

take_snapshot(session, flags)

Gather session info; return version number

class Residue(residue_pointer)

Bases: chimerax.core.state.State

A group of atoms such as an amino acid or nucleic acid. Every atom in an AtomicStructure belongs to a residue, including solvent and ions.

To create a Residue use the AtomicStructure new_residue() method.

PT_AMINO = 1

Residue polymer type = amino acid.

PT_NONE = 0

Residue polymer type = none.

PT_NUCLEIC = 2

Residue polymer type = nucleotide.

add_atom(atom)

Add the specified Atom to this residue. An atom can only belong to one residue, and all atoms must belong to a residue.

atoms

Atoms collection containing all atoms of the residue.

bonds_between(other_res)

Return the bonds between this residue and other_res as a Bonds collection.

center

Average of atom positions as a numpy length 3 array, 64-bit float values.

chain

Chain that this residue belongs to, if any. Read only.

chain_id

Protein Data Bank chain identifier. Limited to 4 characters. Read only string.

connects_to(other_res)

Return True if this residue is connected by at least one bond (not pseudobond) to other_res

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

delete()

Delete this Residue from it’s Structure

deleted

Has the C++ side been deleted?

description

Description of residue (if available) from HETNAM/HETSYN records or equivalent

find_atom(atom_name)

Return the atom with the given name, or None if not found.

insertion_code

Protein Data Bank residue insertion code. 1 character or empty string.

is_helix

Whether this residue belongs to a protein alpha helix. Boolean value.

is_strand

Whether this residue belongs to a protein beta sheet. Boolean value.

mmcif_chain_id

mmCIF chain identifier. Limited to 4 characters. Read only string.

name

Residue name. Maximum length 4 characters. Read only.

num_atoms

Number of atoms belonging to the residue. Read only.

number

Integer sequence position number as defined in the input data file. Read only.

polymer_type

Polymer type of residue. Integer value.

principal_atom

The ‘chain trace’ Atom, if any.

Normally returns the C4’ from a nucleic acid since that is always present, but in the case of a P-only trace it returns the P.

ribbon_adjust

Smoothness adjustment factor (no adjustment = 0 <= factor <= 1 = idealized).

ribbon_color

Ribbon color RGBA length 4 numpy uint8 array.

ribbon_display

Whether to display the residue as a ribbon/pipe/plank. Boolean value.

ribbon_hide_backbone

Whether a ribbon automatically hides the residue backbone atoms. Boolean value.

ss_id

Secondary structure id number. Integer value.

ss_type

Secondary structure type of residue. Integer value. One of Residue.SS_COIL, Residue.SS_HELIX, Residue.SS_SHEET (a.k.a. SS_STRAND)

structure

AtomicStructure that this residue belongs to. Read only.

class RibbonXSection(coords=None, coords2=None, normals=None, normals2=None, faceted=False, tess=None, xs_pointer=None)

Bases: object

A cross section that can extrude ribbons when given the required control points, tangents, normals and colors.

arrow(scales)

Return new arrow cross section scaled by 2x2-tuple scale.

blend(back_band, front_band)

Return the triangles blending front and back halves of ribbon.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

extrude(centers, tangents, normals, color, cap_front, cap_back, offset)

Return the points, normals and triangles for a ribbon.

scale(scale)

Return new cross section scaled by 2-tuple scale.

class Ring(ring_pointer)

Bases: object

A ring in the structure.

aromatic

Whether the ring is aromatic. Boolean value.

atoms

Atoms collection containing the atoms of the ring, in no particular order (see Ring.ordered_atoms()).

bonds

Bonds collection containing the bonds of the ring, in no particular order (see Ring.ordered_bonds()).

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

ordered_atoms

Atoms collection containing the atoms of the ring, in ring order.

ordered_bonds

Bonds collection containing the bonds of the ring, in ring order.

size

Number of atoms (and bonds) in the ring. Read only.

class SeqMatchMap(session, align_seq, struct_seq)

Bases: chimerax.core.state.State

Class to track the matching between an alignment sequence and a structure sequence

The match map can be indexed by either an integer (ungapped) sequence position, or by a Residue, which will return a Residue or a sequence position, respectively. The pos_to_res and res_to_pos attributes return dictionaries of the corresponding mapping.

reset_state(session)

For when the session is closed

take_snapshot(session, flags)

Gather session info; return version number

class Sequence(seq_pointer=None, *, name='sequence', characters='')

Bases: chimerax.core.state.State

A polymeric sequence. Offers string-like interface.

append(chars)

Extend the sequence with the given string

characters

A string representing the contents of the sequence

circular

Indicates the sequence involves a cicular permutation; the sequence characters have been doubled, and residue correspondences of the first half implicitly exist in the second half as well. Typically used in alignments to line up with sequences that aren’t permuted.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

deleted

Has the C++ side been deleted?

extend(chars)

Extend the sequence with the given string

name

The sequence name

reset_state(session)

For when the session is closed

ungapped()

String of sequence without gap characters

class StructureData(mol_pointer=None, *, logger=None)

Bases: object

This is a base class of both AtomicStructure and Structure. This base class manages the data while the derived class handles the graphical 3-dimensional rendering using OpenGL.

RIBBON_MODE_ARC = 1

Ribbon mode showing secondary structure as an arc (tube or plank).

RIBBON_MODE_DEFAULT = 0

Default ribbon mode showing secondary structure with ribbons.

RIBBON_MODE_WRAP = 2

Ribbon mode showing helix as ribbon wrapped around tube.

RIBBON_ORIENT_ATOMS = 2

Ribbon orientation from interpolated atoms.

RIBBON_ORIENT_CURVATURE = 3

Ribbon orientation perpendicular to ribbon curvature.

RIBBON_ORIENT_GUIDES = 1

Ribbon orientation from guide atoms.

RIBBON_ORIENT_PEPTIDE = 4

Ribbon orientation perpendicular to peptide planes.

TETHER_CONE = 0

Tether is cone with point at ribbon.

TETHER_CYLINDER = 2

Tether is cylinder.

TETHER_REVERSE_CONE = 1

Tether is cone with point at atom.

active_coordset_change_notify

Whether notifications are issued when the active coordset is changed. Should only be set to true when temporarily changing the active coordset in a Python script. Boolean

active_coordset_id

Index of the active coordinate set.

add_coordset(id, xyz)

Add a coordinate set with the given id.

add_coordsets(xyzs, replace=True)

Add coordinate sets. If ‘replace’ is True, clear out existing coordinate sets first

alt_loc_change_notify

Whether notifications are issued when altlocs are changed. Should only be set to true when temporarily changing alt locs in a Python script. Boolean

atoms

Atoms collection containing all atoms of the structure.

ball_scale

Scales sphere radius in ball-and-stick style.

bonds

Bonds collection containing all bonds of the structure.

chains

Chains collection containing all chains of the structure.

connect_structure(chain_starters, chain_enders, conect_atoms, mod_res)

Generate connectivity. See connect_structure in connectivity.rst for more details.

chain_starters and chain_enders are lists of residues. conect_atoms is a list of atoms. mod_res is a list of residues (not MolResId’s).

coordset_ids

Return array of ids of all coordinate sets.

coordset_size

Return the size of the active coordinate set array.

cpp_pointer

Value that can be passed to C++ layer to be used as pointer (Python int)

delete()

Deletes the C++ data for this atomic structure.

delete_alt_locs()

Incorporate current alt locs as “regular” atoms and remove other alt locs

delete_atom(atom)

Delete the specified Atom.

deleted

Has the C++ side been deleted?

lower_case_chains

Structure has lower case chain ids. Boolean

metadata

Dictionary with metadata. Read only.

molecules

Return a tuple of Atoms objects each containing atoms for one molecule. Missing-structure pseudobonds are consider to connect parts of a molecule.

new_atom(atom_name, element)

Create a new Atom object. It must be added to a Residue object belonging to this structure before being used. ‘element’ can be a string (atomic symbol), an integer (atomic number), or an Element instance

new_bond(atom1, atom2)

Create a new Bond joining two Atom objects.

new_coordset(index=None, size=None)

Create a new empty coordset. In almost all circumstances one would use the add_coordset(s) method instead (to add fully populated coordsets), but in some cases when building a Structure from scratch this method is needed.

‘index’ defaults to one more than highest existing index (or 1 if none existing); ‘size’ is for efficiency when creating the first coordinate set of a new Structure,

and is otherwise unnecessary to specify
new_residue(residue_name, chain_id, pos, insert=' ')

Create a new Residue.

num_atoms

Number of atoms in structure. Read only.

num_atoms_visible

Number of visible atoms in structure. Read only.

num_bonds

Number of bonds in structure. Read only.

num_bonds_visible

Number of visible bonds in structure. Read only.

num_chains

Number of chains structure. Read only.

num_coordsets

Number of coordinate sets in structure. Read only.

num_residues

Number of residues structure. Read only.

pbg_map

Dictionary mapping name to PseudobondGroup for pseudobond groups belonging to this structure. Read only.

pdb_version

Dictionary with metadata. Read only.

polymers(missing_structure_treatment=0, consider_chains_ids=True)

Return a list of (Residues, Residue.polymer_type) tuples, one tuple per polymer. ‘missing_structure_treatment’ controls whether a single polymer can span any missing structure, no missing structure, or only missing structure that is part of a chain trace. ‘consider_chain_ids’, if true, will break polymers when chain IDs change, regardless of other considerations.

pseudobond_group(name, *, create_type='normal')

Get or create a PseudobondGroup belonging to this structure.

reorder_residues(new_order)

Reorder the residues. Obviously, ‘new_order’ has to have exactly the same residues as the structure currently has.

residues

Residues collection containing the residues of this structure. Read only.

ribbon_display_count

Return number of residues with ribbon display set. Integer.

ribbon_mode_helix

Ribbon mode for helices. Integer value.

ribbon_mode_strand

Ribbon mode for strands. Integer value.

ribbon_orientation

Ribbon orientation. Integer value.

ribbon_orients(residues=None)

Return array of orientation values for given residues.

ribbon_show_spine

Display ribbon spine. Boolean.

ribbon_tether_opacity

Ribbon tether opacity scale factor (relative to the atom).

ribbon_tether_scale

Ribbon tether thickness scale factor (1.0 = match displayed atom radius, 0=invisible).

ribbon_tether_shape

Ribbon tether shape. Integer value.

ribbon_tether_sides

Number of sides for ribbon tether. Integer value.

rings(cross_residues=False, all_size_threshold=0)

Return Rings collection of rings found in this Structure.

If ‘cross_residues’ is False, then rings that cross residue boundaries are not included. If ‘all_size_threshold’ is zero, then return only minimal rings, of any size. If it is greater than zero, then return all rings not larger than the given value.

The returned rings are quite emphemeral, and shouldn’t be cached or otherwise retained for long term use. They may only live until the next call to rings() [from anywhere, including C++].

save_state(session, flags)

Gather session info; return version number

session_atom_to_id(ptr)

Map Atom pointer to session ID

session_bond_to_id(ptr)

Map Bond pointer to session ID

session_chain_to_id(ptr)

Map Chain pointer to session ID

session_id_to_atom(i)

Map sessionID to Atom pointer

session_id_to_bond(i)

Map sessionID to Bond pointer

session_id_to_chain(i)

Map sessionID to Chain pointer

session_id_to_residue(i)

Map sessionID to Residue pointer

session_residue_to_id(ptr)

Map Residue pointer to session ID

set_color(rgba)

Set color of atoms, bonds, and residues

set_state_from_snapshot(session, data)

Restore from session info

ss_assigned

Has secondary structure been assigned, either by data in original structure file or by some algorithm (e.g. dssp command)

class StructureSeq(sseq_pointer=None, *, chain_id=None, structure=None)

Bases: chimerax.core.atomic.molobject.Sequence

A sequence that has associated structure residues.

Unlike the Chain subclass, StructureSeq will not change in size once created, though associated residues may change to None if those residues are deleted/closed.

bulk_set(residues, characters)

Set all residues/characters of StructureSeq.

chain_id

Chain identifier. Limited to 4 characters. Read only string.

characters

A string representing the contents of the sequence. Read only.

existing_residues

Residues collection containing the residues of this sequence with existing structure, in order. Read only.

from_seqres

Was the full sequence determined from SEQRES (or equivalent) records in the input file

num_existing_residues

Number of residues in this sequence with existing structure. Read only.

num_residues

Number of residues belonging to this sequence, including those without structure. Read only.

polymer_type

Polymer type of this sequence. Same values as Residue.polymer_type, except should not return PT_NONE.

res_map

Returns a dict that maps from Residue to an ungapped sequence position

residue_after(r)

Return the residue at index one more than the given residue, or None if no such residue exists.

residue_at(index)

Return the Residue/None at the (ungapped) position ‘index’.

residue_before(r)

Return the residue at index one less than the given residue, or None if no such residue exists.

residues

List containing the residues of this sequence in order. Residues with no structure will be None. Read only.

structure

AtomicStructure that this structure sequence comes from. Read only.

estimate_assoc_params(sseq)

Estimate the parameters needed to associate a sequence with a Chain/StructureSeq

Returns a 3-tuple:
  • Estimated total ungapped length, accounting for missing structure
  • A list of continuous sequence segments
  • A list of the estimated size of the gaps between those segments
try_assoc(session, seq, sseq, assoc_params, *, max_errors=6)

Try to associate StructureSeq ‘sseq’ with Sequence ‘seq’.

A set of association parameters (‘assoc_params’) must be provided, typically obtained from the estimate_assoc_params() function. See that function’s documentation for details of assoc_param’s contents. The maximum number of errors allowed can optionally be specified (default: 6).

The return value is a 2-tuple, consisting of a SeqMatchMap instance describing the association, and the number of errors encountered.

An unsuccessful association throws StructAssocError.

class PseudobondGroup(pbg_pointer, *, session=None)

Bases: chimerax.core.atomic.molobject.PseudobondGroupData, chimerax.core.models.Model

A pseudobond group is a named group of Pseudobond objects such as distances that depict lines between atoms with distance labels. Pseudobond groups are managed in C++ code which is made accessible via the PseudobondGroupData base class.

selected_pseudobonds(session)

All selected bonds in all structures as an Bonds collection.