Displaying Molecular and Map Images

The section "Image object code" reveals what image codes "Vva__1" mean. The section "Tryptophan images demo" presents the elementary images based on a tryptophan atom coordinates, the section "Protein images" demonstrates and explains how to display the most commonly used protein model presentations, the section "Combi images" gives you some ideas what you might be able to do with MAIN. The section "Color and light hints" explains how to deal with colors and lights, the section "Background images" explains to you have you can keep images on screen even though MAIN does not remember them any more, the section "Making plots" brings the essentials about MAIN plot file creation and the section "Preparing slides" provides useful and maybe not that obvious instructions for creating slides.

Run the mol_images demos from your directory, to get an idea what you can do with MAIN. First copy the file >doc/mol_images/simple/.main and after you're done with the first demo copy the MAIN_DOC:mol_images/protein/.main, to your directory and start MAIN. MAIN will automatically process the ".main" file, load the coordinates, create the covalent bond list of the model and so on, and invoke the IMAGE DIALOGE mode. By clicking the MENU items, you can generate the elementary images.

If you want to learn more, you should access the chapters MAIN_COM:image.html in the "Command Reference Manual to deal with "image" command sentences and MAIN_MENU:image.html in "Dialog Mode Accessories Manual" to deal with menu driven way of image generation.

Image object codes and colors

Molecular images in MAIN are 3-dimensional rotatable geometrical objects appearing in the largest window, the MAIN image window on which top margin you find the "cool" words. Objects are lines, points, text, sticks and balls. Each molecular image consist of atoms that can be picked and thereby manipulated via menu items..

Graphical presentation of maps are either lines or polygons (AREAS) delimiting a specified map contour level.

Each object name has its own label for example as "Vva__1" (usually appearing on right within the "cool" window) starts with a character, that describes its kind (V for vectors or lines, C for text characters, A for areas or polygons, M for markers, which include points as well). Each image object name description has exactly the same color as its 3-dimensional presentation. The mark before the name (+,-) tells you whether the object is on or off (INCLUDED or REMOVED) from the list of displayed objects.

By setting the mode in the "cool" window menu (INCL_REM, COLOR, REFLECT), you can with clik(s) on labels of image objects INCLUDE and REMOVE them from the list of visible objects, interactively change their COLOR and surface REFLECTANCE properties using dials or mouse.

Manipulating the pickable atoms list

User control over the list of pickable atoms is achieved through access to the KEY "image". Each new IMAGE commands makes an logical ".or." to the already existing KEY "image". You can, however, edit the KEY any time, either by "KEY image SELECT ... END" commands or via the "SELECT" menu block.

Map images

Map images are not bound to atoms and are not pickable. Names of displayed maps appear in the right top corner of the image window. Their COLOR, polygonal REFLECTANCE properties and INCLUDE REMOVE status can be controlled and adjusted in essentially the same way as for the molecular images. Maximally 10 maps can be displayed simultaneously and, in addition to the mouse, their INCLUDE/REMOVE control is bound to the number keys on the keyboard, where key "1" controls the status of the first map and "0"' the tenth.

Tryptophan images demo

Copy the file MAIN_DOC:mol_images/simple/.main to your directory and start main. The ".main" file is automatically invoked when you start main. It reads the coordinates of a tryptophan molecule and creates all necessary data structures you can display by clicking the menu items. It calculates its covalent bonds on default distance criteria, point surface and a molecular envelope. It initializes the image display and then expects your respond:

The atom coordinate file is read and covalent bonds are calculated by checking all possible inter atomic distance. When an inter atomic distance is below a threshold value, then a bond is created.


> read file>doc/mol_images/simple/trp.pdb atom pdb
> calculate bond

Connolly surface points generation requires atomic radii, so they are SET first to default vdW values. You can inspect atomic radii using the SHOW command. DENSITY 10. means 10 points per square AA of the surface.


> set rad select all end vdw
> show radi select atom number 1 end
> poin surface all sele all end dens 10. init

To display a molecular envelope (a map) cell parameters, a map with its GRID sizes and its box (10 grid points AROUND the atoms) should be first created (INITIALIZE -9999). The actual envelope points are all points closer than 1.4AA from any atom center (ATOM MASK 1.4).


> read cell
> 20. 20. 20. 90. 90. 90.


> make map 1 from 0 init -9999 grid 30 30 30 \
> around 10 sele all end real
> make map 1 atom mask 1.4 sele all end

Here the DEMO_IMAGE bock is loaded to give you interactive control over the image composition. The items are explained below, click them and look at the command syntax that creates images. (Open another window and 'tail -f the input.cop' file to see which commands are invoked by clicking a menu item.)


> <>doc/mol_images/simple/load_image_demo.com

IMAGE is INITIALIZED, CENTER set to the ATOM number 3 and the image SCALE is set to 0.4. An image appears on the screen. Dial and mouse control of the image is enforced for this demo with the IMAGE FORWARD command. (Do not use the FORWARD command in your everyday work, use IMAGE DIAL instead.)


> image init cent atom 3 scale 0.4
> image set bond
> image forward
> return

File >doc/mol_images/simple/load_image_demo.com creates the DEMO_IMAGE menu block, its color, a documenation link to a file that does not exist, and defines all its items.


> menu block DEMO_IMAGE create
> menu block DEMO_IMAGE color 160
> menu block DEMO_IMAGE document "does_not_exist"

Each externally loaded menu item command contains a single command line maximally 80 characters long. Each command line is a macro call embedded within two double quotes following the word TEXT.

Normally you would not use such menu items. Instead you would include a sequence of commands into your re_image.cmds file. However, you are advised to look into these macro files to become familiar with the command syntax.

The 'QUIT' command quits the MAIN, it does not only exit the dialog mode. IMAGE ERASE deletes all molecular images, but does not effect map presentations.


menu block DEMO_IMAGE item QUIT     add text "quit"
 menu block DEMO_IMAGE item ERASE \
	add text <>doc/mol_images/simple/erase.cmds

The following items deal with the current color definitions. COLO_SET (IMAGE SET) tells the program to take individual atomic colors, while the IMAGE COLOR items (BLUE, YELLOW, GREEN and RED), address color directly by their MAIN index. Only the last COLOR definition is applied in later IMAGE commands, that actually display something on the screen.


 menu block DEMO_IMAGE item COLO_SET \
	add text <>doc/mol_images/simple/color_atom_set.cmds
 menu block DEMO_IMAGE item BLUE     \
	add text <>doc/mol_images/simple/color_blue.cmds
 menu block DEMO_IMAGE item YELLOW   \
	add text <>doc/mol_images/simple/color_yellow.cmds
 menu block DEMO_IMAGE item GREEN    \
	add text <>doc/mol_images/simple/color_green.cmds
 menu block DEMO_IMAGE item RED      \
	add text <>doc/mol_images/simple/color_red.cmds

Individual atom images can be created as 3-D crosses (ATO_CROS), atom names or spheres (ATO_BALL). The balls image is in a macro because the atomic radii applied are set to their default values each time the item is clicked.


 menu block DEMO_IMAGE item ATO_BALL \
	add text <>doc/mol_images/simple/atom_ball.cmds
 menu block DEMO_IMAGE item ATO_NAME \
	add text <>doc/mol_images/simple/atom_name.cmds
 menu block DEMO_IMAGE item ATO_CROS \
	add text <>doc/mol_images/simple/atom_cross.cmds

Covalent bonds can be presented either as lines (BON_LINE), inter atomic distances (BON_DIST) or sticks (BON_STICK).


 menu block DEMO_IMAGE item BON_LINE \
	add text <>doc/mol_images/simple/bond.cmds
 menu block DEMO_IMAGE item BON_STIC \
	add text <>doc/mol_images/simple/bond_stick.cmds
 menu block DEMO_IMAGE item BON_DIST \
	add text <>doc/mol_images/simple/bond_dist.cmds

The ball and stick presentation (BAL_STIC) reduses the atomic radii, so that the bond sticks can be seen.


 menu block DEMO_IMAGE item BAL_STIC \
	add text <>doc/mol_images/simple/atom_ball_and_bond_stick.cmds

The surface points can be presented in various color modes (SURFACE) and any of their combinations (SURF_MIX).


 menu block DEMO_IMAGE item SURFACE  \
	add text <>doc/mol_images/simple/point_surf.cmds
 menu block DEMO_IMAGE item SURF_MIX \
	add text <>doc/mol_images/simple/point_surf_mix_col.cmds

Map image control is separated from from the molecule images. It always starts with IMAGE MAP command words. It has its own erase command (MAP_ERAS), line (MAP_LINE, MAP_Y) and sticks syntaxes (MAP_STICK) and polygonal presentation (MAP_AREA). Maps can be essentially contoured along any of the 3 possible directions (X, Y or Z), here only Y is chosen. Map STICKS can have a specified radii and density level, similarly as bond stick.


 menu block DEMO_IMAGE item MAP_ERAS \
	add text <>doc/mol_images/simple/map_erase.cmds
 menu block DEMO_IMAGE item MAP_LINE \
	add text <>doc/mol_images/simple/map_lines.cmds
 menu block DEMO_IMAGE item MAP_Y    \
	add text <>doc/mol_images/simple/map_y-ax.cmds
 menu block DEMO_IMAGE item MAP_STIC    \
	add text <>doc/mol_images/simple/map_stick.cmds
 menu block DEMO_IMAGE item MAP_AREA \
	add text <>doc/mol_images/simple/map_area.cmds

At the end the newly created block appears on the page 7.


> menu page 7 add DEMO_IMAGE
> return

Protein images

The purpose of this demo is to show how to display a macromolecular image. The demo is an extension of the previous one. It includes to a macromolecule adjusted procedure for connectivity table generation and it introduces the use of SELECT commands to address selectively different parts of PPAC - thrombin complex.

So get the file MAIN:doc/mol_images/protein/.main and type "mainps.

Since the ".main" appeared in you directory it is wise to call the default ".main" file, otherwise it will not be processed.


> <MAIN:.main

The ".main" file reads in the atomic coordinates in the X-plor or PDB format and generates the covalent bond list (or so called connectivity table).


> read file>doc/mol_images/protein/throm_ppac_fin.xpl atom xpl
> <>utils/calculate.bond "*"

and the Connoly surface file.


> read file>doc/mol_images/protein/thro.surf poin init surf

In the case the surface file is not available yet (you are doing it for the first time) uncomment the surface generation lines. The key "noh" is created in order to save some typing later. All atomic VdW radii have to be defined in order to enable Connolly surface point generation. The density 5.0 means 5 points per square A of surface.


> key noh sele .not atom name H* end
> set rad sele all end vdw


> !poin surf sele segm name TRO* .a noh end sele segm name TRO* .a noh end \
> !   dens 5.0 init
> !write file>doc/mol_images/protein/thro.surf poin surf

It remains to load the demo menu, open the graphic windows, display the first image and center it on the PPAC segment.


> <MAIN:doc/mol_images/protein/load_image_demo.com
> ima init
> ima set bond cent calc sele segm name PPAC end
> image forward
> return

There are four different menu blocks created with MAIN:doc/mol_images/protein/load_image_demo.com (DEMO_CONTR - green, DEMO_COLOR - red, DEMO_SELECT - white and DEMO_IMAGE -light blue). The macros they refer to are when possible taken from the above simple case.

Menu block DEMO_CONTR contains ERASE image item and it can also 'QUIT' MAIN.


 menu block DEMO_CONTR create
 menu block DEMO_CONTR color 190
menu block DEMO_CONTR document "does_not_exist"
menu block DEMO_CONTR item QUIT     add text "quit"
menu block DEMO_CONTR item ERASE    add text >doc/mol_images/simple/erase.cmds

Menu block DEMO_COLOR switches between the atomic color set (COLO_SET), which applies atomic individual colors, and different explicitly defined colors (BLUE, YELLOW, GREEN, RED).


 menu block DEMO_COLOR create
 menu block DEMO_COLOR color 115
menu block DEMO_COLOR document "does_not_exist"
 menu block DEMO_COLOR item COLO_SET \
	add text <>doc/mol_images/simple/color_atom_set.cmds
 menu block DEMO_COLOR item BLUE     \
	add text <>doc/mol_images/simple/color_blue.cmds
 menu block DEMO_COLOR item YELLOW   \
	add text <>doc/mol_images/simple/color_yellow.cmds
 menu block DEMO_COLOR item GREEN    \
	add text <>doc/mol_images/simple/color_green.cmds
 menu block DEMO_COLOR item RED      \
	add text <>doc/mol_images/simple/color_red.cmds

Menu block DEMO_SELECT selects atoms according to their segment names (A_CHAIN, B_CHAIN PPAC), residue groups (SID_ACID, BASE) or simply ALL.


 menu block DEMO_SELECT create
 menu block DEMO_SELECT color 1
menu block DEMO_SELECT document "does_not_exist"
 menu block DEMO_SELECT item ALL \
	add text <>doc/mol_images/protein/select_all.cmds
 menu block DEMO_SELECT item NO_HYDRO \
	add text <>doc/mol_images/protein/select_no_hydrog.cmds
 menu block DEMO_SELECT item A_CHAIN \
	add text <>doc/mol_images/protein/select_A_chain.cmds
 menu block DEMO_SELECT item B_CHAIN \
	add text <>doc/mol_images/protein/select_B_chain.cmds
 menu block DEMO_SELECT item PPAC \
	add text <>doc/mol_images/protein/select_PPAC.cmds
 menu block DEMO_SELECT item SID_ACID \
	add text <>doc/mol_images/protein/select_acid_sides.cmds
 menu block DEMO_SELECT item BASE \
	add text <>doc/mol_images/protein/select_base_wholes.cmds

Menu block DEMO_IMAGE combines colors and selections setups as specified by the DEMO_COLOR and DEMO_SELECT items into the images brought to screen. CA atom trace (CA_TRACE), main chain trace (CHAIN_TR), precalculated Connolly surface (SURFACE). The NICE image is a defined macro, which displays protein and its surface points, by highlighting the bound inhibitor (using ball and stick presentation).


 menu block DEMO_IMAGE create
 menu block DEMO_IMAGE color 220
menu block DEMO_IMAGE "does_not_exist"
 menu block DEMO_IMAGE item BONDS \
	add text <>doc/mol_images/protein/bonds.cmds
 menu block DEMO_IMAGE item CA_TRACE \
	add text <>doc/mol_images/protein/CA_trace.cmds
 menu block DEMO_IMAGE item CHAIN_TR \
	add text <>doc/mol_images/protein/chain_trace.cmds
 menu block DEMO_IMAGE item SURFACE \
	add text <>doc/mol_images/protein/point_surface.cmds
 menu block DEMO_IMAGE item NICE \
	add text <>doc/mol_images/protein/nice.cmds

Finally the newly created menu blocks are loaded to page 7. offered on it.


 menu page 7 add DEMO_CONTR
 menu page 7 add DEMO_COLOR
 menu page 7 add DEMO_SELECT
 menu page 7 add DEMO_IMAGE
 return

Combi images

Free your imagination and donate your own creations. Here are some command macros:


>doc/mol_images/combi/churches.com
>doc/mol_images/combi/balls.com
>doc/mol_images/combi/hbonds.com

Run them and enter the IMAGE DIALOGUE mode.

Color and light hints

MAIN internally works with color maps (Video Lookup Tables or VLT in short) although they appear to a graphics hardware as floating point Red Green Blue (RGB) values. So when you try to color an image object, you refer to it by an index in the color map. Default color 0 is black, 1 is white, colors between 64 and 255 go around in a circle, when you rotate a dial, from blue(64), violet(90), red(110), orange(145), yellow(160), green(200), light blue(220), dark blue(245) and 255 and as next to 64 and reverse.

Molecular images can be colored using atomic colors


> image set

or an explicit color index.


> image color 90

After an image is displayed, you can enter the COLOR mode (click the COLOR in the image window) and then the object for which you want to adjust the color: A dial will be attached to this object and while you turn it, the image objects color will go around in the color interval index between 64 and 255. After a RE_DRAW this colors will be replaced by the initial values, so when you want to keep them you have to either grab their index (IMAGE LIST) or not press RE_DRAW or any function that modifies molecular model geometry. This does not apply to map images, they keep the color you have adjusted with a dial regardless of that what you do with the map.

Each atom has its color index defined by default on the basis of its atomic number. You can change atom colors with SET COLOR commands:


> set color sele atom name C .a segm name MOLB end col 200
> set color sele resi name ARG LYS .a segm name MOLB end col 110

Lights affect only polygonal (AREA) images. Light is reflected on AREAS and not on lines (vectors), points and text objects. It is possible to manipulate at least ten lights (computer hardware dependent) simultaneously. A light can be ambient, directional, positional or a spot light. The follwoing commands brig you the essentials of a light manipulation and its control.


> image light 3 on
> image light 3 directional
> set dial 1 light 3

For more details see IMAGE LIGHT commands and SET DIAL ... LIGHT manipulation of light parameters in the "Reference manual".

Background images

Background images are images prevented from deletion when commands as 'IMAGE ERASE' and redraw ('IMAGE OVER FALSE') are invoked. A typed


> image from

command sets the image erase counter to the current number of image objects. A following IMAGE ERASE command will only clear the images from the MAIN memory, but will keep them on the screen. This is the only way to keep GRAPH images as Ramachandran plot on screen while doing molecular modeling, because MAIN does not remember them at all. The typed


> image from 0

command set the image erase counter to 0 and thereby enables deletion of every image object. You can off course set the counter to any valid integer number.

This happens automatically when using the menu item "BACK_PDB" or calling the MAIN_UTILS:background_file_image.com directly.

I recommend you to build this command in your startup file at the end of your initial background image construction. See also the chapter "A real case".

Making plots

Postscript plot of lines, labels and dots

The simplest way to prepare a plot of an image is to enter dialog mode and click on the menu item PLOT. The file name to which the image object are to be plotted is INQUIRED from the standard input window ("PLOT FILE NAME:"). The resulting file can be afterwards converted to a PostScript file by using the program 'lwplot' written and modified by a number of people. For MAIN users backup of typed answers, definition of window size and color use was added to it.

As well as when preparing slides, it makes sense to include the complete generation of an image that you will plot into a command file, which can be edited and used also at some other time.

The default use of fog or depth cuing routines gives you the advantage of the depth impression, because the images fade against the background from front to the back of the 3-D object displayed. When generating plots. The plot only knows clipping but nothing about depth cuing, so you are hindered to see what will really appear in the plot file. Therefore I recommend you to change the front to back CONTRAST to values close to 1.0, so that also things at the back become clearly visible as well.


> image contrast 0.9

Plot invokes redrawing of the entire image, therefore the background object and image objects displayed through using GRAPH command sentences can not be redrawn.

No polygons can be plotted (balls, sticks and map areas).

GRAPH objects can be plotted with some additional effort. Since there is no GARPH redraw option, you should do the redrawing explicitly by yourself. Once the desired GRAPH objects scaling is set OPEN a plot file and redraw the GRAPH objects by repeating the drawing commands (the best way to do it is to copy commands from the input.cop file):


> open unit 79 over file YOUR_PLOT_FILE_NAME
> image plot (  unit 79 lwplot on initialize )

here insert the GRAPH COMMANDS


> image plot off
> close unit 79

and close the file.

Any area objects (atom balls, bond stick and map areas) are not saved to the plot file.

This MAIN plot file is later on processed with the program 'lwplot', which you can find in the directory 'main/progs' and should be in your 'PATH' already. 'Lwplot' is a simple program, so just try to run it. When executed it creates a backup file with all your answers to questions on a FORTRAN unit 79 (fort79 or similar). This file you can edit and use as input for later 'lwplot' runs. Do not forget to rename ('mv') it, otherwise it will be overwritten by the next run. With a few iterations it is usually possible to adjust scales and window sizes. The output of 'lwplot' is a PostScript file ready to be previewed or printed.

Bellow is such an input file: first comes the output file name, then some declarations of size and fonts, then the input MAIN plot file and then you have to answer which objects to see with which line style and thickness. It works with RGB colors from the screen, too.


 omit_map.ps
 omit map at 1.85
      !stereo
      3.80     !window
      6.00     !ch-siz
      0.00     !ch-offset
      8.00     !scale
      4.00     !stereo-sep
 omit_map.plot
    0     ! vl_1
      0.00
    0     ! vl_2
      2.00
    0     ! h_at
      0.25
    0     !  m_1
      0.05

Raster3d plots of sticks, balls, labels and polygonal surfaces

The idea is to compose an image by creating of object oriented raster3d "r3d" files, process labels and hydrogen bond list, merge them into a single "r3d" file andprocess it with the "RENDER3D" program.

Image is composed by including commands for generation of partial image objects into an re_image_MY_SLIDE.com file as described beneath and invoke it with an modified re_image.cmds file.

Before anything it may start to adjust the view:


 save over file MACRO + .view view
< MACRO + .view

by rerunning the macro with the "RE_IMAGE" cliks. After the view seems OK, comment the file save line:


 !save over file MACRO + .view view

Header

Header is inevitable, but it makes sense to created only once.


 open uni 24 file MACRO + _head.r3d over
 image plot ( raster3d unit 24 init on )
 image plot off
 clo uni 24

Labels

History labels are written to the file in the moment when raster3d plot is "INITIALIZED". Therefore create your history list on the top in front of your header generation.


 image hist init
 image hist atom name off
 image hist pick 4638
 image hist pick 4629
 image hist pick 4605

Later on you may edit the label records (changing coordinates and text), so comment the header generation when you start editing the header file.


 11
  41.703  -2.758  19.024 0.000 0.000 0.000
 HISH 253

Bond sticks

ALl bonds are drawn as cylinders with a of specified radius. If you want them closed create also small atom balls at their ends. Here is a code for side chain presentation of loop in the range between 247 and 255.

key active sele seq 247 : 255 .a segm name IA end


 ! balls end sticks


 if ( PLOT .eq. ON ) then
  open uni 24 file MACRO + _ball_stick.r3d over
  image plot ( raster3d unit 24 init on )
  rewind unit 24
 end_if


 set stick radi = 0.15
 image sele active .a .not atom name H* N C O end set bond stick


 set radi sele active end = 0.15
 image sele active .a .not atom name H* N C O end set atom ball


 if ( PLOT .eq. ON ) then
 image plot off
 clo uni 24
 end_if

Atom balls

All CL atoms are shown in green as large green atom balls with radii 1.4.


 ! atom balls


 if ( PLOT .eq. ON ) then
  open uni 24 file MACRO + _ball.r3d over
  image plot ( raster3d unit 24 init on )
  rewind unit 24
 end_if


 set radi sele atom name CL end = 1.4
 image sele atomname CL end col 198 atom ball


 if ( PLOT .eq. ON ) then
 image plot off
 clo uni 24
 end_if

Ribbon

Ribbon plot is generated for the segment name IA selection KEY "display". The segment is in this case colored by residue type (MAIN_CMDS:image_col2_by_resi.cmds).


 ! the ribbon plot


 if ( PLOT .eq. ON ) then
  open uni 24 file MACRO + _ribbon.r3d over
  image plot ( raster3d unit 24 init on )
  rewind unit 24
 end_if


 key display sele segm name IA end
<?MAIN_CMDS:image_color_set.cmds
<?MAIN_CMDS:image_col2_by_resi.cmds
<?MAIN_CMDS:image_do_rib_stick.cmds


 if ( PLOT .eq. ON ) then
 image plot off
 clo uni 24
 end_if

WARNING: Since for the ribbon plot POINTS array is initialized, you may loose RASTER3D surfaces and other POINT arrays unless you do not tailor the code.

Maps

Usually one wants to show map only around a specified selection of atoms, in this case the "active" KEY selection.


 if ( PLOT .eq. ON ) then
 open uni 24 file MACRO + _map.r3d over
 image plot ( raster3d unit 24 init on )
 rewind unit 24
 end_if


<MAIN_CMDS:image_map_mask.cmds 1
 image map 3 stick rad 0.06
 image map 3 dens MAP_CONT stick on


 if ( PLOT .eq. ON ) then
 image plot off
 clo uni 24
 end_if

Grasp surfaces

Grasp surce points can be read as r3d files. The GRASP output requires an UNGRASP step.


 if ( PLOT .eq. ON ) then


 open uni 24 file MACRO + _surf.r3d over
 image plot ( raster3d unit 24 init on )
 rewind unit 24


 end_if

Read points and assign them to the nearest atoms by "recapture".

Remember that ribbon generation always initializes the point array therefore 3ngles of GRASP surface has to be read just before the image generation.


 read file pro_1.r3d poin init \
  raster first sele segm name MOL1 .a chain name A end
 make poin from atom sele segm name MOL1 .a chain name A end recapture


 set col
 sele segm name MOL1 .a .n chain name A end = 227
 exit


 image set sele segm name MOL1 end poin 3ang


 if ( PLOT .eq. ON ) then
 image plot off
 clo uni 24
 end_if

Hydrogen bonds

Hydrogen bond list enters the header file at initialization (similarly as labels). So do not mix the hydrogen bonds and label files and history lists. You should edit the hydrogen bonds file and remove the header records before you submit the rendering procedure.


 image history initial
 image hist pick 4642
 image hist pick 4595
 image history distance


 open uni 24 file MACRO + _hbond.r3d over
 image plot ( raster3d unit 24 init on )
 image plot off
 clo uni 24

Stereo

Rotate the object for 7 degrees to obtain the stereo pair of the original image. Only the header file contains the orientation matrix, so there is no need to duplicate all other files.


 image matr y- 7.0
 open uni 24 file MACRO + _head_7.r3d over
 image plot ( raster3d unit 24 init on )
 image plot off
 clo uni 24

Rendering

"render.sh" is a shell script, which from your "r3d" files creates "png" or "tiff" files ready for slides and printing. "tiff" files can be viewed with "xv" or a similar program.

The size of labels is controlled the LABEL keyword. Fonts are scalable. Labels are displayed only for history atoms. You can edit the header file to move the labels around as well as to change the text.

To display broken cylinders sticks "HISTORY DISTANCE" commands are used. The list of cylinders comes at the end of the "header" file. The file needs to be edited before rendering. You should remove all lines on the top until the first "3" record is reached.


NAME="tetra_stand"
LABEL="3"


$MAIN/r3d/crke/labels.pl "$NAME"_label.r3d $MAIN/r3d/crke/ "$NAME".matr "$NAME"_lab.r3d $LABEL
cat "$NAME"_head.r3d "$NAME"_surf.r3d>  "$NAME".r3d
render -tiff "$NAME".tiff -labels<  "$NAME".r3d
 exit

The file "transparent_black.r3d" will define transparent colorless material properties suitable for rendering. Usually it is used last - to make only the last "r3d" object transparent.


 9  Here is an example of specifying a transparent material
 8
   40.0  0.8   0.9 0.9 0.97   0.52   1 0 0 0

Preparing slides

Slides are prepared for presentations. They should be clean and perfect. They should express what you want. Too many details distract observers attention. It can take several work sessions to prepare a sufficiently good slide. Therefore nothing should be left to coincidence, everything must be under control and reproducible. The major attention should be directed to the choice of colors. Colors should be different, but not exactly opposite according to the color wheel (violet-magenta-red-yellow-orange-green-light and dark blue). Dark blue maps go well with yellow model, but dark blue models are almost invisible. When displaying surfaces do not use the same color for surface points and for model behind, since they both will lost their clarity. When presenting complexes use color of the molecule B for the surface on molecule A and vice versa. This will evidently improve their differentiation.

The whole image should be brought to screen from a command file. After you have loaded the >cmds/load_depp_page.com use the item RE_IMAGE (on page 9 or 2) to redraw the whole image. Below I describe a rather complicated example, which hopefully includes quite a few useful approaches. After the image is done, remove the list of images and the image control menu from the image window (click MENU, press 'M' or type the command "image menu off"), enlarge the image window to the whole screen, make the first photo and for its stereo mate rotate the image for the stereo angle by pressing key '-' or '+'. For making slides one rotation is enough, for photos, however, the difference angle should be large, so press a key twice.

Reflection coefficients, sticks radii, ball approximations and line type keep their values as long they are not changed. So it is possible along a sequence of commands, effect all following created image objects. In contrary to them, modification of lights effect the whole scene simultaneously. (See commands SHOW LIGHTS, REFLECT, STICK, BALL that display the contemporary parameters and to them related IMAGE LIGHTS, REFLECT, SET STICK and POINT BALL that can modify these values.)

If Connolly surface points or vectors appear to dark when compared to area objects, display them twice or even three times in order to increase their image intensity.

The re_image.cmds calls right at the top the "image_active_dens.com macro which effectively displays the image:


> <image_active_dens
> return

The file "image_active_dens.com" displays parts of molecular model together with electron density. First the whole image is erased and line type set to 1 (continuous line).


> image line 1 erase

Sometimes we may wish to use some colors not available in the MAIN default color table (color indices between 64 and 255). For such cases I recommend the use of indices between 32 and 63. The VLT commands below define colors in their RED, GREEN and BLUE components explicitly. The valid component values are between 0.0 and 1.0. The color 32, defined below, is still white, but does not burn the film. The color 33 becomes dark green.


> vlt
> col 32 red 0.5 gree 0.5 blue 0.55
> col 33 red 0.3 green 0.7 blue 0.2
> exit

The view file includes orientation, scale, center and clipping of the image. As long you are trying to improve the view, keep the SAVE VIEW command below, so that the current view is written to a file just before invoking it. As soon as the view appears OK, the SAVE command should be commented. Sometimes you may wish to change the front to back contrast or light definitions. This is an appropriate place for insertion of the corresponding commands.


> save over file active_dens.view view
> <active_dens.view

The history list is initialized (erased) and then the desired atoms are picked and stored the key 'labels'. This part of the macro was created so, that the atoms were picked on the screen and the parts of the 'input.cop' file were later on included into this file and tailored. The history labels are then removed (HISTORY INITIALIZE) and displayed with the later IMAGE command, however, using the user defined color 32.


> image hist init history atom name off
> image hist pick 485
> image hist pick 473
> image hist pick 459
> image hist pick 1294
> image hist pick 413
> image hist pick 456
> image hist pick 430
> image hist pick 2936
> image hist pick 1306
> image hist pick 2465
> image hist pick 1754
> image hist pick 380
> image hist pick 71
> image hist pick 104
> image hist pick 917
> key labels sele history end
> image history init
> image sele labels end col 32 resi name sequ

Here some keys were defined to make the further atom assignments easier to handle.


> key procb_pact sele seq P2 P14 .o seq P30 P52 end
> key procb_eact sele around key procb_pact dist 20. .a procb_enz end

Radii of different parts can be specified differently. The propeptide atoms, because they are displayed inside the electron density map contours get slightly larger radii.


> set rad sele all end vdw
> scal 0.24 rad sele procb_pep end
> scal 0.14 rad sele procb_enz end

Bonds of the enzymatic parts of procathepsin B are then displayed in magenta (95) and light blue (224). The SET colors are used, because the bond connecting the two different colored segments should be displayed as well.


> set stick dens 6
> set stick rad 0.1
> set col
> sele procb_enz end col 95
> sele procb_enz .a seq 105 126 end col 224
> exit
> ima sele procb_enz .a procb_eact end set  bond stick

The atomic colors are now changed back to their default values. Only noncarbon atoms are shown as balls in order to simplify the image.


> set col sele procb_enz end default
> ima sele procb_enz .a procb_eact .a .not atom name C* end set atom ball

The propeptide bonds are shown with thicker sticks than the enzyme ones and the atoms balls are displayed similarly as specified above.


> set stick rad 0.14
> set col
> sele procb_pep end col 33
> sele procb_pep .a seq P1A P7 end col 162
> exit
> ima sele procb_pep .a procb_pact end set bond stick
> set col sele procb_pep end default
> ima sele procb_pep .a procb_pact .a .not atom name C* end set atom ball

The "IMAGE_MAP" (MAIN_MENU:image_map.html) menu block takes care of the map image. Click through the options for various images, and if you want to learn the syntax and use it in your slide macros, follow the links. For a slide you usually need a map around an selected group of atoms. The "MAP_MASK" item (MAIN_CMDS:image_map_mask.cmds) does it.

Displaying text

Strings can be displayed in any color and at any position on the screen. They are treated as GRAPH objects. The following sequence of commands brings a text on the screen and enables you to interactively adjust its position.


> graph
> object 1
> col 160
> x- 0.
> y- 0.
> text "JHG KJHG65_ HGIUG"
> exit
> set dial 1 graph obj 1 translate

The default (x,y) values for a position of the text are 0.0, however, you can place a text anywhere on the screen by changing the defaults. Each text can have its own color and position. With dials you can later move around the whole graph object. There are up to ten GRAPH objects, and each one of them can be composed of any number of strings or drawings. Ramachandran plot is an example of a graph object (see chapter "Utility macros", section "Ramachandran plot").

Image Trouble Shooting

IMPORTANT: only data that are known to the program can be displayed. If there are no atoms, you can not see them on a display, if atoms are not connected via covalent bonds, you can not expect to see their covalent bond network... When an image object exists, a string with its color is displayed on the right edge of the image window. If an object has no color (or a color equal to the background) you can not see it. The


> image list

command prints all molecular image names, their status (D-displayed, R-removed or E-erased) and their color (index). After a molecular image object has been created and you don't see it, then your SCALE or CENTER might be wrong. The


> image center calculate select ... end

command is usually successful, although the CENTER of atom selection (arithmetic average of all selected atom coordinates) may sometimes be placed into an empty region between atoms. This usually happens when you are displaying several molecules which are far apart from each other.

Cases

GRASP surfaces: Tetramer of cathepsin C

The grasp/read.com and grasp/re_image_4_surf.com generate the image of cathepsin C tetramer. For complete case see MAIN:cases/.