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.22.

Two Atom objects are considered equal if and only if they represent the same atom in the same structure.

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 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)



Subsections