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

Ben Webb 2008-02-01