If the SCRIPT option is activated, the program opens the script file. From that moment on the INPUT routines in WHAT IF will only read input from the script file, and no longer from the terminal. The prompts and answers that are read from the script are displayed on the screen in lines marked "SCRIPT>>>>>" and "SCRIPT<<<<<". Once End Of File on the script is reached, the prompt to the question is displayed on the screen, and normal input is resumed.
A useful exception to this rule is when the line that is read from the script reads "@HUMAN some text". When the keyword "@HUMAN" is encountered in a script file, WHAT IF will ask the question to the person working at the terminal instead. If extra text is supplied after the "@HUMAN" option, that text is used as the prompt instead of the standard prompt: in one of examples below "mutate residue" will be printed as the prompt. This makes "customizable" scripts easy to make.
Lines in a script that start with a number sign (#) are not interpreted by WHAT IF. You can use them to write comments for human readability of your script files.
For the automatic creation of a script, see the option AUTOON.
Lines that start with a dollar sign ($) are used by the SCRIPT option for special purposes (see below).
If the STARTUP.FIL file does NOT exist, WHAT IF looks in your login directory for the file ".whatifrc", and execute that instead (notice that the name of this file starts with a dot (.), so you won't see it every time you do "ls"). In no case will both STARTUP.FIL and .whatifrc be executed.
Your script file should then look like (without the texts starting with the esclamation signs of course):
SOUP !\ INISOU ! or simply combine these three by %INISOU END !/ GETMOL ! read the first file X.PDB ! file name X ! set name # This is a comment GETMOL ! read the second file Y.PDB ! file name Y ! set name COLOUR ! here you see again that the color commands are embedded COLATM ! between the command to go to, and the command to leave ALL ! the COLOUR menu. END ! INIT -1 ! Delete the graphics objects SHOALL 1 Q ! And create the new display
SOUP ! Go to the soup menu INISOU ! Initialize the soup GETMOL ! Read a PDB file 1crn.brk ! File name CRN ! Set name LISTR ! List the residues SHOHST ! Determine secondary structure ACCESS ! Goto the accessibility menu PARAMS ! Goto the sub menu for accessibility parameters ACPREC ! Set the accessibility precision 4 ! 0 is very fast, 2 is default, 4 is slow but precise ACCTYP ! Set the type of calculations 1 ! 0=molecular surface; 1=accessible surface END ! Return to the accessibility menu INIACC ! Initialize all accessibilities SETACC ! Go calculate accessibilities ALL ! Calculate for all residues 1 ! Molecule 1 will be used as 'environment' N ! We do not want to create a dot file for graphics DOLOG ! Open the log file ACCESS.OUT ! Name of the log file Y ! YES, we want to write a comment in the log file My comment ! Any comment up to 79 characters allowed Second comment ! Second comment line ! Empty line (or 0) to indicate end of comment SHOACC ! List the accessibilities per residue 11 20 ! Residues to be listed 22 ! Residues to be listed 0 ! No more residues to be listed ANASRF ! Analyze the total surface M1 ! Analyze molecule 1 NOLOG ! Close the log file
DOLOG ! We want to make a log-file of our work mutation.log ! named mutation.log N ! without any comments GETMOL X ! Read in the molecule ! with the default set name X MUTATE ! Starts the mutation @HUMAN Residue mutate: ! Get the residue from the terminal Y ! Use the experimental version ! Show the possibilities by typing nothing @HUMAN Mutate to: ! Get the new residue from terminal %MAKMOL ! Save the resulting coordinates X.PDB ! Header from X.PDB mutation.pdb ! Into mutation.pdb, Mutated file by WHAT IF ! comment 0 ! No more comments m1 ! molecule 1 n ! and nothing else NOLOG ! Close the logfile FULLST Y ! End WHAT IF
&TEXT Between the command $TEXT and $ENDTEXT you can put some text that will be put literally in the text window. At the end of this text you get the `Give return to continue` prompt &ENDTEXT # Set language to Dutch ! This is a comment DUTCH CRIPLE ! Make WHAT IF cripple for tutorial purposes SMPLON ! MOL-objects and items are set automatically SOUP INISOU ! Indenting is allowed in scripts START X ! Reads in the standard demo molecule (crambin) END # Now we will do graphics! This is a comment GRAFIC INIGRA ! Initialize the graphics window VIEWOP SCRIPT ! Here we call a script from a script SHOALL ! SHOALL is a script (see below) SCRIPT SHOHBO ! SHOHBO is a script see below ITMADM OBJON 1 ! Make sure MOL-object 1 is on upon GO OBJOFF 2 ! Make sure MOL-object 2 is off upon GO END CENTER GO ! Center graphics screen and pass control to it SMPLOF ! Prompt user again for MOL-objects and MOL-items ENDThis script calls the scripts SHOALL and SHOHBO. And these in turn call again a script called COLATM. You better make sure that scripts do not call each other in two directions. Also, you should not make the tree of scripts that call each other deeper than four calls. The subroutine scripts given below explicitly require that the SMPLON option was used.
# Script subroutine SHOALL # # Colour all atoms by atom type and display them # SCRIPT ! Call the script called COLATM (see below) COLATM SHOALL ! This is command SHOALL, not the script!
# Script subroutine SHOHBO # # Display all hydrogen bonds coloured by atom type # SCRIPT ! Call the script called COLATM (see below) COLATM HBONDS ! Go to the hydrogen bonds menu SHOHBO ALL ALL N ! Execute the SHOHBO command END ! Return to the menu where we came from
# Script subroutine COLATM # # Colour all atoms by atom type # COLOUR ! Go to the colour menu COLATM ALL ! Colour all atoms END ! Return to the menu where we came from
The second file, the normal script file, has as default name SCRIPT.FIL, and is described above (see SCRIPT).
WHAT IF will start executing the INISOU command (see INISOU in the SOUP menu), and will thereafter run the script for each file listed in the file with file names.
Be aware that the script is executed over-and-over again. So, if for example, you create a log-file in the script, and close it in the script, WHAT IF will for every new PDB file create this log-file and close it again, thus overwriting the log-file from the previous PDB file every time. In such cases, you should open the log-file before the LSCRIP option, and close it afterwards by hand.
The boxes are labeleb 1 - 12, 13 - 24, and 25 - 36 for the top, middle and bottom ror respectively. So, MOL0 can be activated with `BUTON 25` and the labels can be switched on with `BUTON 36`.
The boxes are labeleb 1 - 12, 13 - 24, and 25 - 36 for the top, middle and bottom ror respectively. So, MOL0 can be de-activated with `BUTON 25` and the labels can be switched off with `BUTON 36`.