CLAMP: Class Library for Advanced Molecular Properties

In this directory are a number of Python files that define an object-oriented library for molecular modeling. This document is a brief (and incomplete) reference for those files.

People interested in using Python for molecular modeling should also check out Konrad Hinsen's excellent Molecular Modeling Tool Kit (MMTK), which is a much more mature product. Ultimately, I hope to build CLAMP on top of MMTK, but while CLAMP is still under development I wanted more flexibility.

Table of contents:

  1. Molecule library
  2. Atom library
  3. Element library
  4. MolVTK library
  5. Viewing Jaguar Orbitals
  6. The MSC File Format
  7. Tutorial for using CLAMP

Objects and methods for defining molecules.

Data objects include:

mol = Molecule('New Molecule')
Initialize the molecule
The name of the molecule (here 'New Molecule')
A list of atoms in mol. Atoms are a data type given in the class library file (v.i.).
A list of bonds in mol. For now, bonds are simply a tuple of two atoms.
A list of fragments in mol. Fragments are currently defined as a list of a number of atoms, which refer to the ordering in mol.atomlist.
The total mass of mol.
The total spin of mol. For the multiplicity take 2*mol.spin + 1. Default value of 0.
The charge on the molecule. Default value of 0.
A Vector() object defining the center of mass. Default Vector(0,0,0).
A cutoff value for including external atoms in the bufferzone of a fragment in a divide-and-conquer calculation. Default value of 4.

Methods include:

Initialize the molecule object. E.g. mol1 = Molecule().
Get the nuclear repulsion energy of the molecule.
Create a bondlist based on the distance between atoms in the molecule.
Append atom to the atomlist.
Compute the number of basis functions in the molecule. Only 6-31G** is implemented now.
Compute the (lowest possible) spin based on the atoms and the charge.
Input a molecule from file. Formats include XYZ, XBS, JAG, SYS, MSC, or None.
Output a molecule to a file. Formats include XYZ, XBS, JAG, SYS, MSC, or None. If no format is supplied a generic format is used.

Objects and methods for defining atoms.

Data objects include:

at = Atom(x,y,z,atomic_number)
Initialize an atom at position (x,y,z) with atomic_number.
A Vector object containing (x,y,z)
The atomic number of at.
The atomic mass of at.
The elemental symbol of at.
The number of basis functions contained on at. Currently only 6-31G** is represented.
The elemental name (e.g. 'hydrogen') of at.

Methods include:

Initialize the atom. at = Atom(x,y,z,atomic_number)
Print the atom to file. If no file is supplied the output goes to sys.stdout. Formats include XYZ, JAG, MSC, SYS, or XBS. If no format is supplied an XYZ format is used.
Returns the number of basis functions on the atom.

Reference database for elemental information. Note that this is not a class library, but a set of lists and dictionaries. In general, object[i] returns the property for element number i corresponding to object. Currently only data through atomic number 18 (Ar) is programmed.

Data objects include

The atomic symbol, e.g. 'C', 'H', etc.
The atomic name, e.g. 'carbon', 'hydrogen', etc.
The atomic mass, including isotopes.
The number of basis functions for the atom, currently just for the 6-31G** basis set.
The red color intensity used for displaying the molecule in a CPK-type environment.
The green color intensity used for displaying the molecule in a CPK-type environment.
The blue color intensity used for displaying the molecule in a CPK-type environment.
The covalent radius of the element.
The van der Waals radius of the element.
A dictionary that converts the symbol (e.g. 'C') to the atomic number (e.g. 6).
A dictionary that converts the element name (e.g. 'carbon') to the atomic number (e.g. 6).

A set of methods and objects for displaying a molecule using the Visualization Tool Kit.

An example for how to use the viewer is here.

Methods include:

Initialize a new molecular viewer. E.g. viewer = MolVTK()
Adds at to the viewer environment. Represents the atom as a sphere, with color given by the defaults.
Adds a cylindrical bond between atoms at1 and at2.
Adds the orbitals from the plotfile in filename and constructs the molecular surface specified by contour_value. Uses the marching cubes features of VTK.
Starts the viewer and window/mouse interaction.

Viewing Jaguar Orbitals

We have recently developed some tools for viewing Jaguar orbitals with CLAMP. More information is available here.

The MSC File Format

We are beginning to create a flexible file format for molecular modeling. The format is currently in its infancy. Ultimately it will look a great deal like the Biograf file format. Currently it looks nothing like it.

Tutorial for using CLAMP

Currently under construction. Here are some examples in the meantime.
Create your own 3-d file viewer.
Convert xyz (and other) file formats to a Jaguar input file.
Last modified: Thu Mar 17 08:06:32 2005