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/atoms.py


# Example for 'atom' objects

from modeller import *
from modeller.scripts import complete_pdb

env = environ()
env.io.atom_files_directory = ['../atom_files']
env.libs.topology.read(file='$(LIB)/top_heav.lib')
env.libs.parameters.read(file='$(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: ", mdl.atoms['CA:4'].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'].atoms[0]
print "Biso for first atom in residue 10: %.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



Subsections

Automatic builds 2009-01-30