Using BTCL and TCL Commands To Manipulate the Geometry of Two Helices, Introduction


Given two helices, we want to find the relative orientation that has the lowest energy. The two helixes are identical. We will first find their axes, then rotate one of them so that the axes are parallel. Then we will translate one of them so that the line joining the centroids of two axes is perpendicular to both axes at a distance you define. After that, the second helix will be moved along the line joining the centroids. It will be spun around its own axis and then it will also be rotated around the first helix. At each orientation, the energy will be calculated. The data will be written in a table file readable by the Insight program, so we can sort the data using the spreadsheet. All the different conformations are stored in an archive file and can be replayed within the Insight interface using the Analysis/Trajectory command.

Click here to go immediately to the tutorial lesson itself.


Besides some basic concepts concerning TCL and BTCL, the language that controls operations in the Discover 95.0 program, you will learn specific syntax and commands for:

Some Basic Concepts concerning TCL and BTCL

TCL, or Tool Command Language, allows general-purpose handling and flow control of programs. BTCL is the language Biosym/MSI developed based on TCL for controlling the Discover 95.0 program. BTCL has commands both general to TCL and specific to the Discover 95.0 program. The general language descriptions can be found in the TCL 7.3 Manual Pages. Commands specific to Biosym/MSI are documented as BTCL Commands.

This is a very flexible language allowing you to write procedures (or subroutines), control the flow of the program using conditional statements (e.g., if) and do repeated operations (e.g., for). It allows you to write customized application procedures at the user-interface level instead of having to modify the program itself.

A few basic concepts are central to understanding BTCL:

  1. ALL TCL argument variables are strings, and the symbol $ is used for variable substitution or returning the value of a variable.

    For example, in the MAIN COMMANDS section of the input file example that accompanies this tutorial:

       $mindist = 10.0
    
    This assigns the value of the variable mindist to be 10.0. When this value is later passed to the procedure fixorientation, $mindist has to be used instead of only mindist. Using the latter would cause an error, because the program expects a number, but mindist is a string.

    Another example in the MAIN COMMANDS section is:

       for {$j = 0} {$j <= $numspin} {incr j} {
    
    works, but

       for {$j=0} ....
    
    does not.

    This is because TCL interprets $j=0 as one string variable and there is no such thing. Hence it is important to put a space between a variable and an operation sign.

  2. All commands have the same syntax. It is:

    Command argument argument ...

    For example, in the definition of the procedure in the input file called fixorientation:

        geometry ang12 angle $axis1 $axis2
    
    geometry is the command, and ang12 angle $axis1 $axis2 are all arguments.

    However, not all arguments have the same function. Here, ang12 is the output and is the angle between the input lines $axis1 and $axis2. The argument angle is the operation that performs one of the functions that the geometry command is capable of performing. While ang12, axis1, axis2 are variables you can choose, angle is the operation and is defined by Biosym/MSI.

    The reason why ang12 does not have a $ is that the value of this string variable has already been updated in the subroutines that perform the geometry command.

  3. BTCL includes ``geometry objects''. The content of these objects, for example, $axis1, gives you only the reference point to get the values of these objects.

    For example, use:

        echo $axis1
    
        geometry#5
    
    To print out the value of that geometry object, the geometry command has to be used:

        echo axis1 = [geometry $axis1]
    
        axis1 = line {{11.0926 17.2649 3.27548}} {{-0.821539 0.123481 0.55662}}
    
    where the first { } contain the x, y,and z coordinates of the centroid of that line and the second { } contain the direction of the line.

  4. Commands are terminated by a semicolon (;) or the end of the line. In loops and procedures, an open brace { can serve as the end of the line also.

    The backslash \ at the end of a line indicates that the following line is a continuation of that line. Make sure there is no space after the backslash.

  5. Procedures have to come before the main commands section, which starts with the begin command.

  6. BTCL is case sensitive. For example, molGeom works but molgeom does not.

Helix Lesson, Instructions
Main access page Advanced-Use (BTCL) access.

BTCL - Tutorial Access

Copyright Biosym/MSI