# Module MMTK.ChemicalObjects

## Functions

- isChemicalObject()

  Returns 1 if object is a chemical object.

## Class ChemicalObject: General chemical object

A subclass of MMTK.Collection.GroupOfAtoms and MMTK.Visualization.Viewable.

This is an Glossary:abstract-base-class that implements methods which are applicable to any chemical object (atom, molecule, etc.).

Methods:

- topLevelChemicalObject()

  Returns the highest-level chemical object of which the current object is a part.

- universe()

  Returns the universe to which the object belongs.

- bondedUnits()

  Returns a list containing the subobjects which can contain bonds. There are no bonds between any of the subobjects in the list.

- fullName()

  Returns the full name of the object. The full name consists of the proper name of the object preceded by the full name of its parent separated by a dot.

- distanceConstraintList()

  Returns the list of distance constraints.

- numberOfDistanceConstraints()

  Returns the number of distance constraints.

- setBondConstraints(universe=`None`)

  Sets distance constraints for all bonds.

- removeDistanceConstraints(universe=`None`)

  Removes all distance constraints.

- setRigidBodyConstraints(universe=`None`)

  Sets distance constraints that make the object fully rigid.

- getAtomProperty(atom, property)

  Returns the value of the specified property for the given atom from the chemical database.

  Note: the property is first looked up in the database entry for the object on which the method is called. If the lookup fails, the complete hierarchy from the atom to the top-level object is constructed and traversed starting from the top-level object until the property is found. This permits database entries for higher-level objects to override property definitions in its constituents.

  At the atom level, the property is retrieved from an attribute with the same name. This means that properties at the atom level can be defined both in the chemical database and for each atom individually by assignment to the attribute.

## Class CompositeChemicalObject: Chemical object with subobjects

This is an Glossary:abstract-base-class that implements methods which can be used with any composite chemical object, i.e. any chemical object that is not an atom.

Methods:

- atomList()

  Returns a list containing all atoms in the object.

## Class Group: Group of bonded atoms

A subclass of MMTK.ChemicalObjects.ChemicalObject.

Groups can contain atoms and other groups, and link them by chemical bonds. They are used to represent functional groups or any other part of a molecule that has a well-defined identity.

Groups cannot be created in application programs, but only in database definitions for molecules.

Constructor: Group(species, **|properties|)

species

  a string (not case sensitive) that specifies the group name in the chemical database

properties

  optional keyword properties:

  - position: the center-of-mass position (a vector)

  - name: the atom name (a string)