How to Install Your Scripts into the Chime Template

Revised April, 1998 (for template version 2.4 ). Doc. rev. 4/25/98.

Provided for the NSF Educational Molecular Visualization Workshops at UMass, Amherst and Long Island U, Brooklyn NY, Eric Martz, PD.
http://www.umass.edu/microbio/rasmol/workshop.htm

If you are reading a paper version of this document, it is also available at http://www.umass.edu/microbio/rasmol/2fc-how.htm
Software, molecules, and visualization help is at the RasMol Home Page, http://www.umass.edu/microbio/rasmol

Thanks to Craig Martin and the students in his class on Biomolecular Structure, as well as pioneering efforts by Tim Maffett, David Marcey and Henry Rzepa which inspired the approach taken here.


This document assumes that you have saved some portable scripts with RasMol. Instructions for saving such scripts correctly are given in a separate document Preparing RasMol-Saved Scripts for Teaching, available at http://www.umass.edu/microbio/chime/prsswc/prssft.htm

  1. Copy all of the "minimal template" files into the same folder where your scripts and PDB files are located. In addition to your scripts and PDB files, you need ONLY these files, which are the "minimal template" file set:
      right-a.htm          main-cpt.js
      right-b.htm          2atoms.pdb
      right-c.htm          click.spt 
      left.htm             cs_amphi.spt
      twoframe.htm         cs_atgc.spt
      rightutl.htm         fontsize.htm
      rightucs.htm         up.gif
      cpk_cs.htm           down.gif
      vertemp.htm          [fontsize.js]
      font_how.htm         
    
      instruct.htm         contents.htm
      2frmcont.htm         mousesum.htm
      2fc-how.htm
    

    Only the files right-a.htm, right-b.htm, right-c.htm need to be customized (one or more of these depending on how many pages you need for your presentation). The others need no changes.

    [File fontsize.js is no longer needed but is provided to assist in installing font-size control into existing presentations.]

    The files grouped at the bottom are not needed unless you wish to put your presentation on the web. In this case, you'll also need to customize contents.htm.

  2. In Netscape Navigator 3.01 (or later), use the File, Open File menu to open the file twoframe.htm. All other files are linked to this file. You can use this window to test your progress as you follow the steps below.

  3. Editing HTML files. You will need a text editor to modify some HTML (HyperText Markup Language, web page) files. (Macintosh: Word or SimpleText. Windows: Notepad or Wordpad.) In Word or Wordpad, it is essential that (when given any other options) you save the files as plain text = ASCII text = MS-DOS text.

  4. Title. In the file right-a.htm, change the title of the page to reflect your topic. The title is near the top of the file, between big tags, like this:
    <big>
    Your Page A Title Goes Here
    </big>
    
    Now, reload the document in Navigator to see the change. (Click the Reload button at the top, or right-click in the right frame, and select reload frame.)

  5. Your first button/view. In the file right-a.htm, each block which looks like the sample below generates one square button. Each button will produce a view from one of your scripts. You need to change only the three parts in boldface. These are explained in detail in the next three steps below.
    <!-- Here is the first button -->
    <script language='javascript'>
    	button("script a010.spt");
    </script>
    
    <!-- Substitute the name of your .spt script file above.
    Below is the 'button-label-text' -->
    
    (script file a010.spt) Your button label goes here.

    (Items between <!-- and --> are comments which you see only when you are editing the HTML; the browser does not display comments.)

  6. Script filename. If you named your first script file a010.spt (a for Page A, 010 for the first script), you don't need to change the script name. If you used a different filename for your first script, rename your script file to a010.spt; or edit a010.spt to the name of your script in the above HTML and then save the file right-a.htm. Do not use a master script for a Chime button! Use one of the scripts you saved directly from RasMol for each Chime button.

    If you edited the script name in right-a.htm (and saved it as plain text), switch to your Netscape window and press Reload. Now try your script button.

    Troubleshooting. If your view does not appear when you press the button, you first need to be sure your script runs in RasMol. If you have problems getting your script to produce the view in RasMol, use the troubleshooting section in the document Preparing RasMol-Saved Scripts for Teaching.

    If your script runs OK in RasMol, but not when you press the button in Netscape, here are the possible reasons and solutions:

  7. Label. Change the button-label-text, for example (see above) "(script file a010.spt) Your button label goes here.", to describe the image your script creates when the button is pressed.

  8. Color Keys. When your view uses the CPK color scheme, you can show the color key by including this:
    <script language='javascript'>
        chonp_key();
    </script>
    
    A comment in right-a.htm lists additional forms of CPK color keys which are pre-programmed.

    You may also wish to color key words in the text you add to right-a.htm so they match the relevant parts of the view. An example in right-a.htm includes:

    <font color="#FF8080">
    protein chain A</font>,
    
    Change for example FF8080 to the color which makes your button-label-text match the color of the structure it describes. These colors are represented as three hexadecimal values, each with two digits; in this case, FF 80 80. The 3 values represent the intensities of Red, Green, and Blue (RGB) on a scale of 0-255 (0-FF hexadecimal). Hexadecimal equivalents of some colors are given in the RasMol Manual (as revised in late June, 1997, http://www.umass.edu/microbio/rasmol/distrib/rasman.htm#chcolours). You may use several colors for different parts of one button-label. See, for example, the second button in right-a.htm.

    More than 256 color names are defined in Netscape. So, for example, you can say

    <font color="white">
    However, except for white and black, it is difficult to match the color names to the colors used by RasMol. This is why we recommend using hexadecimal RGB values. For example, Netscape's "green" is much darker than RasMol's because Netscape expects to put it on a white background while RasMol expects to put it on a black background.

  9. Continue by adding second, third, ... buttons, and additional pages. For your second button, repeat the process of matching the script filename in the second button(...), inserting button-label text and color keys (all in right-a.htm). And so forth for the third and additional buttons/views.

    You can have as many or as few buttons/views per right-frame page as you wish. Delete unnecessary buttons, or cut and paste to add new buttons to provide one button per script.

    When changing topics, you can link to a new right frame page, for example right-b.htm, right-c.htm, .... Create additional such files by copying earlier ones. At the bottom of each file, link to the next one by editing the name of the file shown in bold:

    <a href="right-b.htm">Next Topic</a>
    You should now be able to display your entire script sequence in Netscape with Chime, starting from twoframe.htm.

  10. Web delivery. If you wish, you can put your presentation on the web simply by copying the files to your institution's web server.

    First, however, you will have to change the PDB filenames in all of your scripts' load commands to lower case (see Saving portable scripts). Web servers will not recognize an upper case PDB filename (e.g. 1D66.PDB); only a lower case name (e.g. 1d66.pdb) will be served with the correct MIME type targeted to Chime.

    It would be best to create a new folder on the server for the files, since eventually you may have several groups of images all using the same filenames twoframe.htm, left.htm, right-a.htm etc. This will work provided each set is in a different folder on the server. Contact your server administrator for details.

  11. Getting your server configured for Chime. If your presentation works from local files, but not from the web server, the problem is the configuration of the web server. Ask your server administrator to configure the server for the following MIME types: ".pdb" must be served as "chemical/x-pdb", ".spt" as "application/x-spt", and ".js" as "application/x-javascript". Also, ".htm" must be served as the same MIME type as ".html".

  12. Putting the best foot forward. For presentation on the web, you probably should start with instruct.htm instead of twoframe.htm. This in turn goes to an alternative form of twoframe.htm, 2frmcont.htm, which starts with a table of contents. If you use this startup sequence, you will need to edit the file contents.htm to reflect your presentation.

  13. This template assumes that all your scripts are RasMol-saved scripts. If you wish to utilize manually-created scripts, things can get considerably more complicated. In that case, be sure to consult the Guide to "Movie" Script Creation for RasMol and Chime, http://www.umass.edu/microbio/rasmol/makescrp.htm and also the various resources at the UMass Chime site, http://www.umass.edu/microbio/chime.


* Macintosh users: Use Word to edit RasMol-saved scripts, being sure to save the edited scripts as plain text. Open the script after you select All files from the Open menu (since scripts are not Word documents). You can create short scripts (such as master scripts) with SimpleText. However you cannot edit scripts saved from RasMol with SimpleText (because they don't have a SimpleText signature/icon, and they may be too long).

Feedback to Eric Martz.