next up previous contents index
Next: Atom.dvx objective Up: MODELLER command reference Previous: Point.select_sphere() select   Contents   Index

The Atom class: a single atom in a model or structure

The Atom class holds information about a single atom, in a model (see model.atoms) or an alignment template structure (Structure class). The Atom class is derived from the Point class, and thus all Point methods (e.g., Point.select_sphere()) can also be called on Atom objects, and all Point members (e.g.Point.x) are available. See Section 6.21.

Example: examples/python/

# Example for 'atom' objects

from modeller import *
from modeller.scripts import complete_pdb

env = environ() = ['../atom_files']'$(LIB)/top_heav.lib')'$(LIB)/par.lib')

mdl = complete_pdb(env, "1fas")

# 'mdl.atoms' is a list of all atoms in the model
print("Name of C-alpha atom in residue 4 in chain A: %s " \
      % mdl.atoms['CA:4:A'].name)
a = mdl.atoms[0]
print("Coordinates of first atom: %.3f, %.3f, %.3f" % (a.x, a.y, a.z))

# Each 'residue' object lists its own atoms, as does each chain
a = mdl.residues['10:A'].atoms[0]
print("Biso for first atom in residue 10 in chain A %.3f" % a.biso)

a = mdl.chains[0].residues[-1].atoms[-1]
print("Biso for last atom in last residue in first chain: %.3f" % a.biso)


Automatic builds 2012-08-29