15. Running AutoTors

MAX_TORS : AutoDock is set up to allow a maximum number of torsions. If AutoTors detects more torsions than are permitted, a warning to that effect is given and it is up to the user to reduce the number of torsions, either by deleting or selecting the appropriate number of torsions. MAX_TORS is defined in the file " autodock.h "; if this definition is changed, the autodock- executable must be re-made, using the appropriate Makefile.

There are four stages in running AutoTors :

Input Stage

(a) Data about bonds in the molecule are used to construct a tree -like structure. Each line of bond data consists of two integers corresponding to the line numbers (in the pdbq file) of the atoms involved. These integers are used as the 'id's of the atoms in the molecule. Once the new ids are read in, the pre-existing TREE is searched for ATOM_NODEs with either of these ids. If only one such node is found, an ATOM_NODE is created for the other id and linked to the already-entered node in the appropriate way. If the id of the pre-existing node was the first of the two integers on the line of bond data, one of the node's next links is set to the new node and one of the new node's prev links is set to the pre-existing node. In the other case, the opposite linking pattern is set. If neither id can be found in the member ids of ATOM_NODEs in the TREE, two new ATOM_NODEs are created, linked together in the appropriate way and held in a temporary data structure for later linking into the 'TREE' in phase b. If both of the ids are already in the TREE, the two nodes with these ids are linked as appropriate. Moreover, this case signals the detection of a cycle and the existing TREE is processed to detect the members of this cycle and to store resulting information about the new cycle. The members of new cycle i are stored in two dimensional global array cycle[i]. The number of members of cycle i is stored in cycle_size[i].

(b) After all the bond data is entered, the program attempts to attach any pairs which had not been linked to pre-existing atoms. To do this, it searchs through the TREE AT MOST once for each id in input data, attempting to add each unattached pair to the TREE. If any unattached pair remains after this process, the input data is flawed and the program exits early with an error message to that effect.

Root Specification Stage

After all the nodes are created and connected, in whatever order and direction the bond data specifies, the user interacts with the program to select the portion of the molecule to be considered the 'ROOT.' This is the section of the molecule which will remain rigid and NOT undergo any torsions. This phase has two parts:

(a) Cycles detected are listed on the screen. The user either selects one of these cycles to be the root (by entering the appropriate number) OR selects none of them as the root (by entering '0').

(b) The user can modify the list of root atoms at this point by adding atoms to the rootlist (by entering the atom 'id.'). The user leaves this phase by entering 'q' (to quit).

If no root atoms are specified, a message to this effect is written to the screen and the program will exit at this point.

Torsions Detection and Selection Stage

Once at least one root atom has been designated, the program next processes the TREE, changing the direction of the links in the TREE as appropriate (so that all links previous to the root are previous and all nexts are nexts), and accumulating a list of possible torsions which the user edits interactively.

(a) The TREE is traversed in a depth-first order traversal at this point detecting possible torsions. Torsions cannot occur between root atoms NOR between atoms in a cycle. Moreover, torsions are not permitted between atoms and their 'leaves' (attached atoms which have no other connection). In the case of the user-specified '-a' flag, amide bond torsions are not permitted. During this traversal, a linked list of possible torsions is built.

(b) The user is given the list of the torsions detected in the molecule and has an opportunity to modify this list. Torsions can be deleted OR selected at this point.(Depending on whether only a few are to be deleted or if only a few are to be selected). The user leaves this phase by entering 'q' (for quit).

Root Expansion and Output Stage

The rest of program follows at this point with no further input from the user. The TREE is traversed again and the rootlist is expanded to include any atoms which are between the existing root section and 'BRANCH'es as defined by active torsions. Next, the TREE is traversed and new_id numbers are assigned sequentially to the atoms in the TREE, starting with the root. Finally, a last traversal through the TREE is made and output is written to the file specified by the user on the command line. 'REMARK' lines are written first describing each possible torsion and its status at the end of the program. Next, the expanded list of root atoms is output preceeded by a'ROOT' line and followed by an 'ENDROOT' line. Last, the rest of atoms in the molecule are output with appropriate 'BRANCH', 'TORS', 'ENDBRANCH' and 'ENDTORS' lines inserted as dictated by active torsions.