BobScript version 2.4: the manual

This manual describes Robert Esnouf's extensions to version 1.4 of MolScript.

Only enhancements to the original program are described, for other information on MolScript versions 1.4 and 2.0 see the official MolScript web site.

Last update to the manual: 12 December 1997.

Contents:


New to version 2.4:

BobScript v. 2.4 is quite a major upgrade from version 2.3. These are the main changes to the program since the last version:


Introduction

This manual is the document describing the changes I have made to the drawing program of Per Kraulis called MolScript version 1.4. There are many changes to the program, some of which are due to necessary reorganisation of drawing routines, meaning that the BobScript source code is 50% longer than MolScript and that there are significant differences in the rest of the code. However, despite all these changes, a normal MolScript file should still run with BobScript and produce virtually identical results to the naked eye.

The manual starts off by describing the functions provided by BobScript and assumes that the reader is familiar with MolScript syntax. The main areas of added functionality are: sticks and spheres, stereo pictures, flexible colouring (colour ramping) and map drawing. The following sections describe the syntax more formally, in a manner like the original MolScript manual. A full list of additions and changes to Per Kraulis's original syntax is finally followed by a few example scripts which might be of some use as a cookbook.

Since most people seem to draw pictures based on previous examples I have really tried to put lots and lots of practical (and not-so-practical) examples into the text. Fragments of syntax follow each description to illustrate each point and there is a whole section at the end which covers many of the things people are likely to want to do. At the end of each section I give list which of these examples rely on syntax described in that section. However, it may still be best to find a picture you like drawn by someone else and then try to steal the input file.


Drawing sticks and spheres:

Drawing Sticks

In MolScript, sticks are drawn as single units coloured according to the 'planecolour' parameter. BobScript draws sticks as a series of segments, the number being controlled by the parameter 'sticksegments' (with a default value of 1). Colouring is controlled by the 'planecolour' parameter unless a colour ramp is in force for sticks. Quite some effort has been spent in trying to make the results with PostScript plots look as similar to the original program as possible. There are four advantages of this change to the stick drawing:

  1. Sticks can have smoothly varying colour ramps applied to them. This looks particularly nice for showing how the B factor might vary over a protein or inhibitor. A large number of stick segments are required to make this effect look really good.

    set sticksegments 20;
    colour ball-and-stick by b-factor from 10 to 40;
    ball-and-stick in residue 999;
    
  2. It is possible to produce split bond representations for molecules. This is a very commonly used feature where the stick colour changes half-way along each bond depending on atoms at each end of the bond. It is best achieved by using two stick segments and colouring the ball-and-stick by atom colours.

    set atomcolour atom C* grey 0.7;
    set atomcolour atom O* red;
    set atomcolour atom N* rgb 0 0.3 1;
    set atomcolour atom S* rgb 1 0.8 0;
    set sticksegments 2;
    colour ball-and-stick by atom;
    ball-and-stick in residue 999;
    
  3. With PostScript output each graphic object is sorted according to the Z- coordinate of the centre of the object. In MolScript, sticks are just a single object whereas with BobScript each stick segment produces an independent object. Whilst it can make files a lot bigger, it can be very useful when drawing superpositions of structures to use lots of stick segments so that intersections of bonds and atoms are drawn approximately correctly. Within limits, the more sections the better the result. This ONLY applies to PostScript output, with rendered output intersections are handled properly.

    set sticksegments 10;
    colour ball-and-stick red;
    ball-and-stick in molecule mkc;
    colour ball-and-stick yellow;
    ball-and-stick in molecule tnk;
    
  4. Multiple stick segments enable the drawing of dashed bonds for hydrogen bonds and in other unusual situations. By using an appropriate value for the 'bonddistance' parameter and by specifying each line separately, sticks can be drawn between pairs of atoms with individual commands. These sticks can be colour ramped in rather exotic ways, one of which results in beautifully dashed lines made up of little cylinders. This is only really of use with rendered output, with PostScript output dashed lines are probably more convenient.

    set bonddistance 5.0;
    set stickradius 0.05;
    set atomradius atom * 0.2;
    set sticksegments 25;
    colour flat-ended fractional ball-and-stick
      from white via ramp break at 0.04 to white at 0.12;
    ball-and-stick either require in residue 101 and atom O
                       or require in residue 999 and atom N1;
    ball-and-stick either require in residue 103 and atom O
                       or require in residue 215 and atom N;
    

    The 'bonddistance' parameter is set to a value at least as big as the largest atom separation to be linked by a hydrogen bond. I have done the usual trick of making the atom radius four times the stick radius. This means that the bond will be like a capped stick rather than ball-and-stick. The number of stick segments and the fractions in the colour ramp have to correspond otherwise strange results might occur. In this case I have used 25 stick segments, each one corresponding to 0.04 of a stick. Thus the colour ramp forces one segment of white stick to be drawn and then skips two segments. The ramp automatically repeats, hence producing a dashed line. A small modification of this ramp would produce striped black and white sticks:

    colour flat-ended fractional ball-and-stick
      from white via black at 0.04 to black at 0.12;
    

Further to all this, there is now a new parameter, psintersect, that can be switched on to make BobScript attempt to calculate the intersections between the end of each stick and the atom ball. This only affects PostScript output and can result in a small, but noticable improvement. See the section describing new parameters for a description of this parameter.

Styles of Drawing PostScript Spheres

Normal MolScript produces CPK spheres with little windows and cartoon-style shading. This is the default in BobScript, but three other representations can be used. With spheres of very small radius, the window and shading can obscure the colour, so it's now possible to draw simple coloured circles. These also have the advantage of drawing much more quickly - useful for CPK pictures of viruses et cetera. My favourite method is to draw PostScript CPK spheres as approximations to a sphere lit by a light from the top-right. This is a fairly crude approximation, but for spheres up to about 2cm across is quite adequate. The final possibility is a more mathematical rendition of the same lighting effect. It draws slowly, and so should only be used for very big atoms. The parameter 'pscpk' controls which of these ways of representing CPK atom is used for PostScript pictures. This parameter does not affect rendered pictures.

set atomcolour atom FE orange;
set sticksegments 2;
colour ball-and-stick cpk by atom;
set pscpk shaded;
ball-and-stick in type HAEM;
set pscpk highquality;
cpk atom FE*;

The Z-coordinate attributed to a CPK object is now the centre of the sphere rather than half-way between the front of the sphere and the centre. This makes a slight difference to depthcueing, but affects the order of drawing. It allows multiple segment sticks to meet their atoms (more) properly.

Intersections Between PostScript Spheres

A major improvement for drawing CPK representations is the psintersect parameter described in the parameters section. This only affects PostScript output and causes BobScript to try to calculate how the different spheres intersect each other. The parameter can take to values 'off' (the default, no difference from MolScript) and 'on' test for intersections between these spheres. Setting 'psintersect on' can make the PostScript file several times larger, but the results are impressive. Note that you can turn on intersetion tests for just some atoms and off for others. Tests will only be made between pairs of atoms which are selected for intersection tests. Typically you might want to turn intersection tests on for CPK objects, but off for surrounding ball-and-stick objects. The syntax is trivial:

set pscpk highquality;
set psintersect on;
cpk atom *;

Comparing the result of this input file with that of an input file with 'set psintersect off' should convince you of the value of the extra computation involved.

BobScript Syntax Introduced And Used In This Section

Relevant MolScript Tips And Hints

Sometimes PostScript ball-and-stick pictures can look a bit dark, especially if the scale is small. This can be improved by reducing the colour depthcueing, reducing the depthcueing on linewidths, reducing the linewidth and using flat CPK representations. For example:

set colourdepthcue 0.2;
set depthcue 0.0;
set linewidth 0.001;
set pscpk flat;

Stick tapering is supported with BobScript in an analogous way to MolScript, but personally I don't find it very useful for representations of complex protein structures. I usually turn it off completely:

set sticktaper 0.0;

To produce capped-stick representations of molecules, use the ball-and-stick syntax but set the atom radii to four times the stick radius. This works very nicely with rendered images, but the results are not so hot with PostScript.

set stickradius 0.15;
set atomradius atom * 0.6;
ball-and-stick in molecule tibo;

For PostScript ball-and-stick images, problems with the way sticks and spheres overlap each other mean that in unfortunate cases the results can look rather dodgy. Bad cases occur when the stick has a similar radius to the atoms. This problem can be reduced by setting the psintersect parameter on. Otherwise, it can make things look a bit better if the linewidth is reduced.

set psintersect on;
set linewidth 0.2;
set stickradius 0.1;
set atomradius atom * 0.6;
ball-and-stick in molecule tibo;

Creating Stereo PostScript Pictures

With MolScript you have to produce PostScript stereo pairs by having separate drawing commands for each eye's image, specifying a relevant area for each image and specifying the relevant rotations in 'transform' commands. With the current version of BobScript the first two steps are still necessary, but the last one has been made easier and improved.

Drawing Stereo PostScript Pictures

To produce left- and right-eye pictures for a stereo pair the same graphical objects have to be drawn in each case but with a rotation (about the vertical axis, typically of 6 degrees) between images. In MolScript these rotations are supplied by the user within the transform commands, which is fine except that when a slab is in effect different objects can be drawn in each picture. This problem is usually most serious when maps are being drawn, and the presence of objects in the image for one eye only can make the stereo illusion much less convincing. (There can be a similar effect due to the width of a window, but this problem is much less serious and is basically unavoidable.) BobScript improves the situation dramatically by uncoupling the left- and right-eye parts of the transformation and only applying those final rotations after the slabbing has been performed. This feature is particularly recommended when maps are involved, but should always be used since it makes the body of the input file for each picture the same.

There a two BobScript commands that are relevant to stereo PostScript picture generation: 'leftstereo' and 'rightstereo'. These words follow directly after the 'plot' command (and after the word 'noframe' if that is used) but before the definition of the area of the plot:

plot leftstereo;
area 105 400 295 700;
(Your BobScript input commands)
  .
  .
  .
(End of your BobScript commands)
end_plot

plot rightstereo;
area 305 400 495 700;
(Your BobScript input commands)
  .
  .
  .
(End of your BobScript commands)
end_plot

The rest of the input file is then the same for each picture. By default the left- and rightstereo commands rotate the image after slabbing by 3 degrees in each direction. It is possible to change this angle (see below) if desired. The 'leftstereo' image is the image for the left eye, ie the image that goes on the left for a straight-eyed (viewer) stereo image. THis is not a truly accurate production of stereo, and a better one is being introduced into the program, which will also allow proper tapering of objects into the distance.

BobScript Syntax Introduced And Used In This Section

Relevant MolScript Tips And Hints

There is very little that can go wrong with stereo diagrams using these commands. The biggest worry is usually what size to draw the picture. The key thing is the width of the figures, and the values for the area given above are pretty much the biggest width you can get away with for straight-eyed stereo. The area command takes four numbers:

area LEFTX.r BOTTOMY.r RIGHTX.r TOPY.r ;

where the units are in points (1/72 of an inch). The recommended spacing for stereo pairs is between 6 cm and 7.5 cm. Converting to points, this gives a maximum picture width of about 200 points (as in the above example). For good stereo the vertical positioning of each picture should also be the same for each picture, but the actual height is irrelevant.


Using the draw Script and Creating Stereo Rendered Pictures

To produce a rendered view from a MolScript input file involves more than one program. First, MolScript (or BobScript) is run with the '-r' flag to produce Raster3D output. This file usually called an 'r3d' file. The start of this file controls the lighting and viewpoint parameters. If a file called 'header.r3d' exists in the current directory then that is used to get the values for these parameters, otherwise a default set-up is used. When producing stereo pairs of images, the 'r3d' file is duplicated with slightly different header information appropriate to the other eye view. The 'r3d' files are then used as the input to the 'render' program (from the Raster3D suite). This program writes out a picture file in 'rgb' format (on SGI machines) which is then viewed using a suitable viewer like 'ipaste' or 'xv'. All this command entry is rather time consuming and the large intermediate 'r3d' files clog up diskspace. The 'draw' script (not really part of BobScript, but...) makes all this a lot easier.

Drawing Mono Rendered Pictures

The Oxford set-up of BobScript has all the executable files and the 'draw' script in the /usr/local/bin directory. This is in every users path by default. To produce a rendered image from a BobScript input file (called 'file.inp'), all the user has to do is type:

draw file.inp

This produces the 'r3d' file (taking note of the header.r3d file) and sends it to 'render' to be rendered. Then the intermediate 'r3d' file is deleted and the final picture displayed with 'ipaste'. In this case the intermediate file is called 'file.r3d' and the final image is called 'file.rgb'. The image may be removed from the screen by moving the pointer over the image and typing the ESC key. It may be redrawn using the command:

ipaste file.rgb

or imported into 'showcase' for labelling.

Drawing Stereo Rendered Pictures

Producing stereo images is nearly as easy as producing mono pictures using the 'draw' script. To produce stereo images the 'r3d' file is fed into a little program called 'makeright'. This produces an identical copy of the input 'r3d' file, but both the view point and light source are rotated about the vertical axis by six degrees. The 'render' program is then run separately for each 'r3d' file. The 'draw' script has two command line switches which cause stereo pairs to be drawn:

draw -s file.inp

or

draw -stereo file.inp

and

draw -c file.inp

or

draw -cross file.inp

The switches stand for 'stereo' (or 'straight-eyed stereo') and 'cross-eyed stereo'. They both produce identical pairs of intermediate files (which are called 'file_left.r3d' and 'file_right.r3d') and identical 'rgb' files (called 'file_left.rgb' and 'file_right.rgb'). The only difference is that with the '-s' switch 'file_left.rgb' is displayed on the left-hand side of the machine, with the -c switch it is 'file_right.rgb'. Whichever switch is used, the file called 'file_left.rgb' forms the left eye image for straight-eyed (viewer) stereo.

Command Line Switches For The draw Script

There several other command line switches that are interpreted by the 'draw' script. They may be combined in any order where appropriate. This is the complete list:

Converting From rgb Files To TIFF Files

For some printers and slide makers it is necessary to produce TIFF files of the images. The easiest way to convert 'rgb' format files to TIFF files is to use the SG ImageWorks application 'imgcopy'. In the Oxford set-up you do not need enough disk space to store your TIFF file, it can go straight to the folder used for the slide maker, for example:

imgcopy -ctl file.rgb /slide/Robert/file.tif

The -ctl switch changes the origin of the image to top-left, which is what the slide maker expects. The 'imgcopy' utility knows that the output should be TIFF because of the output file extension.

Relevant MolScript Tips And Hints

The lighting of rendered images is a perennial problem because of the widely varying response of different screens, printers and films. The default colour set up is fine for photographing the screen. For the slide maker and printers the colours can appear very dull. They can be brightened up in Photoshop or using 'xv' on the SGIs (and elsewhere), but I feel it has to be better to find a good lighting set up for the rendering program. My currently favoured header.r3d lighting set up for slides and prints is:

0.40      secondary light contribution
0.10      ambient light contribution
0.60      specular reflection component
40.0      eye position
1 1 1     main light source position

and to use a small 'colourdepthcue' factor in MolScript (typically 0.2 to 0.4). For comparison, the default header.r3d set up is:

0.20      secondary light contribution
0.05      ambient light contribution
0.40      specular reflection component
4.0       eye position
1 1 0.8   main light source position

The draw script can actually process several files, one after another. So, if you have a series of input files (all called something.inp) and you change the header.r3d file you will want to run 'draw' for everything again. This is conveniently done in one command:

draw file1.inp file2.inp file3.inp ...

or

draw *.inp

If you are trying to photograph a stereo pair of images from the screen then change the header file so that the width of the picture is 40 (and the height is 64), rather than the full screen 80. Since this will scale down the image by a factor of 2, the 'window' in the MolScript input file may need to be altered. The two images can then be displayed in the correct position for straight-eyed stereo by the command (reverse the order of images for cross-eyed stereo):

ipaste -n -o 0 0 file_left.rgb ; ipaste -n -o 640 0 file_right.rgb

Some Stuff About Using Showcase

Labelling of rendered images is usually done with Showcase. The most important thing to remember with Showcase is to use full colour mode. To start Showcase for a full screen picture in full colour mode type:

showcase -b -P1280,1024

Remember that you don't need to work at 100% of full size: Showcase will not lose resolution. The align gizmo is a very useful tool, things look so much better if things that should line up acutally do line up, rather than just being approximately correct. It is also almost essential for putting on stereo labels: your eyes will make a much better stab at depth cueing if the vertical positions of each pair of labels matches properly.

If you want to use 'snapshot' to get a labelled image in 'rgb' format from a Showcase file then you can get the full size image on the screen without (much) of a border with the command:

showcase -n -b -s file.show

The drawbacks of this approach to getting slides is that you can't do anything that is bigger than the screen (1280x1024 resolution) and text is only reproduced at the screen resolution. With a properly written TIFF file (not an option with Showcase) or a PostScript file both of these limitations can be relieved, although the output files are a lot bigger.


The Colour Ramping Command

Colour ramping is the most complex new feature added to BobScript. It affects almost every drawing command and overrides others automatically. The original BobScript syntax was frequently rather clumsy, and certainly not intuitive. I have added extra flexibility to version 2 of BobScript which should mean that the same features are available in a more understandable way! Colour ramping is entirely controlled by the single command 'colour'. A complete definition of its syntax is a sizeable part of the whole MolScript syntax, but for almost all cases the simpler forms will suffice. I give lots of examples in this section to show how easy it can be! One rule of thumb is that you should rarely need to use the 'planecolour' and 'plane2colour' parameters to control colour. There is probably an easier way to do it using 'colour'.

What Are Colour Ramps?

The best lead in to colour ramping is to consider why I started on these changes in the first place. For a particular figure for a paper (on BTV-10 VP7, Grimes et al. (1995), Nature, 373, 167-170) there was a desire to have a picture of the structure showing its secondary structural units with colours varying from blue to red along the sequence. This figure is possible using the colour ramping options in O, but the algorithms there are more suited to interactive graphics use than static high-quality publication figures. Experiments were made to use rendered MolScript pictures that specified colours for each secondary structural element. Whilst the quality of rendition was high, the colouring scheme had none of the smoothness of the original O picture. So, during a lazy late summer week I sat down to perform a thorough biopsy of the MolScript source and created the first colour ramped MolScript picture (Figure 1(b) of Grimes et al.). Having done the hard graft of introducing the ability to perform any sort of colour ramping, I then set about generalising the concept and introduced the 'colour' command to MolScript.

For BobScript, a colour ramp is just a definition of a colouring scheme. As each graphical object is drawn (eg a tiny piece of coil, helix or strand), a check is made on that object based on the type of object it is, the atoms that were used to calculate the position of the object and what fraction of the distance between the two atoms the object corresponds to. From this information, the colour ramping code can decide whether the object is affected by a ramp and, if so, what colour should be used. If the object is not subject to a colour ramp then the standard MolScript 'planecolour', 'plane2colour', 'atomcolour', et cetera are used. Thus, the colour ramps override the less flexible MolScript syntax. A colour ramp can represent a smothly changing colour, as in the example described above, but it can also define jumps in colour, changes of drawing mode as well simple constant colours.

BobScript can handle the definition of independent colour ramps for each of the different type of graphical objects, plus a couple more for luck. The ramps which may be defined are: coil, turn, helix, rod, strand, cpk, ball-and-stick, ribbon, trace, bonds, line, label, second-ramp and third-ramp. The names 'ss' and 'all' are shorthand for the ramps making up secondary structure pictures (coil, turn helix, rod and strand) and all ramps, respectively.

BobScript implements three types of colour ramping. By type, I mean that the colour is controlled by different properties of the contributing atoms. The simplest is colouring based on the sequence, like the Nature picture. The colour ramp starts at the N-terminus and goes smoothly through to the C-terminus. The second ramp type is one where the ramp is controlled by the B factors of the contributing atoms. As well as the obvious use in showing variable areas of a structure, other numbers can be written into the B factor column and hence other properties can be mapped onto the structure. For an example of these types of picture see Fig. 3(a), Ren et al., Nature Struct. Biol. (1995), 2, 293-302 and Fig. 2, Esnouf et al., ibid., 303-308 (the so-called tomato-plant picture). The final sort of ramp is one where the controlling feature is the atom colour of the contributing atoms. In this case the colour ramp itself can also be inferred from the atom colours and (usually) no further colour specification is necessary. The biggest use of this type of ramp is to produce atom-coloured split-bond ball-and-stick representations (eg Fig. 3, Esnouf et al.), see earlier in the manual for example input files.

By the way, for drawing the secondary structure graphics objects (coil, turn, helix and sheet) the coordinates are calculated solely based on the CA atoms of each residue (the rest don't even need to be defined). To fit in with this the atoms used for calculating colours for these objects are also the CA atoms. With CPK objects, each object depends on only one atom. This is passed to the ramping code and the fractional distance between two atoms is always 0.

Just one more point before getting down to the nitty-gritty of ramping - since each graphical object identifies itself by the contributing atoms and the fractional distance the object is between them, there are several ways of using this information to get a colour. BobScript has three possible algorithms: First, 'continuous' ramping where the atoms and the fraction are used to get as accurate an estimate as possible for the ramp colour (eg to calculate exactly how far along a sequence the graphical object is or what B factor to attribute to that object). This sort of ramping is default for sequence and B factor ramping. The second algorithm is 'discrete' ramping, where the ramp colour is determined by which atom is nearest to the graphical object being drawn (this is easily determined from the fractional distance). This is the default ramping algorithm for atom colour ramping, since it is ideal for split-bond pictures. The final option is 'fractional' ramping, where the colour is solely determined from the fractional distance, ignoring the atoms involved. This is necessary for the dotted hydrogen bonds representation (see Section 2) and a few other exotic things. Although each ramp type has a default ramp algorithm you are free to use any combination by typing the appropriate keywords.

How BobScript Decides What Colour To Use For Objects

So far I have tried to talk about ramping in a loose way and to introduce the relevant terms in a relatively painless way. I have not indicated what syntax is required to make a ramp, nor gone into the details of the colour ramping algorithm. This section is the one with all the messy details in, and the examples then come thick and fast in the following sub-sections. Unless you are interested in how I implement ramping, or want to do something exotic that is not given in an example below then please feel free to skip this explanation, otherwise you might end up with a headache.

The implementation of colour ramping in all cases is essentially a two-stage process, and the intermediate stage of the calculation I call a T-value (simply because the variable I use for it is called T). The ramp type and ramp algorithm are used to convert the atoms involved and fractional distance into a value between 0 and 1 (the T-value). The colour specification is defined in terms of a fraction and so to get the colour for a graphical object I simply look up which colour is associated with the T-value for the object. If no colour is associated then no ramp is defined, and the MolScript default colour is used.

A detailed description of ramping thus splits into halves: how to get T-values and how to turn that into a colour. To generate T-values there are different calculations done for each ramp type with each ramp algorithm:

For the conversion of a T-value to a colour, the same code can be used for all cases. However, for continuous and discrete atom ramping the colour ramp is a simple one that varies smoothly between the colours of the two atoms involved. For the other seven cases the colour ramp that the user defines in the 'colour' statement is used. To understand this conversion of T-value it is helpful to have a feeling for the colour scheme BobScript uses for interpreting colours, the HSB (hue, saturation and brightness) colour scheme. This scheme can be considered as placing all possible colours in a cone, with all the major bright colours on its flat surface. Black is the apex of the cone (B = 0, H and S being undefined, but conventionally 0). White is at the centre of the flat face (H is undefined (conventionally 0), S = 0, B = 1). As you move away from the black-white axis the saturation increases, and at any point on the curved surface of the cone S = 1. The hue component is also a value from 0 to 1 and corresponds to the position around the black-white axis of the cone. By convention red has H = 0 or H = 1, green has H = 0.333 and blue has H = 0.667. Thus the primary and secondary colours red, yellow, green, cyan, blue and magenta all lie equally spaced around the edge of the cone.

A colour ramp consists of a series of control points, where T-values are associated with specific colours. Colours for T-values in between those of the control points are calculated by interpolation in the HSB colour scheme from the colours associated with control points having T-values higher and lower than the requested value. All ramps have at least two control points, one for T = 0 and one for T = 1 (usually, although smaller values are possible, see below).

Consider a simple ramp with two control points: green (H = 0.333, S = 1, B = 1) at T = 0 and blue (H = 0.667, S = 1, B = 1) at T = 1. For a value T, the colour is a simple weighted average of the hue, saturation and brightness components:

H(T) = H(0) * (1-T) + H(1) * T
S(T) = S(0) * (1-T) + S(1) * T
B(T) = B(0) * (1-T) + B(1) * T

where H(n) is the hue at the particular T value n, hence H(0) and H(1) correspond to the control points. This will produce a ramp which goes from green via cyan (at T = 0.5) to blue. Since the definition of hue is cyclic, one could also go from green to blue via yellow, red and magenta. To get around this ambiguity, BobScript always takes the shortest path between hue values. If you want to go the long way round then you need to specify a third control point mid-way between the other two (i.e. red at T = 0.5). The colour scheme that should be traversed is thus divided into two parts, each of which is a short arc.

In general, for a colour ramp there might be n control points with T-values T(1), T(2), ..., T(n). A component of the colour at any point (eg the hue at point m) is given by H(m). To get the colour at a particular T-value (T) the program finds the control points with T-values immediately above and below T. If these points are numbered a and b (b = a + 1), then the colour for the value T is:

H(T) = ( H(a) * (T(b) - T) + H(b) * (T - T(a)) ) / (T(b) - T(a))
S(T) = ( S(a) * (T(b) - T) + S(b) * (T - T(a)) ) / (T(b) - T(a))
B(T) = ( B(a) * (T(b) - T) + B(b) * (T - T(a)) ) / (T(b) - T(a))

There are just a few little difficulties with this simple scheme, but I won't bore you with the precise details, just the general points. Firstly, in the HSB colour scheme there are colours where one or more of the HSB values are not defined to unique values. BobScript has to trap all these cases separately and deal with them. Usually, this is done by noting that (say) the hue is undefined for one of the two control points, and so at all intermediate points the hue is set to be that of the other control point. A second feature is that the T-value of the final control point need not be 1. In this case the ramp is forced to repeat as often as necessary to cover all values from 0 to 1. This repetition is forced by checking if the T-value is greater than the maximum control point T-value and if so then the maximum T-value is subtracted and the check repeated. Eventually the T-value will be in the range of the ramp. Thirdly, two control points may have the same T-value. In this case the order of definition is important: all T-values up to and including the control point will have colour based on the first control colour, T-values greater than the control point will have colours based on the second control colour. This allows jumps in colour to be incorporated easily into a single ramp. Finally, not all control points need to specify a colour, instead they can specify another colour ramp. This is described in the section on more complicated ramps. Its main use is for dotted lines and secondary structural objects. As far as the present discussion is concerned it is enough to point out that a colour cannot smoothly ramp to a change of ramp. Instead, the colours on either side of the ramp change are held. For example if there are the three control points:

T = 0.2, colour = yellow
T = 0.4, ramp = break
T = 0.7, colour = red

then between T = 0.2 and 0.4 the returned colour is yellow, between 0.4 and 0.7 the returned colour is actually a pointer to the ramp called 'break' (which means suppress drawing graphical objects) and then at T = 0.7 the colour ramp starts again with red and may vary depending on the specifications of other control points.

The Definition Of A Colour Ramp

A colour ramping command consists of the command colour, possibly an option or two, the type of ramp (or ramps) to define, the colour ramp itself and then the ramp type to define. This section just covers the colour ramp part of the syntax, the other parts are all considered by example in the sections below.

The simplest colour ramp is not to define anything at all. All ramp types have default colour ramps and these often produce the desired result.

colour turn;

However, this is really cheating and the simplest defined colour ramp is just a colour name, e.g.:

colour turn red;

This causes all turn graphics to be drawn in red. The actual colour ramp defined has two control points, red at T = 0 and red at T = 1. This is exactly equivalent to the slightly more cumbersome command:

colour turn from red to red;

A slightly more complex ramp is:

colour turn from blue to red;

In this ramp the two control points are associated with different colours and so colours are interpolated: blue at T = 0 (the start of the ramp), red at T = 1 (the end of the ramp). In line with BobScript's 'shortest path' route, the interpolated colours go through magenta (at T = 0.5). To force the colour ramp to go the other way around the colour circle a third control point is required. There are several ways of doing this, all using a new ramp word via:

colour turn from blue via green to red;

BobScript knows that blue is the colour for T = 0 and (assumes) that the colour for T = 1 is red. The via statement inserts a control points evenly spaced between the other two (i.e. green at T = 0.5). More than one via point can be used:

colour turn from blue via cyan via green via yellow to red;

creates a five control-point colour ramp which produces exactly the same colours as the previous example (i.e. blue at T = 0, cyan at T = 0.25, green at T = 0.5, yellow at T = 0.75, red at T = 1). The T values associated with colours named after via and to statements can be controlled in three ways: in terms of the raw T value fraction, in terms of a residue number and in terms of a B factor. The latter two methods are described later, for now I will stick to T values (although I don't usually use these in practice).

colour turn from blue via green to red at 0.95;

This ramp has control points of blue at T = 0, green at T = 0.475 and red at T = 0.95. For the last bit of the ramp it wraps around and starts again from T = 0. Hence the colour at T = 1 is the same as the colour at T = 0.05. A slight variation on this ramp is the default colour scheme for sequence ramping:

colour turn from blue via rgb 0 1 0 via red at 0.95 to red;

The intermediate control point specifies green and the ramp returns red for all T values from T = 0.95 to T = 1. This slightly odd ramping gives a better visual result. Another variant on this could be:

colour turn from blue via hsb 0.33333 1 1 at 0.3 via red at 0.95
  to red;

This produces exactly the same colours, but the rate at which the blue fades to green and the rate at which the green becomes red is different.

The at values do not have to keep increasing along a colour ramp. If they stay the same for a pair of control points then you get a jump in colour:

colour turn from blue via cyan at 0.5 via yellow at 0.5 to red;

This produces a smoothly varying colour from blue to cyan for the first half of the molecule and then a smoothly varying colour from yellow to red for the second half of the molecule. However, the jump between cyan and yellow is immediate.

That's about it for defining ramps, but there is one more thing: how you define ramps that refer to other ramps. The discussion in the previous section described what happens, but didn't cover the syntax. The way to do it is to replace a colour name by the word 'ramp' and the ramp name. For example the a way of producing a dashed secondary structure is:

colour fractional ss from yellow via ramp break at 0.25
  to yellow at 0.5;

Ordinary ramp names were listed above. On top of those, there are two special ramps called break and disabled. The break ramp causes the output of graphical elements to be suspended while it is in force, thus producing very nice dashed lines in rendered output. The disabled ramp is less interesting, it turns off the ramping colour control for those graphical elements and the normal MolScript colours are produced. I don't think I've ever actually needed to use this. By the way, a ramp that switches to another ramp can then be switched again (and again). The program is cunning enough to detect the infinite loop that is possible with this degree of flexibility and report an error rather than just hanging.

A final extra is the special colour nothing (see colour names below). This is half way between a simple colour and a ramp defined as a ramp. It supresses the output of graphical objects and can be used just as an ordinary colour. For ramping purposes, if nothing is one of the colours for the interpolation step then the graphical segment is suppressed.

You can see just what BobScript is up to with ramping because the output lists all ramps as they are defined in a table of HSB colours and T values. Ramp switches are also tabulated. As with most BobScript output, when things go wrong look closely at the output for errors. Almost always the output is helpful enough to locate the problem!

Setting Up Ramps That Vary With Sequence

If you do not specify a ramp type then BobScript assumes that you mean a ramp over the sequence. In BobScript terms this means over all the residues currently read (for all molecules). This will include hetero-atoms, water molecules and substrates. You can specify which residues should be used to construct the ramp by putting a residue selection after a by sequence statement. These examples assume that you are happy with using the default colour ramp for sequence-type ramping, which is:

from blue via green via red at 0.95 to red

Thus, all the colour statements below are equivalent:

colour ss;
colour ss by sequence;
colour ss by sequence type *;
colour ss from blue via green via red at 0.95 to red;
colour ss from blue via green via red at 0.95 to red by sequence;

To produce a red secondary structure for a single named molecule the colour command is:

colour ss red by sequence molecule mol1;

A useful way to limit the sequence to just the protein bits of a structure is:

colour ss by sequence amino-acids;

which selects residues of the twenty common types. If you have any post-translational variants or oxidised residues then remember to check for those otherwise your ramp will have a gap in!

To produce a capped-stick type representation of the three backbone atoms for each residue that has more subtly altering colour ramp (say between cyan and royal-blue) the commands are:

set stickradius 0.04;
set atomradius atom * 0.16;
colour ball-and-stick from cyan to royal-blue by sequence amino-acids;
ball-and-stick either atom N, atom CA or atom C;
BobScript is perfectly happy to have a single ramp which spans several separate chunks of sequence. What it does is when you have made your residue selection is look for how many chunks those residues actually define and store each chunk separately. There is a limit to how many chunks it can cope with, but it is quite large and if you exceed it you get a message 'ramp residue selection too fragmented'. This message hasn't ever occurred in real life yet, but something like:

	colour ss by sequence type ASP;

(which would define a colour ramp that covered the aspartate residues) might just give it a hard time! One nice idea (used in the Grimes et al. paper, but not since) that takes advantage of defining fragmented sequence ramps is showing structural homology between two proteins. For this paper it was used to show the conserved beta structure for two fairly dissimilar proteins. The loop regions made it hard to see the pattern, so I set something up to colour the bits that were considered structurally equivalent using colour ramps with equivalent colours for equivalent residues (I include the whole input file in the examples section). The key statements were something like:

set planecolour white;
colour coil by sequence require molecule mol1 and either
  from 10 to 14, from 23 to 26, from 34 to 39 or from 48 to 56;
coil molecule mol1;
colour coil by sequence require molecule mol2 and either
  from 8 to 12, from 18 to 21, from 37 to 42 or from 49 to 57;
coil molecule mol2;

The important points are that the number of residues in each ramp are the same (these are the ones equivalenced by Dave Stuart's SHP program for each molecule) and we are using the same colour ramp (the default one) in each case. Thus, equivalent residues have the same colours reinforcing visually the homologous elements.

To achieve the desired effect, ramps sometimes have to be defined with the fractions (T values) for different colours explicitly specified. The general description of ramps above described the use of at in ramps to do this. With sequence ramps a modification of this syntax is allowed which makes life a lot easier. The at command can be followed by a residue selection that selects for a single residue (for example via green at require residue 20 and molecule mol1). The program will report an error if no residue is selected, more than one residue is selected, the T values that are calculated are not in ascending order or if this syntax is used with non-sequence type ramps. One practical use of this statement is to colour domains of a protein differently. Let's assume a two domain protein with the domain break being at residue 120. To colour the first domain red and the second one green a nice way of doing it is:

colour ss from red via red at residue 118 via white
  via green at residue 122 to green by sequence amino-acids;

This ramp keeps the colour as red for most of the first domain then fades out to white and back in to green over the 5 residues around the domain boundary and then holds green to the end. The nice thing about this way of changing colours between ramps is that, by fading to white, no spurious intermediate colours are produced. This was used for the general secondary structure view of RT (Fig. 2(b), Ren et al.).

All these by sequence ramps have used the default ramp algorithm continuous. Similar results are produced by using the discrete algorithm, but the colour changes are not quite so smooth. This might be of some use for drawing lots of little structures with different colours, but doesn't have general use. The third ramp algorithm is fractional. This might have some use if you want to draw striped molecules, eg the ramp:

colour fractional ss from black via black at 0.3333 via yellow
  at 0.3333 via yellow at 0.6667 via red at 0.6667 to red;

might increase your chances of getting funding from Brussels! May be of more real use is the chance to drawn 'dashed' secondary structure. One might want to do this to show an area of a model that you don't really believe in, but you want to show something. This example also uses a second ramp for the coloured parts of the structure to allow definition of smoothly varying colours:

set segments 6;
set finestrands on;
colour second-ramp
  from blue via green to red by sequence;
colour flat-ended fractional third-ramp
  from ramp second-ramp via ramp break at 0.16667 to ramp
  second-ramp at 0.33333 by sequence;
colour ss from ramp second-ramp via ramp third-ramp at residue 80
  via ramp second-ramp at residue 92 to black by sequence;

If you've any real idea what is going on here then you don't really need to read this manual at all! I think it works OK and it certainly uses most of the possible colour ramp syntax. By the way, for BobScript buffs, the final colour definition of black is actually a dummy colour: ramps don't merge to colours, so the change is immediate at the black fraction value (which is 1.0 and hence no black is drawn).

Setting Up Ramps That Vary With B Factor

Ramps over B factor are very simple to understand. The B factor associated with an atom is converted into a fractional value between 0 and 1 by the equation:

Fraction = ( B - Blow ) / ( Bhigh - Blow )

where Blow and Bhigh are limits specified in the colour command. If the value of this sum is less than 0 it is set to 0, if the value is greater than 1 it is set to 1. This fractional value is then used to look up a colour. The default B factor colour ramp is from blue via white to red. The lower B factor limit does not need to be specified and in that case it is assumed to be 0. The upper limit must be specified. Best results are usually obtained when the specified B factor range covers about 90% of the actual B factor range. Outliers will just be given the extreme colour (high or low B factor colour as appropriate). Some simple examples of B factor ramps are:

colour ss by b-factor to 40;
colour ss by b-factor from 20 to 60;
colour cpk from blue to red by b-factor from 20 to 60;

In the last case the start and end colours are the same, but the mid colour is magenta. Since the B factors can vary quite rapidly over a molecule it may be necessary to increase the number of segments or stick segments that are drawn in order to get the effect of smooth colour change. Also, by default, MolScript uses fewer segments for strands than it does for helices, coil and turns. This is sensible when the colouring is flat, but for quickly changing ramp colours it is a problem. To get round this I have introduced another parameter to the program, finestrands, which sets the number of segments for strands equal to the number for other graphical objects. I recommend this for B factor ramps that cover strands (and many other colour ramping possibilities). The syntax is:

set finestrands on;

Just as there was a specific syntax for at statements with sequence ramps, there is an analogous syntax for B factor ramps. One example of such use could be:

set segments 12;
set finestrands on;
colour ss from blue via white via red at b-factor 50
  via orange at b-factor 50 to orange
by b-factor from 20 to 55;

In this example, a normal looking B factor colouring scheme is used for B factors from 20 to 50, but for all B factors over 50 the colour suddenly switches to orange. This might be used to highlight some specific sort of disorder in a structure. However, these options are probably more relevant to pictures where the B factor is used to represent something else. One example is the 'tomato plant' picture (Fig. 2., Esnouf et al.) where two structures are being compared. The differences in position between equivalent atoms in the two structures are written into the B factor column of one of the structures, and these values are used just like B factors for a plot. To emphasise the difference from B factors, the colour scheme is changed to be from green to red (hence the name) and areas of big difference show up as red 'tomatoes' on a largely green 'plant'. The effect seems to look best if most of the molecule is coloured green, so some fiddling with the range is usually required:

set segments 12;
set finestrands on;
colour ss from green to red by b-factor from 1.0 to 2.0;

For other pictures it may be that some areas of structure are not included in the comparison and so should be shown as excluded by giving them a different colour. A way to do this is to give them a special B factor value (say -1) and use at statements in a way similar to that described above:

set segments 12;
set finestrands on;
colour ss from cyan via green at b-factor 0.0 via green at
  b-factor 1.0 to red by b-factor from -1.0 to 2.0;

This should produce the same colour scheme as the previous example except where B factor values are -1, which give (contrasting) cyan patches. (For an example see Fig. 5., Ren et al., Structure, 3, 915-926 (1995).)

B factor plots can also look effective for CPK pictures and also for ball-and-stick pictures: The cover of Nature Stuctural Biology for April 1995 is a B factor coloured CPK picture. With ball-and-stick pictures B factor colouring can be very good at showing detailed points graphically. Two cases where they can look particularly good are showing binding of an inhibitor or substrate and discriminating between two similar conformations based on B factor arguments. For each case the relevant BobScript syntax is the same:

set sticksegments 40;
set atomradius atom * 1.0;
set stickradius 0.15;
colour ball-and-stick by b-factor from 20 to 50;
ball-and-stick in molecule hept;

because the colours are changing very rapidly, a large number of stick segments are needed to preserve the illusion of smoothly changing colour. Hence, these figures can take quite a long time to draw! For the case of showing inhibitor binding, the areas of the molecule with high B factor come out red, and these are possibly good areas of the molecule for inhibitor modification. For the case of distinguishing between two similar orientations on the grounds of the spread of B factors in each case the better orientation should be the one where the colours change least wildly. For lectures and situations where a picture is easier for the audience than a numerical argument, this sort of picture is very effective.

As a final oddity, one might possibly want draw the sticks of bonds as a B factor coloured ramp and the atoms in another colouring scheme. This can be achieved by switching on the tworamps parameter. With this enabled, the atoms balls are coloured according to the cpk ramp and the sticks according to the ball-and-stick ramp. For example:

set tworamps on;
colour ball-and-stick by b-factor from 10 to 30;
colour cpk yellow;
ball-and-stick in molecule mol1;
colour cpk green;
ball-and-stick in molecule mol2;

The tworamps parameter also affects the drawing of strands and helices in a way similar to the use of planecolour and plane2colour. This is described below.

Setting Up Ramps That Vary With Atom Colour

For the final ramp type, atom ramps, it is usual not to define an explicit colour ramp, but to rely on the colouring inferred from the atoms involved. With atom ramps the default ramp algorithm is discrete not continuous, so smooth colour changes are not produced. This is the required set up for the most common sort of by atom ramping, which is to produce split-bond ball-and-stick or capped-stick representations of molecules. A standard use for this type of ramp has been shown in the section on drawing sticks (above), but I repeat it here:

set atomcolour atom C* grey 0.7;
set atomcolour atom O* red;
set atomcolour atom N* rgb 0 0.3 1;
set atomcolour atom S* rgb 1 0.8 0;
set sticksegments 2;
colour ball-and-stick by atom;
ball-and-stick in residue 999;

This produces a ball-and-stick picture with each half bond in the appropriate colour. If the stick radius is less than a quarter of the atom radius then the result is a normal ball-and-stick picture, e.g.:

set stickradius 0.15;
set atomradius atom * 1.2;

If you are making rendered BobScript pictures then capped-stick pictures can be drawn by forcing a four-to-one ratio of radii:

set stickradius 0.15;
set atomradius atom * 0.6;

I usually prefer to set all the (non-hydrogen) atom radii to be the same as each other (not the default) as otherwise the picture doesn't look quite right.

Things other than ball-and-stick can be ramped by atom, but except for CPK pictures it is rather uncommon. One CPK possibility for such ramping is to colour different residue types differently and then do a CPK picture to show how they are distributed on the surface of a protein:

set atomcolour atom * grey 0.7;
set atomcolour in either type ARG, type LYS or type HIS blue;
set atomcolour in either type ASP or type GLU red;
set atomcolour in either type TRP, type PHE or type TYR yellow;
colour cpk by atom;
cpk in molecule mol1;

A very similar example could be used to show the distribution of different types of residue on a secondary structure representation. This could, for example, show how hydrophobic residues form the core of a structure and charged ones are on the outside:

set atomcolour atom * grey 0.7;
set atomcolour in either type ARG, type LYS or type HIS blue;
set atomcolour in either type ASP or type GLU red;
set atomcolour in either type TRP, type PHE or type TYR yellow;
colour ss by atom;
@mol1.ss
(Where the mol1.ss file contains the secondary structure definition of the molecule.) Similar, but different, and getting quite popular at the moment is to represent conserved residues using this method. If you have a nice colourful sequence alignment as a figure in your paper you can also show the same colour coding information on the secondary structure figure. This is very nice because it can show clearly conservation around binding sites and important structural residues. For an example see Figure 1(b), Roach et al., Nature, 375, 700-704 (1995) and compare it with Figure 2. (However, please don't follow the level of referencing and acknowledgment in that paper!

Only in the case of a fractional ramp by atom is the definition of a colour ramp relevant. Its default colour ramp is black via black at 0.06 via white at 0.06 to white at 0.08, which of course is a repeating ramp that produces black and white stripes (especially if the number of segments or sticksegments is set to 50). Any other striping patterns can be defined, but to get the correct results the number of segments has to be set to a sympathetic value. Just occasionally you might want to produce stripes, and this is the way to do it most painlessly.

One final thought about by b-factor and by atom colour ramping is that they are really two extreme ends of a single continuum of colouring schemes. B factor colouring is ideally suited to continuously changing variables (not necessarily just B factors), atom colouring is suited to a set of discrete values, such as residue types. However, you could arrange it so that you got the same results with either scheme (although you might exhaust the number of graphics states with by atom colouring). One example that clearly falls in between the two extremes is colouring that shows the degree of structural conservation. One could colour just completely conserved residues in one colour, residues with just one change in a similar colour, residues with two changes in another colour and so on. This could be a series of atomcolour statements. Another way of looking at the same problem is to give each residue a score to show sequence conservation. Putting this in the B factor column of a PDB file then makes a natural example of a B factor ramp. If the conservation score ranges from 0 to 1 then perhaps one of the following schemes would look good:

colour ss from grey 0.7 via yellow to red
  by b-factor from 0 to 1;

for smoothly varying colours. An alternative for colours stepped by degree of conservation and with the colour held constant for each residue:

colour discrete ss
  from grey 0.7 via grey 0.7 at b-factor 0.5
  via yellow at b-factor 0.5
  via yellow at b-factor 0.7
  via rgb 1 0.75 0 at b-factor 0.7
  via rgb 1 0.75 0 at b-factor 0.8
  via orange at b-factor 0.8
  via orange at b-factor 0.9
  via rgb 1 0.25 0 at b-factor 0.9
  via rgb 1 0.25 0 at b-factor 1
  to red by b-factor from 0 to 1;

BobScript Syntax Introduced And Used In This Section

Relevant MolScript Tips And Hints

This section is quite long enough as it is without adding extra hints. My only advice is start with simple ramps and then work upwards. In all cases of errors read the BobScript diagnostic output carefully. The hint is usually in there somewhere.


Map reading and contouring commands

BobScript can draw several different representations of (electron density) maps. The map command allows BobScript to read directly several different formats of map data and the contour command is used to create the actual contours as graphical objects. To support these two commands there are a few new parameters and changes to the transform and delete commands. BobScript can draw maps as the normal 'chickenwire' type picture; as 'chickenwire' but with the inside and outside of contours in different colours with edges to show how the contour folds; and as solid surfaces (which can be made semi-transparent with Raster3D).

Reading Maps

Several map formats can be read directly by BobScript: CCP4 ASCII maps (the default), CCP4 binary maps, X-PLOR ASCII maps, X-PLOR binary maps, DSN6 ('O'-style) maps, BRIX maps, bricked FRODO maps and GRID maps are the current list. The command to read maps is similar to the command to read coordinate files. For example:

map omit "omit.dsn6" format dsn6;

will read the specified DSN6 map in the correct format. The format specification is optional: CCP4 binary and BRIX formats can be detected automatically, otherwise the default format is CCP4 ASCII. The command above will try to read the whole map, which is wasteful in time and space since only a small fraction of the map will be visible (normally). The best thing to do is to read only the bit of map that is needed by specifying an atom selection (plus extra space) that the map should cover. To read the bit of a map surrounding residue 999 plus an extra 5Å in each direction the command is:

map omit "omit.xplor" format xplor around in residue 999 plus 5;

The program will work out the cuboid that the atom selection implies and then reads at least enough map data for that volume. The code should cope in a sensible way with non-orthogonal maps.

Transforming maps: VERY IMPORTANT

Since MolScript changes atom coordinates when the transform command is used, the map command should (usually) follow the read command immediately and the transform command should act on the maps as well as the coordinates. To make this easier, the transform command can be made to act on all molecule and map data at once:

read mol "molecule.pdb";
map omit "omit.brix" format brix around in residue 999 plus 5;
transform all by centre position in residue 999
  by rotation x 45;

Contouring Maps

Having read maps into memory and transformed the coordinates of molecules and maps, the command contour will draw the desired contour. By default, contours have the same line width as other lines and are drawn in dark-green. These can be changed with the maplinewidth and mapcolour (and map2colour) parameters. A simple input file for drawing of a piece of omit density could thus look like:

read mol "molecule.pdb";
map omit "omit.map" around in residue 999 plus 5;
transform all by centre position in residue 999
  by rotation x 45 by rotation z 24;
set sticksegments 2;
set stickradius 0.1;
set atomradius in residue 999 0.8;
colour ball-and-stick by atom;
ball-and-stick in residue 999;
set maplinewidth 0.5;
set mapcolour black;
contour omit at 120;
delete mol;
delete omit;

If your density is good then you will just have density over residue 999, but if things are not so hot then you may want to cheat and just draw the bits of density near to the selected atoms. This map covering can be done simply by modifying the last command to include an atom selection:

contour omit at 120 covering in residue 999;

The program will run a lot more slowly and the lines drawn will only be those parts of lines that are within 2.2Å of the specified atoms. This cover distance is controlled by the parameter coverradius. If you specify many atoms for the map cover then the program will run very slowly indeed. The contour level can be specified either as an absolute value (as above) or in terms of number of sigma. This second method is only good for map formats that store the sigma value. An example of this is:

contour fo-fc at 1.4 sigma covering in residue 999;

There are further possibilities for map contouring. Firstly, you can specify a mode of 'chickenwire' contouring where the two sides of the contour have different colours. This 'inside-outside' contouring means that from the selected viewpoint, if you are looking at a contour with the density increasing as it goes away from you then it the contour is drawn in the colour defined by the mapcolour parameter. If you are looking at a contour that corresponds to decreasing density as it goes away from you then the contour is drawn in map2colour. This may be of use for PostScript pictures. The syntax is simple:

contour in-out omit at 3 sigma;

Another way of contouring is to produce a solid triangulated surface at the desired contour level. You can consider each contour as forming a closed surface with the inside of the surface corresponding to high density and the outside corresponding to low density. The high density side of the surface is drawn in the colour specified by mapcolour and the low density side of the surface is drawn in the colour specfied by the parameter map2colour. This corresponds to the colouring of in-out contoured maps. To save on triangles it can be useful to remember the possibility for setting mapcolour or map2colour to nothing for closed surfaces. Typical syntax might be:

set triangulation 1;
set material transparent;
contour surface omit at 3 sigma;

Map covering works for both these types of contouring, but with surface contours the surface is triangulated and whole triangles are included or excluded based on how near the mid-point of the triangle is to the map cover atoms. This means that the edge of a surface may have a serrated edge.

Maps can be contoured with a map covering option, and also with a slab option. By default this slab is the same as the slab for the whole plot, but it is possible to specify a separate slab that just applies to maps. For example:

set mapslab 6;

for a 6Å slab of map. The purpose of this is so that small amounts of map can be drawn (which is clearer) in the context of a schematic representation of the molecule. The slab is applied exactly to map contouring. Lines are clipped to be the right length and triangles are subdivided to produce a smooth edge. For surface contouring a line is produced running along the clipped edge of the map. It is drawn with the current linewidth and linecolour. It can be suppressed by setting the linewidth to 0.

BobScript Syntax Introduced And Used In This Section

    map MAP.w FILE.s [ FORMAT ] [ BOX ] ;

    FORMAT = format < ascii | ccp4 | xplor | xplorbin | dsn6 | brix |
             brick | grid >
    BOX = around ATOM-SEL(*) plus EXTRA.r

	Reads an electron density (or other) map into memory and gives it the
	name MAP.w. This name may match the name of a molecule, but it
	would be best to avoid that. The map format is specified after the
	map file name (remember the quotation marks). The default format is
	CCP4 ASCII. The whole map is read unless an atom specification (plus an
        extra size) is specified. This is the normal way to read maps, since it
        conserves memory and makes the contouring quicker.

    contour [ CONTOUR-TYPE ] MAP.w at LEVEL.r [ sigma ] [ COVERING ] ;

    CONTOUR-TYPE = < surface | in-out >
    COVERING = covering ATOM-SEL(*)

	Contours the named map(s) at the level specified by LEVEL.r. This is the
	actual map denisty value unless it is followed by the word 'sigma', when
	it is multiplied by the sigma value read from the map header. Some map
	formats do not store the sigma value in the header (notably DSN6) so
	this should not be used for maps of this format. If an atom selection
	is specified after the keyword 'covering' then contours are only drawn
	in the bit of space within 'coverradius' distance of the selected atoms.	There are three ways to contour maps: normal 'chickenwire' contours
	(the default), 'in-out' contouring (like chickenwire contours but the
	lines are drawn in different colours depending on whether you are
	looking at them from the side of high density or low density, and 
	surface contouring made up of triangulated spheres.

    transform < OBJECTS | all > by ... ;

    OBJECTS = [ ATOM-SEL(*) ] [ map MAP.w ]

	This extension to the 'transform' statement allows maps and molecules
	to be moved together easily. The specification of MAP-NAME.s may
	contain normal MolScript wildcards. Most commonly used, however, is the
	extension 'all' which means that all maps and molecules are moved.
	This is just the more convenient and extended equivalent to the example
	'atom *' in the MolScript write-up. The 'by' option has also got a new
	option which allows it to read .GS_REAL datablocks written by 'O'. The
	datablock is used to set the centre and the orientation, a slight
	difference from o2mol. The added syntax is

	transform OBJECTS by gsreal FILE.s

	where the filename has to be enclosed in double quotation marks.

    delete < MOL.w | MAP.w > ;

	Deletes a molecule or a map from memory. This is just an extension to
	the original 'delete' syntax. It is not an error for a map and molecule
	to have the same name. In this case the first 'delete' would delete the
	molecule, the second 'delete' would delete the map.

    set mapcolour COLOUR(*) ;

	Sets the colour to be used for map contouring (or the high density
	colour for 'in-out' and 'surface' contouring. The default map colour
	is dark-green.

    set map2colour COLOUR(*) ;

	Sets the colour to be used for the low density (inside) contours of
	'in-out' and 'surface' contours. The default colour is dark-green.

    set maplinewidth WIDTH.r ;

	Sets the width of lines to be used when contouring. The default map
	line width is 0.5 - the meaning of this varies between PostScript and
	render output. It is half the default for the linewidth. As a quirk,
	for PostScript the Z-coordinate of a contour line is set to be the
	true Z-coordinate plus half the linewidth. This means that thicker
	lines will obliterate thinner ones if the same contour is drawn twice
	with two linewidths (eg 0.4 and 0.41).

    set coverradius COVER.r ;

	Sets the distance within which a map line has to be from one of the
	atoms specified in 'covering' atom selection in order to be drawn.
	By default this is 2.4A. Actually, contour lines are smoothly clipped
	when map covering is in operation and may even be drawn as several
	segments to achieve the correct effect. Surface triangles are not
	trimmed in the smae way. If the centre of a triangle is close enough
	to a selected atom then the whole triangle is drawn.

    set mapslab MAPSLAB.r ;

	Sets a specific slab to be applied to map contours. This is independent
	of the slab for the rest of the plot. By default the mapslab is set
	to be the same as for the rest of the plot.

    set material ... ;

	Sets the special material properties for version 2.1 and later of
	Raster3D. See the later section of this manual.

    set triangulation TRIANG.i ;

	This parameter is not fully implemented. At present it controls whether
	the map is drawn for Raster3D using surface triangles (TRIANG.i = 1; the
	default) or plane ones (TRIANG.i = 0). With plane triangles the surface
	appears facetted, but uses only half the number of objects.

  6(d) Relevant MolScript Tips And Hints
  ======================================

  Compared to other methods for producing publication quality pictures of
density, BobScript is both fast and simple. The example given above covers
most situations. The key thing with a good density picture is to get the
correct view and slab. This is also where the 'mapslab' may come in. The slab
should be as thin as possible (say 5-8A) and so centering the picture just
right is also crucial. Too much density is confusing and if you have to use
mapcover then you will know that in your heart-of-hearts that you are cheating.

  For PostScript stereo pictures of maps I strongly recommend using the added
BobScript options 'leftstereo' and 'rightstereo'. These ensure that exactly the
same lines are drawn in each eyes view. Many other programs cannot do this
and so extra blobs appear in one eye view that are not in the other.

  Map lines in Raster3D output probably shouldn't be shiny, altering the
special material property ('set material'; see section 7) can overcome this.
These special materials are also used to make semi-transparent graphic objects:
the main use of this being semi-transparent electron density. Some practise is
needed to get the right effect, but it can look rather good.

  For shading of solid map surfaces in PostScript the 'shadingexponent'
parameter is important. Probably lower values than the default will give better
results, but I have no experience. I also intend putting in a 'triangulation'
parameter which subdivides triangles so that the shading and map covering will
be slightly smoother.

  One nice effect with PostScript is to use lots of colourdepthcueing and set
the background colour to black. The result can have an interesting 'cartoon'
feel to it.

  6(e) Relevant Examples
  ======================

	TBA




7) R3D FILES, SPECIAL MATERIALS AND CONVERSION TO POV-RAY INPUT
===============================================================

  7(a) Special materials in Raster3D
  ==================================

  To make the use of special material records in Raster3D easier BobScript has
modifications to how 'header.r3d' files are used to make input files for the
render program. This is then combined with the parameter 'material' to create
some rather fancy effects. This whole section is still under development, but
the current 'set material' syntax is:

	set material opaque ;

OR	set material transparent ;

  This second form gives the 'transparent' special material described in the
Raster3D version 2.2 write up. Individual parts of this transparent definition
can be modified using the following command:

	set material [ phong PHONG.r ] [ specular SPECULAR.r ] [ highlight
	  COLOUR(*) ] [ clarity CLAR.r ] [ options OP1.i OP2.i OP3.i OP4.i ] ;

  With Raster3D version 2.3 there is an option that is relavant to the
production of semi-transparent surfaces. Normally, when you make an object
semi-transparent you can see internal details of the geometric objects from
which the picture was constructed (eg a coil as a series of overlapping capped
cylinders). By setting the first option to 1 (and the rest to 0) these
internal surfaces will be ignored, producing a better result visually.

  This section will be expanded when the syntax is more finalised. However, one
thing to say now is that for mapdrawing you might well want to make the map
lines completely matt. This can be done with the command:

	set material phong 0 specular 0 clarity 0 ;

  7(b) Converting Raster3D input to POV-Ray input
  ===============================================

  A further utility program is now supplied with BobScript that can process .r3d
files output by BobScript and write a (simple-minded) input file for POV-Ray
version 3.0 and then execute POV-Ray. The program is simply intended to be a
way of getting some sort of useful POV-Ray input file that can be tinkered with
by a POV-Ray guru. The results of using this program are very similar to
Raster3D output, features like reflections and metal finishes etc etc have to
be added by hand. To use the program it is assumed that the POV-Ray renderer is
called povray and is in the PATH or the current directory. Then simply:

	bobscript -r < file.inp > file.r3d
	r3d2pov file.r3d file.pov

(or simply 'r3d2pov file' will do the same as the default extensions are .r3d
and .pov). As well as exectuting POV-Ray, the program tells you what the
command used to excute POV-Ray was, this helps you to re-use the command after
modifying the POV-Ray input and get things like the image size correct. Most
features of .r3d files are converted, the exceptions are text labelling options
and glowlights. Furthermore, not all the options of a special material can be
converted easily into POV-Ray input, although the most commonly used features
(e.g. transparency) are interpreted.

8) DRAWING HELICES AS SOLID RODS
================================

  With BobScript version 2.2 there is the possibility for representing helices
by solid rods rather than helices. The rods are fitted to the coordinates by
constructing small segments of ideal helices. If you are drawing a long enough
helix you can get the program to fit separately along the helix and producde a
nice curved rod. At the moment there is no real support for drawing rods in
PostScript, although something is actually produced. The added syntax is quite
simple:

  8(a) Drawing rods
  =================

  To draw a rod rather than a helix, simply substitute the word in the command
file. By default, rods are drawn as straight cylinders made up of a series of
rings which can be colour-ramped.

	colour rod by b-factor from 10 to 50;
	rod from 10 to 21;
	rod from 30 to 45;
	rod from 52 to 56;

  The radius of straight rods is determined from the coordinates, so 3(10) and
alpha helices should be drawn with the appropriate radii. A rod may be drawn
as a single cylinder, this is quicker to draw but cannot support a varying
colour. One use of this is for drawing rods semi-transparently.

	set material transparent;
	rod simple from 15 to 32;

Some helices are genuinely bent and effort has been put into allowing the user
to specify which helices are bent. The syntax is:

	rod fitted from 40 to 64;

and then little segments of helix are fitted all the way along the helix. By
averaging this fitting the program makes the rod bend nice and smoothly. The
start and end of the helix are drawn straight, because of limitations of
Raster3D. The amount of bend is controllable by changing the length of the
segments to be fitted. The longer the segment the simpler the curvature of the
helix until eventually a straight helix is drawn.

	set fithelix 7;
	rod fitted from 40 to 64;

will produce a more curved helix than

	set fithelix 10;
	rod fitted from 40 to 64;

however, the default usually produces very nice results.

  8(b) BobScript Syntax Introduced And Used In This Section
  =========================================================

    rod [ROD-TYPE] RES-SEL (*);
    ROD-TYPE = < fitted | simple >

    RES-SEL = A MolScript residue selection

	Draw a representation of a helix as a solid rod. The default is to draw
	a straight rod by fitting a single idealised helix to the CA atoms in
	the specified residue range. Specifying that the helix should be fitted
	causes the helix to be treated as overlapping fragments of helix of
	length specified by the 'fithelix' parameter. The resulting rod may then
	be bent depending on the fitting length and rod radius. For Raster3D
	output only, there is a second option - drawing a simple rod. This rod
	is straight and has no possibility for colour variation along it. It is
	drawn as a single flat-ended cylinder. This may be of use in speeding up
	the drawing of VERY big structures, but also it can be rendered semi-
	transparently and look quite nice. The rod command has only been written
	so far for Raster3D. PostScript output is recognisable but low quality!

    set fithelix LENGTH.i ;

	Length of the helical fragments to use for fitted rods (in residues).
	The default length is 7 residues. Can be set to 0, in which case
	straight rods are produced fitted to a single helix, or a number greater
	than 4. The longer the fragment the straighter the helix rod that is
	produced.

    set rodradius RADIUS.r ;

	The radius to use for drawing a helix rod. Default value is 0.0 which
	means that the rod is drawn with the radius of the best fit rod (for
	straight rods) or 2.3A (for bent rods - the radius of an alpha helix).

    set usesmoothing < on | off > ;

	A rather temporary parameter (I hope!). Default is on. This tells the
	coil command to use the coordinates for the helix rod axis rather than
	the actual CA coordinates. The result is that the ends of coils hit the
	centre of rods rather than the edge. The CA atom one residue from either
	end of the rod is also fudged to look nicer. For the program to know
	where the helix axes are the rod has to be drawn BEFORE the coils on
	either side are drawn.

    Other parameters:

	The drawing of rods is similar internally to the drawing of coils. The
	parameters 'splinefactor' and 'smoothsteps' also affect the drawing of
	rods. However, the default values seem to produce pleasing results. The
	number of cylindrical slices drawn per residue is controlled by the
	'segments' parameter just like other graphic objects.

  8(c) Relevant MolScript Tips And Hints
  ======================================

	The rod is drawn (by default) in the 'planecolour'. Colour ramps can be
	defined for rods, with the ramp name 'rod'. It is included in the set
	of colour ramps defined when one defines a colour ramp for all secondary
	structural units (colour ss...). Of course, the colour ramp runs along
	the rod producing each colour as a ring, rather than being localised
	on the surface of the rod near to each CA atom.

  8(d) Relevant Examples
  ======================

	set usesmoothing on;		(DEFAULT ANYWAY!)
	set fithelix 7;			(DEFAULT ANYWAY!)
	set segments 10;		(B-factor ramps change colour quickly)
	colour coil white;
	colour rod by b-factor from 20 to 40;

	rod from 25 to 30;		(Draw a straight helix rod)
	rod fitted from 37 to 51;	(Draw a bent long helix rod)
	rod from 54 to 59;
	coil from 1 to 25;		(Coils after rods to get axis centres)
	coil from 30 to 37;
	coil from 51 to 54;
	coil fom 59 to 68;




9) DRAWING PLANES FOR RINGS OF ATOMS
====================================

  As described in the JMG BobScript paper, it is possible to draw planes through
a series of atoms. For example, the rings in PHE, TRP and TYR residues might be
filled in to emphasize the positions of aromatic rings. Planes can either be
be flat or made up of a series of triangles which share the common vertex of
the centre of gravity of the atoms making the ring. The other vertices are then
pairs of adjacent atoms running around the ring. The code is intended for
Raster3D, and although it does produce the right triangles in PostScript, there
is no provision to deal with the overlaps between the triangles and other
graphical objects, so the results are not optimal. Although intended for making
planes to fill in rings of atoms, the atoms do not need to form a ring and so
this command can be used to create arbitrary geometric figures within a picture.
Planes are drawn in the colour specified by planecolour.

  9(a) Drawing planes for standard residue atom rings
  ===================================================

  The program can recognise the ring atoms in standard proteins and nucleic
acids (residue names: HIS, HID, HIE, HIE, HIP, PHE, TYR, TRP, PRO, ADE, GUA,
CYD, URA, THY, CYT, A, G, C, U, T) and so to draw rings through these atoms
one simply gives a residue selection:

	set planecolour grey 0.9;
	plane type TYR;

or a more complicated example:

	set planecolour yellow;
	plane require not type PRO and from 10 to 178;
	set planecolour red;
	plane molecule dna;

For each ring the deviation of the atoms from planarity is calculated and if it
is greater than the threshhold value defined by the 'flatlimit' parameter then
a series of triangles are drawn connecting the centre of the ring and adjacent
atoms (this usually only occurs with PRO residues). Otherwise any deivation is
flattened out and a polygon is drawn (actually made up from coplanar triangles).
For nucleic acid residues, rings are only drawn for the base and not the sugar.

  9(b) Drawing planes for customised groups of atoms
  ==================================================

For substrates, inhibitors, DNA sugars etc etc. the program has no idea how to
draw rings because it doesn't know which atoms to use. In this case one can use
a second form of the command in which each atom is specified explicitly:

	set planecolour green;
	plane atoms require in type HEPT and either
	  atom N1, atom C2, atom N3, atom C4, atom C5 or atom C6;
	plane atoms require in type HEPT and either
	  atom C11, atom C12, atom C13, atom C14, atom C15 or atom C16;

each plane has to be specified separately since the program does not look at the
atom bonds to decide which atoms form a ring... indeed the atoms needn't form a
ring at all. To make life easier the order in which atoms are specified is
immaterial, the program calculates the centre of gravity and then starting with
one atom at random checks all atoms to find which one contributes the adjacent
plane vertex and then works around the plane in a similar fashion.

  9(c) BobScript Syntax Introduced And Used In This Section
  =========================================================

    plane < RESIDUE-PLANE | ATOM-PLANE > ;
    RESIDUE-PLANE = RES-SEL (*)
    ATOM-PLANE = atoms ATOM-SEL (*)

	Draws a plane (or a puckered plane) where the vertices of the plane are
	determined by a group of atoms. For standard protein residues and
	nucleic acid bases one uses the first form, simply specifying the
	residues for which rings should be drawn. For non-standard groups of
	atoms the second form is used to specify each required plane in turn.
	The order of specification of atoms is unimportant. The plane is
	coloured according to the value of the 'planecolour' parameter. By
	default the plane has no thickness, but this can be changed by the
	'planethickness' parameter. A flat plane is drawn unless the deviation
	of the atoms defining the plane vertices from the best fit plane is
	greater than the value specified by the parameter 'flatlimit'. In this
	case a series of triangles are drawn sharing a common vertex of the
	centre of gravity and having adjacent pairs of atoms forming the other
	vertices.

    set flatlimit FLATLIMIT.r ;

	The maximum deviation from planarity allowed before the 'plane' command
	stops drawing a flat plane based on the best fit plane through the atoms
	and instead draws a puckered plane where all triangles have the centre
	of gravity as one vertex and adjacent atom positions as the other two
	vertices. By default this value is 0.1A.

    set planethickness PLANETHICK.r ;

	Defines the thickness of the planes drawn by the 'plane' command. By
	default the thickness is zero and only one plane of triangles is drawn.
	If the value is greater than 0 then two parallel planes are drawn. In
	certain circumstances one might want to set this to be the stickradius.

  9(d) Relevant MolScript Tips And Hints
  ======================================

  At some stage I plan to introduce the option of drawing geometric objects
directly into MolScript. This should be of particular use to 'virus' people
where drawing icosahedra is not exactly trivial at the moment! Currently this
can be done using the plane command. I show it for an octahedron. The vertices
are stored as a PDB file which is read in and positioned, then a series of
plane commands can be used to draw the solid. These commands are probably
best stored in a separate file which can be included as many times as is
needed. The octahedron is moved using the transform command:

  read octa "octa.pdb";
  transform all by centre position in molecule octa;

  transform all by rotation y 20;
  transform all by translation -4 0 0;
  @octa.draw
  transform all by translation 4 0 0;
  transform all by rotation y -20;

  set material transparent;
  transform all by rotation x 30;
  transform all by translation 4 0 0;
  @octa.draw

Where the octa.draw file draws each face in a different colour:

  set planecolour red;
  plane atoms either atom A, atom B or atom C;
  set planecolour yellow;
  plane atoms either atom A, atom C or atom D;
  set planecolour green;
  plane atoms either atom A, atom D or atom E;
  set planecolour cyan;
  plane atoms either atom A, atom E or atom B;
  set planecolour blue;
  plane atoms either atom F, atom B or atom C;
  set planecolour magenta;
  plane atoms either atom F, atom C or atom D;
  set planecolour white;
  plane atoms either atom F, atom D or atom E;
  set planecolour grey 0.4;
  plane atoms either atom F, atom E or atom B;

  9(e) Relevant Examples
  ======================

  The figure included in the JMG paper showing planes (Figure 2) was created
using this input file:

  read no-h 1 "cyc259.pdb" ;

  transform in molecule 1
            by rotation 0.09201 -0.66694 0.73941
                        0.66508 0.59380 0.45285
                        -0.74109 0.45009 0.49820
            by translation -14.761 -39.455 37.203
            by centre 15 -0.762 38.9045 ;

  colour ball-and-stick by atom ;
  set atomradius atom * 0.8 ;
  set stickradius 0.08 ;
  set sticksegments 2 ;
  set colourdepthcue 0.3;

  set atomcolour atom C* grey 0.9 ;
  set atomcolour atom O* grey 0.6 ;
  set atomcolour atom N* grey 0.75;
  set atomcolour atom FE grey 0.85;

  set planecolour grey 0.9;
  plane either residue B118 or residue B241;

  ball-and-stick require not either atom N, atom CA, atom C or atom O and
    in either residue B84, residue B115, residue B118, residue B204,
              residue B238 or residue B241;

! Draw a funny fading out bond for the CA -- CB bond...

  set tworamps on;
  set sticksegments 32;
  set atomradius atom CA 0.001;
  colour fractional cpk from ramp break to black;
  colour fractional ball-and-stick from ramp rod via ramp helix at 0.5 to red;
  colour flat-ended fractional rod from ramp helix via ramp break at 0.03125
    to red at 0.125;
  colour flat-ended discrete helix by atom;

  ball-and-stick require either atom CA or atom CB and
    in either residue B84, residue B115, residue B118, residue B204,
              residue B238 or residue B241;

  set tworamps off;

  set atomradius atom FE 0.6 ;
  colour cpk by atom;
  cpk in from I1 to I2;

! Now draw the hydrogen bonds. I was very fussy here and calculated the distance
! between each pair of atoms and set the sticksegments and ramps so that each
! tiny segment had the same thickness. I only show a couple of these H bonds
! to save space.

  set bonddistance 2.6;
  set stickradius 0.04;
  set atomradius atom * 0.0001;

  set sticksegments 36;
  colour flat-ended fractional ball-and-stick
    from white via ramp break at 0.02778 to red at 0.08333;
  ball-and-stick either in residue I1 or
    require in residue B238 and atom OE2;

    .
    .
    .

  set sticksegments 50;
  colour flat-ended fractional ball-and-stick
    from white via ramp break at 0.02000 to red at 0.06000;
  ball-and-stick either in residue I2 or
    require in residue B204 and atom OE2;

  set bonddistance 4.0;
  set stickradius 0.03;
  set sticksegments 77;
  colour flat-ended fractional ball-and-stick
    from black via ramp break at 0.01299 to red at 0.03896;
  ball-and-stick either in residue I1 or in residue I2;




10) DRAWING RIBBONS THROUGH DNA AND RNA BACKBONES
=================================================

  10(a) Drawing Ribbons
  =====================

  For some time I have been using BobScript to draw ribbons through the back-
bone of DNA. To get anything to draw you had to rename the atoms for the ribbon
to be CA and edit the CADIST parameter in the molscript.inc file to be suitably
large. Then you can use helix and strand on the atoms. Using helix gives a
reasonable result, but the ribbon is a bit wobbly because the parameters are
optimised for alpha helices, which turn much more tightly. Using strands gives
you are rather smoother ribbon (even when you've remembered to turn off
atom smoothing), but has an arrow head at one end. So, well overdue, I have
taken the strand drawing code and bent it to be of more use for drawing ribbons
through DNA or RNA. The new schematic is called ribbon and is very easy to use:

	ribbon molecule DNA;
	ribbon from A1 to A16;

All those things that had to be fiddled are now handled for you... the distance
for a break in ribbons is now large enough for most purposes (and can be set
with the parameter ribbonbreak), the atom used for drawing the ribbon is now
the C3' atom (but this can be changed), the coordinates are no longer smoothed
by default and instead of having an arrowhead at one end you can now make both
ends taper smoothly to any desired size. You can change the ribbon into a tube.

To make a ribbon which is 2A wide, but only 0.5A thick and which tapers to
being 1A wide at either end the syntax is

	set ribbonwidth 2;
	set ribbonend 1;
	set ribbonthickness 0.5;
	ribbon through P from A1 to A16;

This example also forced the ribbon to use the P atoms in the DNA rather than
the C3' atoms, this will be necessary if you only have the P atom positions.
(But then you could rebuild the structure with my PHOSPHATE program...). Also,
setting ribbonwidth resets the ribbonend parameter, so ribbonwidth must be
specified first if you want the ribbon to taper.

By default, BobScript will not smooth the atom positions as this makes the
resulting helices look narrow. You can turn on smoothing using the ribbonsmooth
parameter to specify the residues which can be smoothed. This parameter can
be considered to have the opposite effect to that of the fixedcalphas parameter
on coils and strands. Maybe you might use it at a kink in the DNA:

	colour ribbon by sequence;
	set ribbonsmooth from A6 to A8;
	ribbon through P from A1 to A18;

This example showed that you can also colour ramp ribbons, just like anything
else, by setting up a colour ramp with the correct name.

Finally, you may not want to draw a ribbon, but to have a tube running along
the sugar backbone. This is easily achieved:

	ribbon round from B3 to B21;

  10(b) BobScript Syntax Introduced And Used In This Section
  ==========================================================

    ribbon [ round ] [ through ATOM.w ] RES-SEL (*) ;

	Draws a ribbon through a series of identically named atoms in the
	residue selection. This is intended for showing the backbones of
	nucleic acids, but it can be tailored to be used for other things.
	The ribbon looks very similar to a strand ribbon, but the width
	and thickness can be specified separately and have different defaults.
	The ribbon can be made to taper at either end with the ribbonend
	parameter. If the 'round' option is used then a tube is drawn instead
	of a ribbon which has its diameter defined by ribbonwidth and it too
	can be tapered at either end. By default the ribbon is put through the
	C3' atoms in each residue, but any atom name can be specified with the
	'through ATOM.w' option (e.g. if you only have P atoms). The atom
	positions are not smoothed before the ribbon is drawn, but a selection
	of residues can be allowed to be smoothed by using the ribbonsmooth
	parameter. Finally, ribbons are broken when the gap between atoms in
	consecutive residues exceeds the threshold defined by the ribbonbreak
	parameter.

    set ribbonbreak BREAK-DISTANCE.r ;

	The distance between ribbon atoms in neighbouring residues above which
	BobScript assumes there is a break in the ribbon. The default value
	is 10A.

    set ribbonend RIBBONEND.r ;

	The final width for tapering the two ends of a ribbon. The default
	value is 3.0A. Whenever the ribbonwidth parameter is set, then the
	ribbonend is also set to this value and so the ribbonend parameter
	has to be set after the ribbonwidth.

    set ribbonsmooth < RES-SEL(*) | none > ;

	By default, no atom positions will be smoothed when drawing a ribbon
	through them. This command can be used to free a selected set of
	residues for smoothing when drawing ribbons. Beware when representing
	helices, because smoothing will draw the ribbon towards the helix axis
	making the helix look narrower.

    set ribbonthickness RIBBONTHICK.r ;

	The thickness to use when drawing a ribbon. The default value is 0.6A.
	The width of a ribbon cannot be tapered at either end. For round
	ribbons this parameter has no effect.

    set ribbonwidth RIBBONWIDTH.r ;

	The width to use when drawing a ribbon. The default value is 3.0A.
	When this parameter is set the ribbonend parameter is also set to the
	same value, so if tapering of ribbons at either end is desired then
	the ribbonend parameter has to be set after the ribbonwidth.

  10(c) Relevant MolScript Tips And Hints
  =======================================

  Ribbons are a very simple extra feature added to BobScript. They just
facilitate something that was possible before with a little bit of wizzardry.
Ribbons don't have to be restricted to drawing DNA and RNA. They could be used
for any polymeric molecule, even for proteins:

	ribbon through CA molecule cytc;

might put a pleasing ribbon along the backbone of your protein. One real use
might be to use 'ribbon' to represent helices in proteins. This is different
from the 'helix' output because the top and bottom edges of the helix ribbon
will then be flat and not rounded. End-tapering the ribbon might also be useful.

By setting the ribbon thickness and width to be the same value you get a rod
of square cross-section, however remember that end tapering is only applied to
the ribbonwidth, not the thickness.

If you use end-tapering with a round ribbon then you will probably get a snake-
like appearancr at the ends with Raster3D because of the limited number of
primitives which can be drawn. Try increasing the number of segments (with the
segments parameter) to reduce this effect.

Finally, the number of ribbon segments between each pair of atoms is TWICE the
number of segments specified by the segments parameter. This is because the
separation between consecutive C3' or P atoms in a nucleic acid is larger than
the separation of CA atoms in a protein (6.5A versus 3.8A).

  10(d) Relevant Examples
  =======================

This example is a pretty standard plot of a DNA double helix for a 14-mer.
The ribbon is coloured according to the sequence. The rings are filled with
planes and the backbone atoms are not drawn for the ball-and-stick.

plot
  window 40;

  read dna   "dna.pdb";

! Line up the DNA with the y-axis

  transform all by centre 0 0 22.478
    by rotation x -90
    by rotation y -126;

! Give it a little tilt

   transform all by rotation x 20;

  set atomradius atom * 0.6;
  set stickradius 0.15;
  colour ball-and-stick cyan;
  ball-and-stick require in molecule dna, in residue A* and
    not either atom P, atom O1P, atom O2P, atom C5', atom O2', atom O3'
    or atom O5';
  colour ball-and-stick yellow;
  ball-and-stick require in molecule dna, in residue B* and
    not either atom P, atom O1P, atom O2P, atom C5', atom O2', atom O3'
    or atom O5';

! Now do the DNA ribbons

  set tworamps on;
  set plane2colour white;
  colour ribbon by sequence;
  ribbon from A1 to A14;
  ribbon from B1 to B14;

! Now put the planes through the bases

  set planethickness 0.3;
  set planecolour cyan;
  plane require molecule dna and from A1 to A14;
  set planecolour yellow;
  plane require molecule dna and from B1 to B14;

end_plot




11) OTHER BITS AND BOBS THAT HAVE SNEAKED IN TO THE PROGRAM
===========================================================

  From time-to-time I get special requests for extra little features. If they
are not too difficult I give them a go. This section contains a few of these
features. They are not all fully supported for PostScript and Raster3D and
may not be particularly well-tested.

  11(a) Colour depthcueing to colours other than black
  ====================================================

Following a request to allow a structure to fade into the mist for a Raster3D
picture with a white background, the effect of the 'background' command has
been changed for output to Raster3D (previously its use was a syntax error).
The colour defined is now used as the target colour for depthcueing based on
the HSB model. Thus, to fade to white you have to set the background colour
for render in the header.r3d file and also add the command:

	background white;

to the BobScript input file. There is no change to the effect of 'background'
commands on PostScript output in order to preserve compatibility between the
two programs.

  11(b) The special colour 'nothing'
  ==================================

This has been mentioned above in relevant places, but there is now a special
colour 'nothing'. The effect of this is to supress the final output of graphics
segments having that colour. For most objects the definition of the object is
still created and takes up space in MolScript arrays. The exception is map
triangles which are not even stored. The purpose of this is to preserve traingle
space for complicated pictures and to speed up their drawing.

  11(c) Varying the coil width with B factor
  ==========================================

This follows a feature used to represent NMR structures. The more uncertain the
atom positons making up part of a coil are, the larger the radius of the coil
at that point. For crystallography the uncertainty in atomic position is related
to the B factor. The extra syntax is simply an extension of the 'coilradius'
parameter:

    set coilradius < COILSIMPLE | LINEAR | BFACTOR > ;
    COILSIMPLE = COILRADIUS.r
    LINEAR = from RADLOW.r to RADHIGH.r by b-factor [ from BLOW.r ] to BHIGH.r
    BFACTOR = from BSCALE.r b-factor [ from BLOW.r ] to BHIGH.r

        Sets the coil radius for turn and coil segments. If a simple radius is
	given then this is just the same as MolScript v. 1.4. Added to this one
	can define a linear dependence between the coil radius and the value in
	the B-factor column. Values less than BLOW.r are converted to a coil
	radius of RADLOW.r and values greater than BHIGH.r are converted to a
	coil radius of RADHIGH.r. If BLOW.r is unspecified it is assumed to be
	zero. The radii must be positive, but RADHIGH.r can be smaller than
	RADLOW.r. The third form has the radius calculated directly from the
	B-factor value (i.e. SQRT((B-factor * BSCALE.r) / (8 * pi * pi))). The
	upper and lower limits for the radius are again limited by the values
	of BLOW.r and BHIGH.r.


  11(d) Reading atom coordinates, but ignoring hydrogen atoms
  ===========================================================

  I have added an extra option for reading molecules into memory which causes
all hydrogen atoms to be ignored. This saves having to make multiple copies of
PDB files, etc etc. The syntax is shown by the two read lines below:

	read mol1 "molecule.pdb";
	read no-h mol2 "molecule.pdb";

  11(e) Intersections between objects in PostScript output
  ========================================================

In MolScript (and by default in BobScript) the PostScript image is produced by
simply sorting each graphical object depending on its distance from the viewer
and then outputting them, furthest object first. This is OK provided that
objects do not intersect. However, CPK objects always intersect and the sticks
and balls of a ball-and-stick representation always intersect in a more limited
way. An extra parameter has been added which can tell BobScript to try and
calculate the effects of these intersections and produce a PostScript image that
is comparable to the results of using Raster3D. The parameter is psintersect and
by default it is set 'off'. Turning it 'on' can make the PostScript file several
times larger (maybe even 5 times!), but especially for CPK the results are
probably worth it. Note that not all intersections are calculated... if you had
two overlapping ball-and-stick structures then their intersections will not be
calculated. Here are simple example of using psintersect:

	plot

	  read mol "mol.pdb" ;

	  transform all by centre position in molecule mol;

	  set atomcolour atom * magenta ;
	  set atomcolour atom C* grey 0.7 ;
	  set atomcolour atom O* red ;
	  set atomcolour atom N* rgb 0 0.3 1 ;
	  set atomcolour atom H* white ;
	  set atomcolour atom S* rgb 1 0.8 0 ;
	  set atomcolour atom F* pale-green ;
	  set atomcolour atom CL* lime-green ;

	  set pscpk highquality, psintersect on;
	  cpk atom *;

	  set sticksegments 2, linewidth 0.5;
	  colour ball-and-stick by atom;
	  set stickradius 0.2, atomradius atom * 1.0;
	  ball-and-stick atom *;

	end_plot

  11(f) Reading atom coordinates, but ignoring hydrogen atoms
  ===========================================================

  In the section on map contouring I introduced the extra option 'gsreal', which
can set and orientation and position of a picture based on the .GS_REAL data
block written out by O. There is a second way to use a program to get an
orientation, position (and slab) from a different graphics program, which I
now use most of the time to get exactly the right orientation before I start
making the picture smarter. This is using the program 'midas2mol' which is now
supplied with the rest of BobScript. If you use MIDASplus (and I can recommend
this program as a dependable no-frills graphics program) then you can save your
current orientation (and lots of other information) using the 'save' command.
This writes out a series of files name.0, name.1... which contain the current
state of the atoms and a file name.ses which has the orientation information
in it. Running midas2mol on this session file will produce a dummy BobScript
input file to produce a simple CPK picture. You can use this as a base for more
complex pictures. The command line syntax for midas2mol is:

	midas2mol [ -p POSNAME | -s STACKPOS ] NAME [ BOBSCRIPT ]

Where the terms in capital letters stand for:

	  POSNAME : The name of a 'savepos' orientation
	 STACKPOS : The position of the required orientation on the stack
	     NAME : The name of the MIDAS session (used for 'save')
	BOBSCRIPT : The name for the BobScript input file

(This output is produced by simply typing midas2mol with no parameters.) So, for
a simple case where you executed the command 'save fred' in MIDASplus, then
typing:

	midas2mol fred

would read the file fred.ses and produce fred.inp. Note that the input file
will tell BobScript to read the PDB files fred.0, fred.1... so to save on
disk space and multiple copies of files you will probably want to edit the
read statements in fred.inp to refer to the real PDB files and to delete fred.0,
fred.1... In MIDASplus it is possible to save several views, these can also be
found by midas2mol. Suppose that you had three views which you saved with the
MIDASplus commands 'savepos view1', 'savepos view2' and 'savepos view3' and in
the end you used the command 'save fred' to save the session file. To get each
input file using midas2mol the commands are simply:

	midas2mol -p view1 fred view1.inp
	midas2mol -p view2 fred view2.inp
	midas2mol -p view3 fred view3.inp

Stacked postions can also be similarly recovered by midas2mol.




12) A TERSE DESCRIPTION OF NEW AND CHANGED SYNTAX IN BOBSCRIPT VERSION 2.4
==========================================================================

    background COLOUR (*) ;

	For PostScript there is no change. For Raster3D output use of this
	command is no longer a syntax error, but provides the target colour
	for colourdepthcueing to colours other than black. Most useful for
	fading a structure into the mist when drawn using a white background.

    colour [ flat-ended ] [ RAMP-ALGORITHM ] RAMP-LIST < off | RAMP-SETUP > ;
      RAMP-ALGORITHM = < continuous | discrete | fractional >
      RAMP-LIST = RAMP-NAME { RAMP-NAME }
      RAMP-NAME = < ss | all | coil | turn | helix | rod | strand | ribbon |
                  | ball-and-stick | trace | bonds | line | label
                  | second-ramp | third-ramp | break | disabled  >
      RAMP-SETUP = [ RAMP ] [ by RAMP-TYPE ]
      RAMP = < FIXED-RAMP | VARIABLE-RAMP >
      FIXED-RAMP = COL-OR-RAMP
      VARIABLE-RAMP = FROM-RAMP { VIA-RAMP } TO-RAMP
      FROM-RAMP = from COL-OR-RAMP
      VIA-RAMP = via COL-OR-RAMP [ at RAMP-FRACT ]
      TO-RAMP = to COL-OR-RAMP [ at RAMP-FRACT ]
      COL-OR-RAMP = < COLOUR(*) | ramp RAMP-NAME >
      RAMP-FRACT = < FRACTION.r | b-factor BFACTOR.r | RES-SEL(*) >
      RAMP-TYPE = < SEQUENCE | B-FACTOR | ATOM >
      SEQUENCE = sequence [ RES-SEL(*) ]
      B-FACTOR = b-factor [ from BFACTORLOW.r ] to BFACTORHIGH.r
      ATOM = atom

	Creates a colour ramp to use for controlling the colour for drawing
	almost all graphical elements. Virtually every command is indirectly
	affected by this command. The syntax is frightening to look at, but
	for most cases there is a convenient natural short notation. The full
	syntax (in MolScript notation, where items marked with an asterisk
	are syntactic elements defined in the MolScript manual) is:

	If the option 'flat-ended' is used then cylindrical segments are drawn
	with flat ends. By default they are drawn with rounded ends (ie each
	cylindrical segment has a hemisphere attached to each end). The usual
	reason for specifying flat-ended cylinders is to draw dashed lines in
	rendered output. This option has no effect on PostScript output. The
	only required element in the colour command is the list of graphical
	elements which are to be coloured, all others have sensible defaults
	(see below). By the way, to disable a colour ramp for a particular
	graphical object, say 'helix' the special syntax is 'colour helix off;'

	RAMP-ALGORITHM controls how the atoms used to construct the
	graphical segment and the logical fractional distance of that segment
	from each of the atoms should be combined to get colour information from
	a colour ramp. Each ramp type has its own default algorithm, which is
	usually appropriate: for sequence and B factor ramping the algorithm is
	'continuous', for atom colour ramping it is 'discrete'. For 'continuous'
	ramping the colour is formed based on both the atom positions and
	fractional part. For 'discrete' ramping the colour is based solely on
	the colour associated with the nearest atom. For 'fractional' ramping
	the colour is calculated solely from the fractional distance, regardless
	of the atoms at either end.

	The RAMP-LIST is the required part of the 'colour' syntax. It lists
	which graphical objects should be affected by the following colour ramp
	definition. Not all elements of the RAMP-NAME list are allowed at this
	point: 'break' and 'disabled' are special ramps which cannot be defined.
	'ss' is just an abbreviation for 'coil turn helix rod strand', ie the
	graphics features used for secondary structure representations. 'all'
	is an abbreviation for all definable colour ramps.

	The RAMP defines a colour ramp as a single fixed colour, a spectrum
	of changing colours or in terms of other ramps. See the full description
	for examples of what can be done. It looks frightening, but generally
	isn't! A simple example is 'from yellow via grey 0.7 to red'. There
	are default ramps for each ramp type, these are usually quite reasonable
	for first guesses: for 'by sequence' ramping (the default type of
	ramping) the default ramp is 'from blue via green via red at 0.95 to
	red', for 'by b-factor' ramping the default ramp is 'from blue via white
	to red'. For 'by atom' ramping the default is usually only a dummy
	argument - the atom colours control ramping. In this section the item
	RAMP-NAME can be any of the elements of the list except 'ss' and 'all'
	which are aliases for multiple ramps. When using a residue selection for
	a sequence ramp control point, the selection MUST correspond to a single
	residue (beware of 2 molecules in memory having the same residue name
	and other easily overlooked cases).

	RAMP-TYPE defines the ramp type to be drawn. If this specification is
	omitted then 'by sequence' ramping is assumed. 'by sequence' ramping
	can be specified to cover a particular (not necessarily contiguous)
	residue selection. For 'by b-factor' ramping the upper B factor has to
	be specified, the lower one can be specified or is assumed to be 0.
	B factors outside the range are assigned the colour of the relevant
	limit. 'by atom' ramping just gets the atom colours from each atom, no
	further specification is possible.

    contour [ CONTOUR-TYPE ] MAP.w at LEVEL.r [ sigma ] [ COVERING ] ;
      CONTOUR-TYPE = < surface | in-out >
      COVERING = covering ATOM-SEL(*)

	Contours the named map(s) at the level specified by LEVEL.r. This is the
	actual map denisty value unless it is followed by the word 'sigma', when
	it is multiplied by the sigma value read from the map header. Some map
	formats do not store the sigma value in the header (notably DSN6) so
	this should not be used for maps of this format. If an atom selection
	is specified after the keyword 'covering' then contours are only drawn
	in the bit of space within 'coverradius' distance of the selected atoms.	There are three ways to contour maps: normal 'chickenwire' contours
	(the default), 'in-out' contouring (like chickenwire contours but the
	lines are drawn in different colours depending on whether you are
	looking at them from the side of high density or low density, and 
	surface contouring made up of triangulated spheres.

    delete < MOL.w | MAP.w > ;

	Deletes a molecule or a map from memory. This is just an extension to
	the original 'delete' syntax. It is not an error for a map and molecule
	to have the same name. In this case the first 'delete' would delete the
	molecule, the second 'delete' would delete the map.

    leftstereo [ ANGLE.r ] ;

	Comes after the 'plot' (and 'noframe') command. Forces a rotation of
	the specified number of degrees anticlockwise about the vertical axis
	(default rotation +3.0 degrees). This is appropriate for the left-eye
	view of a stereo pair. (See also 'rightstereo'.)

    map MAP.w FILE.s [ FORMAT ] [ BOX ] ;
      FORMAT = format < ascii | ccp4 | xplor | xplorbin | dsn6 | brix |
               brick | grid >
      BOX = around ATOM-SEL(*) plus EXTRA.r

	Reads an electron density (or other) map into memory and gives it the
	name MAP.w. This name may match the name of a molecule, but it
	would be best to avoid that. The map format is specified after the
	map file name (remember the quotation marks). CCP4 ASCII is the default
	format, but CCP4 binary and brix formats are detected automatically.
        The whole map is read unless an atom specification (plus and extra
	size) is specified. This is the normal way to read maps, since it
	conserves memory and makes the contouring quicker.

    plane < RESIDUE-PLANE | ATOM-PLANE > ;
    RESIDUE-PLANE = RES-SEL (*)
    ATOM-PLANE = atoms ATOM-SEL (*)

	Draws a plane (or a puckered plane) where the vertices of the plane are
	determined by a group of atoms. For standard protein residues and
	nucleic acid bases one uses the first form, simply specifying the
	residues for which rings should be drawn. For non-standard groups of
	atoms the second form is used to specify each required plane in turn.
	The order of specification of atoms is unimportant. The plane is
	coloured according to the value of the 'planecolour' parameter. By
	default the plane has no thickness, but this can be changed by the
	'planethickness' parameter. A flat plane is drawn unless the deviation
	of the atoms defining the plane vertices from the best fit plane is
	greater than the value specified by the parameter 'flatlimit'. In this
	case a series of triangles are drawn sharing a common vertex of the
	centre of gravity and having adjacent pairs of atoms forming the other
	vertices.

    read [ no-h ] MOLNAME.w FILENAME.s ;

	The optional extra syntax 'no-h' causes hydrogen atom records in an
	input file to be ignored. I have only tested this for PDB files, but I
	have put it in for all formats.

    ribbon [ round ] [ through ATOM.w ] RES-SEL (*) ;

	Draws a ribbon through a series of identically named atoms in the
	residue selection. This is intended for showing the backbones of
	nucleic acids, but it can be tailored to be used for other things.
	The ribbon looks very similar to a strand ribbon, but the width
	and thickness can be specified separately and have different defaults.
	The ribbon can be made to taper at either end with the ribbonend
	parameter. If the 'round' option is used then a tube is drawn instead
	of a ribbon which has its diameter defined by ribbonwidth and it too
	can be tapered at either end. By default the ribbon is put through the
	C3' atoms in each residue, but any atom name can be specified with the
	'through ATOM.w' option (e.g. if you only have P atoms). The atom
	positions are not smoothed before the ribbon is drawn, but a selection
	of residues can be allowed to be smoothed by using the ribbonsmooth
	parameter. Finally, ribbons are broken when the gap between atoms in
	consecutive residues exceeds the threshold defined by the ribbonbreak
	parameter.

    rightstereo [ ANGLE.r ] ;

	Comes after the 'plot' (and 'noframe') command. Forces a rotation of
	the specified number of degrees clockwise about the vertical axis
	(default rotation +3.0 degrees). This is appropriate for the right-eye
	view of a stereo pair. Note that angles for leftstereo and rightstereo
	act in opposite directions, so that one would normally put the same
	value for each command (and the same sign)! (See also 'leftstereo'.)

    rod [ROD-TYPE] RES-SEL (*) ;
      ROD-TYPE = < fitted | simple >

	Draw a representation of a helix as a solid rod. The default is to draw
	a straight rod by fitting a single idealised helix to the CA atoms in
	the specified residue range. Specifying that the helix should be fitted
	causes the helix to be treated as overlapping fragments of helix of
	length specified by the 'fithelix' parameter. The resulting rod may then
	be bent depending on the fitting length and rod radius. For Raster3D
	output only, there is a second option - drawing a simple rod. This rod
	is straight and has no possibility for colour variation along it. It is
	drawn as a single flat-ended cylinder. This may be of use in speeding up
	the drawing of VERY big structures, but also it can be rendered semi-
	transparently and look quite nice. The rod command has only been written
	so far for Raster3D. PostScript output is recognisable but low quality!

    transform < OBJECTS | all > by ... ;
      OBJECTS = [ ATOM-SEL(*) ] [ map MAP.w ]

	This extension to the 'transform' statement allows maps and molecules
	to be moved together easily. The specification of MAP-NAME.s may
	contain normal MolScript wildcards. Most commonly used, however, is the
	extension 'all' which means that all maps and molecules are moved.
	This is just the more convenient and extended equivalent to the example
	'atom *' in the MolScript write-up. The 'by' option has also got a new
	option which allows it to read .GS_REAL datablocks written by 'O'. The
	datablock is used to set the centre and the orientation, a slight
	difference from o2mol. The added syntax is

	transform OBJECTS by gsreal FILE.s

	where the filename has to be enclosed in double quotation marks.




13) THE PARAMETERS AND COLOUR NAMES IN BOBSCRIPT VERSION 2.4
============================================================

  13(a) The New Parameters Added To BobScript Version 2.4
  =======================================================

    coilradius < COILSIMPLE | LINEAR | BFACTOR > ;
    COILSIMPLE = COILRADIUS.r
    LINEAR = from RADLOW.r to RADHIGH.r by b-factor [ from BLOW.r ] to BHIGH.r
    BFACTOR = from BSCALE.r b-factor [ from BLOW.r ] to BHIGH.r

        Sets the coil radius for turn and coil segments. If a simple radius is
	given then this is just the same as MolScript v. 1.4. Added to this one
	can define a linear dependence between the coil radius and the value in
	the B-factor column. Values less than BLOW.r are converted to a coil
	radius of RADLOW.r and values greater than BHIGH.r are converted to a
	coil radius of RADHIGH.r. If BLOW.r is unspecified it is assumed to be
	zero. The radii must be positive, but RADHIGH.r can be smaller than
	RADLOW.r. The third form has the radius calculated directly from the
	B-factor value (i.e. SQRT((B-factor * BSCALE.r) / (8 * pi * pi))). The
	upper and lower limits for the radius are again limited by the values
	of BLOW.r and BHIGH.r.

    coverradius COVER.r ;

	Sets the distance within which a map line has to be from one of the
	atoms specified in 'covering' atom selection in order to be drawn.
	By default this is 2.4A. Actually, contour lines are smoothly clipped
	when map covering is in operation and may even be drawn as several
	segments to achieve the correct effect. Surface triangles are not
	trimmed in the smae way. If the centre of a triangle is close enough
	to a selected atom then the whole triangle is drawn.

    finestrands < on | off > ;

	Causes strands to be drawn using as many segments per residue as are
	used for coil, turn and helix. This is the number of segments set with
	'set segments'. By default strands use about half that many segments,
	and for rapidly changing colours this causes the change not to be
	smooth. Setting finestrands to be on is a good way to improve things
	without drawing lots of extra redundant graphical objects.

    fithelix LENGTH.i ;

	Length of the helical fragments to use for fitted rods (in residues).
	The default length is 7 residues. Can be set to 0, in which case
	straight rods are produced fitted to a single helix, or a number greater
	than 4. The longer the fragment the straighter the helix rod that is
	produced.

    fixedcalphas < RES-SEL(*) | none >

	Prevents to smoothing of the CA positions of the selected residues
	when drawing coil and strand graphics. This is useful when sidechains
	are to be joined to the backbone graphic, as normally they leave a
	gap. The CA position is held fixed during smoothing and so the smoothed
	positions of neighbouring CAs are slightly distorted towards it to
	keep the graphic smooth. For strands this can result in a slight wave
	around the fixed point. Any number of residues may be selected to be
	fixed, but they all have to be selected with a single 'set fixedcalphas'
	command.

    flatlimit FLATLIMIT.r ;

	The maximum deviation from planarity allowed before the 'plane' command
	stops drawing a flat plane based on the best fit plane through the atoms
	and instead draws a puckered plane where all triangles have the centre
	of gravity as one vertex and adjacent atom positions as the other two
	vertices. By default this value is 0.1A.

    map2colour COLOUR(*) ;

	Sets the colour to be used for the low density (inside) contours of
	'in-out' and 'surface' contours. The default colour is dark-green.

    mapcolour COLOUR(*) ;

	Sets the colour to be used for map contouring (or the high density
	colour for 'in-out' and 'surface' contouring. The default map colour
	is dark-green.

    maplinewidth WIDTH.r ;

	Sets the width of lines to be used when contouring. The default map
	line width is 0.5 - the meaning of this varies between PostScript and
	render output. It is half the default for the linewidth. As a quirk,
	for PostScript the Z-coordinate of a contour line is set to be the
	true Z-coordinate plus half the linewidth. This means that thicker
	lines will obliterate thinner ones if the same contour is drawn twice
	with two linewidths (eg 0.4 and 0.41).

    mapslab MAPSLAB.r ;

	Sets a specific slab to be applied to map contours. This is independent
	of the slab for the rest of the plot. By default the mapslab is set
	to be the same as for the rest of the plot.

    material MATERIAL ;
      MATERIAL = < opaque | transparent | CUSTOM-MATERIAL >
      CUSTOM-MATERIAL = { MATERIAL-PROP }
      MATERIAL-PROP = < phong PHONG.r | specular SPECULAR.r | highlight
        COLOUR(*) | clarity CLARITY.r | options OP1.i OP2.i OP3.i OP4.i >

	Sets the special material properties for version 2.1 and later of
	Raster3D. The 'opaque' material will be the default one specified in
	the header.r3d file. The transparent material is the one described in
	the write-up for Raster3D version 2.2. When specifying a custom material
	the values of the transparent material are used except for the specified
	properties. Setting the options to be 1 0 0 0 can be improve the results
	when using Raster3D version 2.3.

    planethickness PLANETHICK.r ;

	Defines the thickness of the planes drawn by the 'plane' command. By
	default the thickness is zero and only one plane of triangles is drawn.
	If the value is greater than 0 then two parallel planes are drawn. In
	certain circumstances one might want to set this to be the stickradius.

    pscpk < flat | windowed | shaded | highquality > ;

	Controls the method used to draw PostScript representations of CPK
	objects. The default CPK representation is windowed, my favourite is
	shaded.

    psintersect < on | off > ;

	In MolScript (and by default in BobScript) the PostScript image is
	produced by simply sorting each graphical object depending on its
	distance from the viewer and then outputting them, furthest object
	first. This is OK provided that objects do not intersect. However,
	CPK objects always intersect and the sticks and balls of a ball-and-
	stick representation always intersect in a more limited way. By
	setting psintersect on, BobScript will try and account for the overlaps
	in these two cases. This results in a much more complex PostScript
	file, but, for CPK especially, the improvement is dramatic.

    ribbonbreak BREAK-DISTANCE.r

	The distance between ribbon atoms in neighbouring residues above which
	BobScript assumes there is a break in the ribbon. The default value
	is 10A.

    ribbonend RIBBONEND.r

	The final width for tapering the two ends of a ribbon. The default
	value is 3.0A. Whenever the ribbonwidth parameter is set, then the
	ribbonend is also set to this value and so the ribbonend parameter
	has to be set after the ribbonwidth.

    ribbonsmooth < RES-SEL(*) | none >

	By default, no atom positions will be smoothed when drawing a ribbon
	through them. This command can be used to free a selected set of
	residues for smoothing when drawing ribbons. Beware when representing
	helices, because smoothing will draw the ribbon towards the helix axis
	making the helix look narrower.

    ribbonthickness RIBBONTHICK.r

	The thickness to use when drawing a ribbon. The default value is 0.6A.
	The width of a ribbon cannot be tapered at either end. For round
	ribbons this parameter has no effect.

    ribbonwidth RIBBONWIDTH.r

	The width to use when drawing a ribbon. The default value is 3.0A.
	When this parameter is set the ribbonend parameter is also set to the
	same value, so if tapering of ribbons at either end is desired then
	the ribbonend parameter has to be set after the ribbonwidth.

    rodradius RADIUS.r ;

	The radius to use for drawing a helix rod. Default value is 0.0 which
	means that the rod is drawn with the radius of the best fit rod (for
	straight rods) or 2.3A (for bent rods - the radius of an alpha helix).

    sticksegments SEGMENTS.i ;

	Controls how many segments are used to construct sticks. Default value
	is 1. Use a value of 2 for split-bond atom-colour representations and
	higher values to achieve smoothly changing colours.

    triangulation TRIANG.i ;

	Controls how map surfaces are drawn. By default (TRIANG.i = 1), the
	surfaces are drawn using Raster3D surface triangles i.e. the shading
	of a triangle is affected by its neighbours to produce a smoother
	surface. This requires the use of extra 'dummy' triangles and so for
	very big surfaces may cause problems. Setting triangulation to 0 makes
	BobScript simply use flat triangles which give the appearance of a
	facetted surface.

    tworamps < on | off >

	For normal MolScript drawings of helix and strands parts of the
	graphic are coloured in a secondary plane colour (plane2colour). By
	default, BobScript will ramp both planecolour and plane2colour with
	the strand or helix ramp, as appropriate. Setting tworamps on forces
	the parts which are drawn with plane2colour to be ramped using the
	ramp defined as 'second-ramp'. For ball-and-stack graphics, both the
	balls and sticks get their colour from the ball-and-stick colour ramp.
	Setting tworamps for ball-and-stick graphics forces the balls to get
	their colour from the 'cpk' colour ramp.

    usesmoothing < on | off > ;

	A rather temporary parameter (I hope!). Default is on. This tells the
	coil command to use the coordinates for the helix rod axis rather than
	the actual CA coordinates. The result is that the ends of coils hit the
	centre of rods rather than the edge. The CA atom one residue from either
	end of the rod is also fudged to look nicer. For the program to know
	where the helix axes are the rod has to be drawn BEFORE the coils on
	either side are drawn.

  13b) New Colour Names In BobScript Version 2.4
  ==============================================

Several new colour names have been added to the ones recognised by MolScript.
These are the colours most likely to be useful for specifying colour ramps with
the minimum of unexpected changes in brightness or changes in the rate of colour
change. The MolScript colour 'purple' is now called 'magenta' and 'purple' is
used for a more bluey colour. The new colours are:

	black          equivalent to rgb 0.0 0.0 0.0 or hsb 0.0000 0.0 0.0
	red            equivalent to rgb 1.0 0.0 0.0 or hsb 0.0000 1.0 1.0
	green          equivalent to rgb 0.0 1.0 0.0 or hsb 0.3333 1.0 1.0
	blue           equivalent to rgb 0.0 0.0 1.0 or hsb 0.6667 1.0 1.0
	cyan           equivalent to rgb 0.0 1.0 1.0 or hsb 0.5000 1.0 1.0
	magenta        equivalent to rgb 1.0 0.0 1.0 or hsb 0.8333 1.0 1.0
	yellow         equivalent to rgb 1.0 1.0 0.0 or hsb 0.1667 1.0 1.0
	white          equivalent to rgb 1.0 1.0 1.0 or hsb 0.0000 0.0 1.0

which have MolScript equivalents, and 19 additional colours:

	dark-blue      equivalent to rgb 0.0 0.0 0.5 or hsb 0.6667 1.0 0.5
	slate-blue     equivalent to rgb 0.0 0.5 0.5 or hsb 0.5000 1.0 0.5
	aquamarine     equivalent to rgb 0.0 1.0 0.5 or hsb 0.4133 1.0 1.0
	royal-blue     equivalent to rgb 0.0 0.5 1.0 or hsb 0.5833 1.0 1.0
	sky-blue       equivalent to rgb 0.5 1.0 1.0 or hsb 0.5000 0.5 1.0
	dark-green     equivalent to rgb 0.0 0.5 0.0 or hsb 0.3333 1.0 0.5
	khaki          equivalent to rgb 0.5 0.5 0.0 or hsb 0.1667 1.0 0.5
	lime-green     equivalent to rgb 0.5 1.0 0.0 or hsb 0.2500 1.0 1.0
	pale-green     equivalent to rgb 0.5 1.0 0.5 or hsb 0.3333 0.5 1.0
	red-brown      equivalent to rgb 0.5 0.0 0.0 or hsb 0.0000 1.0 0.5
	pale-purple    equivalent to rgb 0.5 0.0 0.5 or hsb 0.8333 1.0 0.5
	purple         equivalent to rgb 0.5 0.0 1.0 or hsb 0.7500 1.0 1.0
	lilac          equivalent to rgb 0.5 0.5 1.0 or hsb 0.6667 0.5 1.0
	dayglo-pink    equivalent to rgb 1.0 0.0 0.5 or hsb 0.9167 1.0 1.0
	pink           equivalent to rgb 1.0 0.5 1.0 or hsb 0.8333 0.5 1.0
	mid-grey       equivalent to rgb 0.5 0.5 0.5 or hsb 0.0000 0.0 0.5
	orange         equivalent to rgb 1.0 0.5 0.0 or hsb 0.0833 1.0 1.0
	flesh          equivalent to rgb 1.0 0.5 0.5 or hsb 0.0000 0.5 1.0
	cream          equivalent to rgb 1.0 1.0 0.5 or hsb 0.1667 0.5 1.0

there is one futher special colour, called 'nothing', which can be used to
supress the drawing of an object. Most useful for stopping the program from
drawing unseen parts of surfaces (e.g. set map2colour nothing;).

Three PostScript files (colours.ps, colrgb.ps and colhsb.ps) are supplied with
BobScript. These can be printed to your colour printer and may help you to get
the colour that you want more easily...

14) THE SYNTAX OF BOBSCRIPT VERSION 2.4
=======================================

The syntax of the colour command is given below in the MolScript documentation
style. Input type (in capital letters) which is not described here is described
in the normal MolScript documentation. These items are marked by stars (*).

  COMMAND now includes the extra possibilites COLRAMP, CONTOUR, MAPREAD, PLANE,
          RIBBON and ROD

  COLRAMP = colour [ flat-ended ] [ RAMP-ALG ] RAMP-LIST < off | RAMP-SETUP > ;
  RAMP-ALG = < continuous | discrete | fractional >
  RAMP-LIST = RAMP-NAME { RAMP-NAME }
  RAMP-NAME = < ss | all | coil | turn | helix | rod | strand | ribbon | cpk
                  | ball-and-stick | trace | bonds | line | label
                  | second-ramp | third-ramp | break | disabled  >
  RAMP-SETUP = [ RAMP ] [ by RAMP-TYPE ]
  RAMP = < FIXED-RAMP | VARIABLE-RAMP >
  FIXED-RAMP = COL-OR-RAMP
  VARIABLE-RAMP = FROM-RAMP { VIA-RAMP } TO-RAMP
  FROM-RAMP = from COL-OR-RAMP
  VIA-RAMP = via COL-OR-RAMP [ at RAMP-FRACT ]
  TO-RAMP = to COL-OR-RAMP [ at RAMP-FRACT ]
  COL-OR-RAMP = < COLOUR(*) | ramp RAMP-NAME >
  RAMP-FRACT = < FRACTION.r | b-factor BFACTOR.r | RES-SEL(*) >
  RAMP-TYPE = < SEQUENCE | B-FACTOR | ATOM >
  SEQUENCE = sequence [ RES-SEL(*) ]
  B-FACTOR = b-factor [ from BFACTORLOW.r ] to BFACTORHIGH.r
  ATOM = atom

  CONTOUR = contour [ CONTOUR-TYPE ] MAP.w at LEVEL.r [ sigma ] [ COVERING ] ;
  CONTOUR-TYPE = < surface | in-out >
  COVERING = covering ATOM-SEL(*)

  MAPREAD = map MAP.w FILE.s [ FORMAT ] [ BOX ] ;
  FORMAT = format < ascii | ccp4 | xplor | xplorbin | dsn6 | brix |
           brick | grid >
  BOX = around ATOM-SEL(*) plus EXTRA.r

  PLANE = plane < RESIDUE-PLANE | ATOM-PLANE > ;
  RESIDUE-PLANE = RES-SEL (*)
  ATOM-PLANE = atoms ATOM-SEL (*)

  RIBBON = ribbon [ round ] [ through ATOM.w ] RES-SEL (*) ;

  ROD =  rod [ROD-TYPE] RES-SEL (*) ;
  ROD-TYPE = < fitted | simple >

  READ = read [ no-h ] MOLNAME.w FILENAME.s ;

  DELETE =  delete < MOLNAME.w | MAPNAME.w > ;

  TRANSFORM = transform < OBJECTS | all > by OPERATOR ;
  OBJECTS = [ ATOM-SEL(*) ] [ map MAP.w ]
  OPERATOR = { TRANSLATION | ROTATION | CENTRE | GSREAL }
  GSREAL = gsreal FILE.s

  STEREO =  < leftstereo [ ANGLE.r ] | rightstereo [ ANGLE.r ] > ;

  PARAMETERS now includes the extra possibilites COVERRADIUS, FINESTRANDS,
    FITHELIX, FIXEDCALPHAS, FLATLIMIT, MAP2COLOUR, MAPCOLOUR, MAPLINEWIDTH,
    MAPSLAB, MATERIAL, PLANETHICKNESS, PSCPK, PSINTERSECT, RIBBONBREAK,
    RIBBONEND, RIBBONSMOOTH, RIBBONTHICKNESS, RIBBONWIDTH, RODRADIUS,
    STICKSEGMENTS, TRIANGULATION, TWORAMPS and USESMOOTHING as well as an
    extension to COILRADIUS:

  COLIRADIUS = coilradius < COILSIMPLE | LINEAR | BFACTOR >
    COILSIMPLE = COILRADIUS.r
    LINEAR = from RADLOW.r to RADHIGH.r by b-factor [ from BLOW.r ] to BHIGH.r
    BFACTOR = from BSCALE.r b-factor [ from BLOW.r ] to BHIGH.r
  COVERRADIUS = coverradius COVER.r
  FINESTRANDS = finestrands < on | off >
  FITHELIX = fithelix LENGTH.i
  FIXEDCALPHAS = fixedcalphas < RES-SEL(*) | none >
  FLATLIMIT = flatlimit FLATLIMIT.r
  MAP2COLOUR = map2colour COLOUR(*)
  MAPCOLOUR = mapcolour COLOUR(*)
  MAPLINEWIDTH = maplinewidth WIDTH.r
  MAPSLAB = mapslab MAPSLAB.r
  MATERIAL = material MATERIAL-SPEC
    MATERIAL-SPEC = < opaque | transparent | CUSTOM-MATERIAL >
    CUSTOM-MATERIAL = { MATERIAL-PROP }
    MATERIAL-PROP = < phong PHONG.r | specular SPECULAR.r | highlight
          COLOUR(*) | clarity CLARITY.r | options OP1.i OP2.i OP3.i OP4.i >
  PLANETHICKNESS = planethickness PLANETHICK.r
  PSCPK = pscpk < flat | windowed | shaded | highquality >
  PSINTERSECT = psintersect < on | off >
  RIBBONBREAK = ribbonbreak BREAK-DISTANCE.r
  RIBBONEND = ribbonend RIBBONEND.r
  RIBBONSMOOTH = ribbonsmooth < RES-SEL(*) | none >
  RIBBONTHICKNESS = ribbonthickness RIBBONTHICK.r
  RIBBONWIDTH = ribbonwidth RIBBONWIDTH.r
  RODRADIUS = rodradius RADIUS.r
  STICKSEGMENTS = sticksegments SEGMENTS.i 
  TRIANGULATION = triangulation TRIANG.i
  TWORAMPS = tworamps < on | off >
  USESMOOTHING = usesmoothing < on | off >




15) DIFFERENCES IN THE RESULTS BETWEEN MOLSCRIPT AND BOBSCRIPT VERSION 2.4
==========================================================================

The intention was that a script file which worked with MolScript v1.4 should
produce identical results with BobScript, and that the colour ramping code
would simply allow extended functionality. This has largely been achieved, and
certainly any MolScript file will work with BobScript and produce very similar
results. There are, however, a few very minor differences and for completeness
I list these differences below.

    a) purple/magenta

The MolScript colour purple is now called magenta, to coincide with
normal computer colour definitions rather than FRODO. The colour
purple is a much more bluey-purple now. Visually, this is the single
biggest change between programs.

    b) ball-and-stick bonds for PostScript output

The ball-and-stick code has been largely rewritten to allow colour
ramping along the length of a bond and split-bond representations. For
PostScript output this necessitates a change in how the black edges of
the bonds are drawn. One result is occasional dents in the side lines if
the line width is large (say >2 points). If I find a good way to correct
this, then I will, but most methods seem prohibitively complex at the moment.
A more substantial change is that bonds in the plane of the paper are still
drawn as bonds and not planes, so the thickness of the bond is a little
different. Furthermore, the calculation of how much of the bond is
inside the sphere is now correct for plane-of-paper bonds, so the ends
of bonds in this case will be marginally more 'real'.

    c) ball-and-stick bonds for Raster3D output

In MolScript v1.4, any bond which is obscured by the atom spheres at
either end is not drawn, and hence cannot cast a shadow. This is a
genuine, but small, bug that seems to be a hangover from the PostScript
only days. This has been corrected in BobScript.

    d) ball-and-stick atoms for PostScript output

In MolScript v1.4 atoms are sorted on a z-coordinate which is half the
atom radius in front of the centre z-coordinate. This has a slight
effect on the atom shading which is probably intentional, but also means
that with plane-of-paper bonds the atoms are draw in front of the plane
of the bond. Unless the bond diameter is comparable to that of the atom
this is a good approximation to the view that would be obtained. With
BobScript, however, this z-coordinate shift means that when bonds are
divided into many segments, some of these may be lost behind the atom
that they are supposed to be in front of, since the bond segments have
their central z-coordinates! I have removed the shift so that normal
bonds are drawn correctly. However, horizontal bonds are drawn so that
one end is in front of its atom and the other is behind. This is OK
unless the bond radius is comparable to that of the atoms, where the
results look rather odd. The new code (in version 2.4) for testing ball and
stick intersections improves the results of ball-and-stick representations.

    e) ball-and-stick atoms for Raster3D output

The depth-cueing of atoms is based on the atom centre in BobScript and
on the atom centre plus half the radius in MolScript v1.4. The above
discussion explains why. The result with Raster3D images is a very
slight, probably undiscernable, change in the shading of atoms.

    f) Not needing a decimal point for real numbers

This change is at the request of many lazy Oxford users!

    g) Colour depthcueing of lines

Lines for PostScript pictures are now colour depthcued in the same way as other
objects, and as they are in Raster3D figures. This would appear to be a
correction of a feature that was a hang-over from the original PostScript-only
MolScript. Obviously, black lines will just remain black whatever distance
they are from the viewer. For PostScript, colour depthcueing should be used
with care, and probably small numbers (say 0.3) should be used for the image
not to become sludgy grey. However, if the background is set black then the
colour depthcueing (of 1.0) can be used to good effect with maps.

    h) Colouring insides and outsides of helices differently with Raster3D

In MolScript 1.4 there was a difference in behaviour between PostScript and
Raster3D output when drawing helices. With PostScript is was possible to have
the inside and outside surfaces of the helix coloured separately, whereas with
Raster3D this was impossible. BobScript has fixed this inconsistency. NB if the
helix has finite thickness then the edging cylinders will be considered as
part of the outside surface.

    i) Default value for sticktaper parameter

In MolScript 1.4 the default value for the sticktaper parameter was 0.75, which
meant that if a bond was perpendicular to the paper then its radius would be
decreased by 75% from the front to the back. In BobScript version 2.4 this
parameter has a default value of 0.0, meaning that no stick tapering takes
place. This is because the mathematics for the stick tapering is slightly
approximate and when combined with the checks for ball and stick intersections
(new in version 2.4) the results were not as good as they should be. The
sticktaper parameter can still be set, however, and if intersection tests are
not used the results will be (almost) identical to MolScript.

16) SOME EXAMPLE INPUT FILE FRAGMENTS AND SUGGESTIONS
=====================================================

Ummm....

1) A secondary structure coloured by the b-factor changing from blue at
   b-factors of 10 or below via white to red at b-factors of 40 or above:

	set finestrands on;
	colour ss by b-factor from 10 to 40;

2) A white secondary structure with the positively residues charged blue and
   the negatively charged ones red:

	set atomcolour atom * white;
	set atomcolour in type ASP red;
	set atomcolour in type GLU red;
	set atomcolour in type ARG royal-blue;
	set atomcolour in type LYS royal-blue;
	colour ss by atom;

3) Simple colour ramp along all a peptide chain (will ignore substrates/waters).
   The colours used are from blue via green to red:

	colour ss by sequence amino-acids;

4) Colouring each chain in a tetramer independently:

	colour ss
          from blue              via green via red at residue A128
          via blue at residue B1 via green via red at residue B128
          via blue at residue C1 via green via red at residue C128
          via blue at residue D1 via green to  red at residue D128
	by sequence from A1 to D128;

5) Colouring each chain in a tetramer independently (will work for indentical
   chains by using the auto-repeating feature of an incomplete ramp:

	colour ss
          from blue via green to red at residue B1
	by sequence from A1 to D128;

6) A split bond representation of a molecule (impossible with normal MolScript):

	set sticksegments 2;
	colour ball-and-stick by atom;

7) A dotted line (alternating white and black segments). This could be useful
   for hydrogen bonds:

	set sticksegments 20;
	colour fractional bonds
          from black via black at 0.04 via white at 0.04 to white at 0.05
        by atom;

8) Striped sections of a polypeptide chain (red and black), leaving the rest
   with normal MolScript colours:

	set finestrands on;
	colour fractional ss
          from red via red at 0.3333 via black at 0.3333 to black at 0.5
	by sequence either from A20 to A56 or from A203 to A244;

9) A ball-and-stick model with the model smoothly coloured by b-factor and the
   bonds the same width as the atoms. Colouring goes from white to red:

	set sticksegments 20;
	set stickradius 0.4;
	set atomradius atom * 1.6;
	colour ball-and-stick from white to red by b-factor from 20 to 40;

10) A ball-and-stick model with the atoms shaded by b-factor and the bonds
    in tasteful(!) blue and yellow stripes:

	set sticksegments 16;
	set stickradius 0.25;
	set tworamps on;
	colour cpk by b-factor from 20 to 40;
	colour ball-and-stick
	  from blue via blue at 0.1875 via yellow at 0.1875 to yellow at 0.25
	by atom;	


  Example of using the map command for a simple case
  ==================================================

This example just takes a model of an inhibitor and an omit map and contours
it at 2 and 3 sigma. Just to give you an idea of what is needed (this is for
producing a nice PS stereo plot for straight-eyed, or viewer, stereo):

	plot leftstereo;
        area 115 300 295 600;
        window 10;
        slab 8;

	read rt  "rt_mkc.pdb";
	map omit "inhib_omit.dsn6" format dsn6 around in type MKC plus 5;

	transform all by gsreal rtview.gs;

        set sticksegments 2;
        set atomradius atom * 1.6;
        colour ball-and-stick by atom;
	ball-and-stick in type MKC;

	set maplinewidth 1.0;
	set mapcolour cyan;
	contour omit at 2 sigma covering in type MKC;

	set mapcolour royal-blue;
	contour omit at 3 sigma covering in type MKC;

	delete rt;
	delete omit;

	end_plot

	plot rightstereo;
        area 305 300 485 600;
        window 10;
        slab 8;

	read rt  "rt_mkc.pdb";
	map omit "inhib_omit.dsn6" format dsn6 around in type MKC plus 5;

	transform all by gsreal rtview.gs;

        set sticksegments 2;
        set atomradius atom * 1.6;
        colour ball-and-stick by atom;
	ball-and-stick in type MKC;

	set maplinewidth 1.0;
	set mapcolour cyan;
	contour omit at 2 sigma covering in type MKC;

	set mapcolour royal-blue;
	contour omit at 3 sigma covering in type MKC;

	delete rt;
	delete omit;

	end_plot



BobScript version 2.4 (© 1997, Robert Esnouf) is based on the program MolScript version 1.4 (© 1991, Per Kraulis). BobScript will only be distributed to sites which have a valid MolScript licence.

This documentation and web page are maintained by Robert Esnouf.

Last update: 23 March 1998, Leuven.