Technical Documentation
Utilities: The AutoGen Class

The AutoGen class automates the generation of two atom, three atom and four atom interactions and exclusion of atom pairs separated by one, two and three contiguous bonds. The required input is a list of interacting atom pairs. This list is then used to generate three-atom and four-atom interactions and the exclusion pairs.

It is expected that each force field will define an autogeneration class from the AutoGen superclass. Then the subclass is customized for the force field by implementing methods to generate two atom, three atom and four atom terms for the potential function. The subclass will use the methods from the AutoGen superclass to register atom pairs and to retrieve the above mentioned lists and using these lists, register the interactions and exclusions to the appropriate terms of the potential energy function. For an example, see the TestTube force field.

The AutoGen module is located in Yup.Tools. Thus, the required import statement is some variant of: from Yup.Tools.AutoGen import AutoGen.

There is no publicly accessible data attribute.

Atoms are represented as AtomMap objects.

The methods are:

AutoGen()

Constructs and returns a new AutoGen class

addpair()

Registers a pair of atoms

getpairs()

Returns the list of atom pairs

gettrios()

Returns the list of atom triplets

get13xlist()

Returns the list of 1-3 excluded atom pairs

getquads()

Returns the list of atom quadruplets

get14xlist()

Returns the list of 1-4 excluded atom pairs

finish()

Clears all the lists

addpair() can be invoked as many times as necessary. The other methods must be called once each and only after the last call to addpair() and after all atom deletions have taken place. These methods must also be called in the proper order.


The constructor function creates an empty atom pair list.

Method Name
Number of Arguments
Return Value
AutoGen
0
The new AutoGen class

The module is then ready to accept atom pairs.


The addpair() method is used to register atom pairs in the atom pair list.

Method Name
Number of Arguments
Return Value
addpair
2
None
Argument
Type
Preset Value
one atom of the pair
atom AtomMap
-
the other atom of the pair
atom AtomMap
-

An exception is raised if the arguments are not both atom AtomMaps or if the two atoms in the pair are identical. Otherwise the atoms are added to the atom pair list.

A particular pair of atoms can only be registered once. If they are added more than once, the extraneous pairs are removed. If, for whatever reason, a bond has to be reckoned multiple times, the first copy can be registered, and the additional copies can be added directly to the bond energy term using that term's add() method. Similarly, any particular term (bond, angle or torsion) can be added using the add() method of the appropriate energy term if the term is not to have any effect on or be an outcome of the autogeneration process.


The getpairs() method returns the atom pair list and creates an empty atom triplet list.

Method Name
Number of Arguments
Return Value
getpairs
0
List of tuples each containing a pair of atom AtomMaps

The atom pairs had been accumulated by calls to addpair(). Pairs that contain at least one deleted atom are removed from the list. The list is then sorted and redundant pairs are removed. An empty atom triplet list is created before the atom pair list is returned. The atom pair list looks like: [ ( x1, y1 ), ( x2, y2 ), ... ] where x1, y1, x2, y2 are atom AtomMaps.


The gettrios() method returns the atom triplet list and creates an empty atom quadruplet list.

Method Name
Number of Arguments
Return Value
gettrios
0
List of tuples each containing a trio of atom AtomMaps

This method must be called only after getpairs() has been called. The atom triplets are generated from the atom pair list. Triplets are formed from two atom pairs that have an atom in common. The triplet list that results is sorted. An empty atom quadruplet list is created before the atom triplet list is returned. The atom triplet list looks like: [ ( x1, y1, z1 ), ( x2, y2, z2 ), ... ] where x1, y1, z1, x2, y2, z2 are atom AtomMaps.


The get13xlist() method returns the 1-3 exclusion atom pair list, which are pairs of atoms that are separated by two contiguous bonds.

Method Name
Number of Arguments
Return Value
get13xlist
0
List of tuples each containing a pair of atom AtomMaps

This method must be called only after gettrios() has been called. Candidates for 1-3 exclusion are formed from the atom triplet list by taking for each pair the first and third atoms in the atom triplet list. This list is then sorted and purged of redundant pairs. The list is further purged of pairs that occur in the atom pair list. The 1-3 exclusion atom pair list looks like: [ ( x1, y1 ), ( x2, y2 ), ... ] where x1, y1, x2, y2 are atom AtomMaps.

For non-cyclic systems or systems that contain no rings that have fewer than five members, the 1-3 exclusion pairs can be formed simply by taking the first and third atoms of each triplet in the atom triplet list.


The getquads() method returns the atom quadruplet list.

Method Name
Number of Arguments
Return Value
getquads
0
List of tuples each containing a quartet of atom AtomMaps

This method must be called only after gettrios() has been called. The atom quadruplets are generated from the atom triplet list. Quartets are formed from two atom triplets that have two contiguous atoms (first and second or second and third) in common. The quadruplet list that results is not sorted. The atom quadruplet list looks like: [ ( w1, x1, y1, z1 ), ( w2, x2, y2, z2 ), ... ] where w1, x1, y1, z1, w2, x2, y2, z2 are atom AtomMaps.


The get14xlist() method returns the 1-4 exclusion atom pair list, which are pairs of atoms that are separated by three contiguous bonds.

Method Name
Number of Arguments
Return Value
get14xlist
0
List of tuples each containing a pair of atom AtomMaps

This method must be called only after getquads() has been called. Candidates for 1-4 exclusion are formed by taking for each pair the first and last atoms in the unsorted atom quadruplet list and swapping the pair if necessary. This list is then sorted and purged of redundant pairs. The list is further purged of pairs that also occur in the atom pair and atom triplet lists. The 1-4 exclusion atom pair list looks like: [ ( x1, y1 ), ( x2, y2 ), ... ] where x1, y1, x2, y2 are atom AtomMaps.

For non-cyclic systems or systems that contain no rings that have fewer than seven members, the 1-4 exclusion pairs can be formed simply by taking the first and fourth atoms of each quartet in the atom quadruplet list.

The 1-4 exclusion list is useful only in a force field where the 1-4 non-bond interactions are calculated and are treated differently from other, more distant, interactions. If, as is usually the case, the 1-4 interactions are to be scaled, then exclude these interactions from the exclusion version of the appropriate energy term and add the interactions to the inclusion version of the energy term. The inclusion term has to be parameterized with the scaled values.


The finish() method removes the various lists.

Method Name
Number of Arguments
Return Value
finish
0
None

It is not absolutely necessary to call this method but this can release memory earlier.


All the lists contain tuples of two, three or four atom AtomMaps.

List:

Contains:

Manipulated by:

atom pair

pairs of interacting atoms

created by the constructor, accumulated by addpair() and sorted, edited and returned by getpairs()

atom triplet

trios of interacting atoms

empty list created by getpairs(), populated and returned by gettrios()

atom quadruplet

quartets of interacting atoms

empty list created by gettrios(), populated and returned by getquads()

1-3 exclusion atom pair

pairs of atoms that are separated by two contiguous bonds

created and returned by get13xlist()

1-4 exclusion atom pair

pairs of atoms that are separated by three contiguous bonds

created and returned by get14xlist()


Technical
Introduction
Directory
Vectors
Energy
Model
Assembly
Methods
FPF
FFF
AVF
TaroScript
YammpScript
Python
Utilities

Home
Information
News
User
Technical
Programmer
iYup
Download
Showcase
ETC