Getting the servers installed and running on your own machine
If you want to have your own in-house WHAT IF - based servers,
proceed as follows.
- Buy a version of WHAT IF
- Read the server installation notes and do as you are told.
I don't think the present set up will work with a Windows machine as server, but
a real hacker can probably get it going by using the spirit of the installation notes
rather than the literal implementation.
If you set up your own server, then you need
- Our permission
- Give proper credits and acknowledgements
- To be responsible for your servers and check all of them carefully by hand.
If you want to make the servers available to paying users, you need our
written permission. Making servers available to the whole world, free of costs,
go ahead, for that you have our permission already.
How to add an entry to your own server
To make your own server you need to understand WHAT IF, or have a VERY
good connection with the WHAT IF team in Nijmegen (the going rate for
servers is one bottle of single moult whiskey, 15 years or older per server).
In your server area you find the file WhatifServers.py. This is the
only file that you have to edit. Make a backup of this file first.
In WhatifServers.py you will find one description unit per server. I
will describe the server that lists cysteine bridges and the server that
draws a ramachandran plot.
Example 1
The description text for the cysteine bridges server looks like:
1) listcys={
2) 'name' :"""Cysteines and cysteine bridges""",
3) 'intro' :"""This server will list cysteine bridges and free cysteines.""",
4) 'methods':"""Two cysteines are called a bridged pair if the distance between
5) their sulphurs is between 1.5 and 2.5 Ångstrom
6) """,
7) 'input' : [ ['&TWO1','Choose'] ],
8) 'wifcom' :"""
9) getmol &TWO1 set\n
10) soup\n
11) &STARTLOG\n
12) shocys\n
13) """,
14) 'notes' :""" """,
15) 'output' :"""The following cysteine bridges and free cysteines are present:""",
16) 'outnot' :""" """,
17) 'program':"""GenericCGI.py""",
18) 'picture':"""access-server.gif"""
19) }
Ofcourse the first four character of each line should not be there (listcys,
getmol, etc., that now start in column 5 should be left justified).
The format given above looks very rigid, but actually, there are only
very few format aspects that are really fixed. Many blanks are allowed,
things can be put on one line or many lines, etc. I prefer this rather
rigid format because it makes me spot typographical errors more easily.
The text strings for 'name', 'intro', 'methods', 'notes', 'output'
and 'outnot' are normal HTML, so all normal HTML text format commands such
as A HREF=, STRONG, BR, P, etc., can be put in here, but please don't use
global HTML commands such as HEAD, TITLE, etc., and try to be very careful
with H1, H2, etc.
The general format of a server description is:
name={'option':'text', 'option':'text', 'option':'text', etc.}
If the text has to span multiple lines it should be enclosed in """ (triple
double quotes rather than single quotes). Every 'option' should ofcourse
have a different name.
Given this example, you should be able to make your own servers 'by
homology', but we will explain them anyway, and we do that line by line.
Explaining HTML in HTML is difficult because all these beautifully standard
HTML browsers react differently on my attempts to use > and <, so i
will not use these greater than and less than symbols around my HTML text
in the explanation below.
- The first line holds the name of this server. Make sure the name is unique
and I suggest that you make this name a function of the major option to
be executed by the server. The ={ is obligatory, but extra spaces are allowed
here.
- 'name' is associated with the title for the server in the list of servers
per class. It is also the title of the server once you activate a server.
I suggest that you try to keep this title at about 5 words.
- 'intro' is associated with the short text underneath the title in the list
of servers per class, and it is the introduction text in the actual server
page. I suggest you restrict this text to 1-3 lines of text (that is roughly
up to 40 words).
- 'methods' is associated with the methods paragraph in the actual server.
I suggest you explain here carefully what the server does, and try to give
some explanation of any boundary conditions that you have put in the WHAT
IF script. There are no limitations to the amount of text you can put here,
but I suggest that if you use a construct like A HREF="my_text.html"click
here"A and put the file my_text.html in the sever's html directory.
- 'methods' will most times extend over more than one line
- I put the closing tripple double quote always exactly underneath the opening
one, but you can just as well put this """ at the end of the previos line.
Don't forget the comma at the end of the """
- 'input' tells the server which boxes for input to put in the input form.
The format of this line is
'input' : '[ ['&NAME','text'], ['&NAME','text'], ['&NAME','text'], etc. ],
in which &NAME should of course be different for each of them. The
'text's are the texts that will be put next to the input boxes in the input
form. In this example, [ ['&TWO1','Choose'] ], &TWO1 will later
be used in the WHAT IF script to get the name of the PDB file from the
input form. the text 'Choose' will tell the input form that the user should
get two boxes, one for a 4 letter PDB code and one for a file from the
local directory. The three characters in the middle have a fixed meaning:
- TWO : two input boxes for a PDB file (4 letter code or local file)
- PDB : for one box for a local PDB file
- FIL : for just any file
- RES : for a residue number
- ATM : to get an atom
- NUM : to get any number
- : for a checkbox
The final digit should just sequentially run from 0 till 9.
- 'wifcom' is associated with the WHAT IF script. This is the most difficult
part of the description file. I normally run WHAT IF in one window to test
the commands, and run type them when they work in the 'wifcom' block in
another window in parallel. In general, if WHAT IF can do it, a server
can do it, but since servers cannot execute WHAT IF's GRAFIC command (because
they cannot open an interactive window) some dirty tricks are needed. the
following rules hold:
- Don't use too much type ahead.
- Don't indent. If WHAT IF gets 25 times the same, wrong command, if crashes.
And a blank character is seen as a wrong command.
- End all lines with \n (\n is the same as giving a RETURN in an interactive
session).
- If WHAT IF offers a default that you want to use, put a \n in the 'wifcom'
text.
- Put in &NAME as described for the previous line if you need input from
the WWW input form.
- Use &STARTLOG\n shortly before you execute the command that produces
the output. This makes sure that a logfile is created (executes the complete
DOLOG command, including the file name) with a log-file name that the server
knows about so that the output can be put in the page that is returned
to the user.
- Don't use FULLST at the end. The server generator does that automatically
for you
- This line executes GETMOL on the file that is obtained from the input form.
The setname will be 'set'.
- This brings you in the SOUP menu.
- The command &STARTLOG\n opens the logfile
- this line executes the actual command we are interested in.
- Don't forgat to put """, at the end (this can also be put at the end of
the previous line, but that is easier to forget.
- 'notes' are extra notes for the input form. Seldomly needed.
- 'output' is associated with the text that ends up on top of the output
page that is returned to the user. Be aware that the user can not see the
input form when looking at the results, so it does not hurt to repeat some
of the key information in WHAT IF does not write an extensive table header
or so. Sometimes it might be useful to put a pointer to a WHAT IF writeup
chapter in the 'output' record.
- 'outnot' is associate with an extra note on the output page. Seldomly needed...
- 'program' is associated with the method of returning results to the user
the following possibilities exist:
- 'GenericCGI.py', to return the log-file to the user. You have to create
a logfile via &STARTLOG in order to use this script.
- 'FiledownCGI.py', to return a generated any file. If you used MAKMOL in
the 'wifcom' script you can offer the dpownload of a pdb file, for instance.
You can put in the logfile here. The logfile is created via &STYARTLOG
and named listcus.log in the example above.
You have to include an extra field called 'filedown' in the set up. See
htopo in WhatifServers as an example.
- 'ChecksCGI.py', to return the tex and txt files that result from the CHECK
servers.
- 'PictureCGI.py', to return a gif file (see next example)
- 'picture' is associated with the gif that is shown in the top left corner
of the page for this server. This is a rather unimportant keyword and this
line can just as well read: 'picture':''
Since this is the last line, no komma is needed at the end.
- } is needed to close the description of this server. This symbol can also
be placed at the end of the previous line, but this way it is more difficult
to forget it.
After you have created the server you need to register it in a class in the '_group' list.
These classes are listed at the top of 'WhatifServers.py' like (there are many more
of course, but you can read that yourself):
_groups = [{'name': 'model',
'title': 'Build/check/repair model',
'options': ['makemodel', 'fullcheck', 'modcheck',
'corall', 'debump', 'compare']},
{'name': 'validate',
'title' :'Structure validation',
'options' :['namchk','oldqua','bndchk','structes','plnchk','newqua',
'axachk','hndchk','ramchk','omechk','pucchk','accchk','angchk','symchk']
} ]
The string you give in 'name' will be the name of the html-file for this class.
The 'title' string will appear on the left hand side.
In the option list you have put in the name of your new server.
Note that you can register your server in more than one class.
Example 2
The server that makes a Ramachandran plot looks like:
1) ramaplot={
2) 'name' :"""Ramachandran plot""",
3) 'intro' :"""This server will display a Ramachandran plot.""",
4) 'methods':"""This server will display a coloured Ramachandran
5) plot. Blue means helix, red means strand and green means turns and random coil.
6) The lines in the plot indicate prefered areas. The outer lines
7) encircle the area within which 90% of all crosses of the same
8) colour should be found; the inner lines indicate the 50% area.
9) """,
10) 'input' :[ ['&TWO1','Choose'] ],
11) 'wifcom' :"""
12) getmol &TWO1 set
13) plotit nowind
14) gratwo
15) phipsi all 0 1 A
16) plotit setfly
17) pstplt
18) n
19) y
20) n
21) A 1.0 0
22) 0
23) Ramachandran-plot
24) """,
25) 'notes' :""" """,
26) 'output' :"""The Ramachandran plot. Blue
27) Some txt removed.
28) """,
29) 'outnot' :""" """,
30) 'program':"""PictureCGI.py""",
31) 'group' :"""graph2d""",
32) 'picture':"""access-server.gif""",
33) 'images' :["""PLOTR.101.gif""",]
34) }
All things that have been described in Example 1 will not be repeated here.
Here I will only discuss the WHAT IF script (that is the text for the 'wifcom'
command:
1) getmol &TWO1 set
2) plotit nowind
3) gratwo
4) phipsi all 0 1 A
5) plotit setfly
6) pstplt
7) n
8) y
9) n
10) A 1.0 0
11) 0
12) Ramachandran-plot
- getmol &TWO1 set\n is the same as above, it reads a PDB file as indicated
in the form
- plotit nowind\n is needed to tell WHAT IF that we are going to do some
graphics. This is needed, because the server cannot open a graphics window,
so some extra things must be done, like automatically centering the vectors
that would be drawn at the screen otherwise. Also all kinds of WHAT IF
savety mechanisms will be overruled with this command and the texts "Do
you want a graphics window", "Second part of option not executed without
graphics window" etc., are all skipped.
- gratwo gets us in the two dimensional graphics menu
- phipsi all 0 1 A\n makes a Ramachandran plot. 1 in the MOL-object number
and A is the MOL-item name. The file A.WPL will be generated. This is a
normal WHAT IF vector file, and if you can find this file on your system,
you could even read it in and display it with the GETITM command in an
interactive WHAT IF session.
- plotit setfly\n this gets us in the PLOTIT menu and tells WHAT IF that
we don't want a PostScript file, but a gif file.
- pstplt normally makes a postscript file, but now a gif file
- n no stereo
- y yes we want colour
- n no, we do not want depth cueueing
- A 1.0 0 we want to put MOL-item A in the gif with 1 unit thick lines
and dashing type 0 (that is no dashing)
- 0 no more MOL-items
- Ramachandran-plot we call the thing Ramachandran-plot, but nothing is
done with this name (but don't forget it, there must be something here
because WHAT If wants to read something).
In order to notify the web interface which plots to put in the output page put the names of the file in the 'images' list.
You always have to put the images tag in if you make use of the PictureCGI.pm class.
Email Vriend@cmbi.ru.nl
if you have questions.
(C) G.V. 1 Oct 2007