molecule: Atomic molecular models

class Atoms

An atom set is a collection of atoms from one or more molecules. Properties of the atoms such as their x,y,z coordinates or radii can be accessed as arrays for efficient computation.

add_atoms(atoms, remove_duplicates=False)

Add atoms to the set.

add_molecules(molecules)

Add all atoms of the specified molecules to the set.

atom_names()

Return a numpy array of atoms names.

chains()

List of pairs of molecule and chain id in set.

color_atoms(color)

Color atoms.

color_ribbon(color)

Color ribbons.

colors()

Return a numpy array of atom colors (RGBA).

coordinates()

Return a numpy array of atom coordinates in the global coordinate system.

count()

Number of atoms in set.

element_numbers()

Return a numpy array of atom element numbers (e.g. 6 = carbon, 8 = oxygen).

exclude_water()

Return a copy of this atom set with waters (residue name HOH) removed.

extend_to_chains()

Return a copy of this atom set extended to include all atoms of chains which have atoms in the current set.

hide_atoms()

Undisplay the atoms.

hide_ribbon()

Hide ribbons for residues containing the specified atoms.

molecules()

List of molecules in set.

move_atoms(tf)

Move atoms using a transform acting in scene global coordinates.

names()

Return a list of text names (strings) for each atom in this set.

radii()

Return a numpy array of atom radii.

remove_duplicates()

Make sure atoms included at most once.

residue_names()

Return a numpy array of residue names for each atom.

residue_numbers()

Return a numpy array of residue numbers for each atom.

scale_atom_colors(scale)

Darken colors on some atoms for ambient occlusion lighting.

separate_chains()

Return copies of this atom set where each copy has atoms from a separate chain.

separate_molecules()

Return copies of this atoms set each having atoms from just one molecule.

sequence_numbers(sequence_name)

Return atom sequence numbers for a named alignment.

set_atom_style(style)

Set the atom display style to SPHERE_STYLE, STICK_STYLE, or BALL_STICK_STYLE.

show_atoms(only_these=False)

Display the atoms.

show_ribbon(only_these=False)

Show ribbons for residues containing the specified atoms.

subset(indices)

Return an Atoms object containing the atoms in the specified position in this set. The indices must be in increasing order.

class Molecule(path, atoms)

A Molecule represents atoms, bonds, residues and chains, typically read from file formats defined by the Protein Data Bank. The data includes atomic coordinates, atom names, residue names and numbers, and chain identifiers. A molecule represents both the data and the display style, color, and visibility used for drawing the molecule.

The atoms argument is a numpy structured array with fields atom_name, element_number, xyz, radius, residue_name, residue_number, chain_id, atom_shown, atom_color, ribbon_shown, ribbon_color.

atom_count()

Return the number of atoms in the molecule. Does not include molecule copies.

atom_subset(atom_name=None, chain_id=None, residue_range=None, residue_numbers=None, residue_name=None, invert=False, restrict_to_atoms=None)

Return a subset of atoms with specifie atom name, chain id, residue range, and residue name.

atoms()

Return an Atoms object containing all the molecule atoms.

color_ribbon(chain_id, residue_colors)

Residue colors is n by 4 uint8 array where first index is residue number and second index is red, green, blue, alpha values.

draw(renderer, place, draw_pass, selected_only=False)

Draw the molecule using the current style.

shown_atom_count()

Return the number of displayed atoms in the molecule. Includes molecule copies.

fetch_mmcif(id, session, ignore_cache=False)

Fetch molecular models in mmCIF format from the Protein Data Bank, www.rcsb.org

fetch_pdb(id, session, ignore_cache=False, file_format='pdb')

Fetch molecular models from the Protein Data Bank, www.rcsb.org

load_pdb_local(id, session, pdb_dir='/usr/local/pdb')

Load a PDB file given its id from a local copy of the “divided” database.

open_pdb_file(path, session)

Open a PDB file.

sort_atoms(atoms, bonds=None)

Sort numpy structured array of atoms by chain id and residue number. Update bonds to use new order.

Previous topic

map: Density maps

Next topic

session: Hydra session

This Page