How not to draw specular reflections in Molscript?

John Michael Sauder sauder at castor.fccc.edu
Wed Feb 14 11:32:19 EST 1996


In article <4fqlqdINNlfi at s-crim1.dl.ac.uk> mbces at s-crim1.dl.ac.uk (C.E. Sansom) writes:
>	Can anyone tell me how to get rid of (or, alternaticely, print in a 
>colour other than black) the specular reflections which Molscript insists on 
>drawing on any atom in cpk or ball-and-stick format?  

	There are two ways.
	The first and most immediate option is to edit the PostScript output.
	The second option is to modify the source code and re-compile.

----------------------------------------------------------------------------
(1)  Edit the final PostScript file.

Look for /Sphere, one of the first definitions.
Comment out lines that do not specify a full 360 degree arc.  Each of these
commands are terminated by 'stroke'.  Make sure there is a final stroke 
command for the sphere itself.  For example:

/Sphere {
  newpath 3 copy 0 360 arc gsave Sphcol fill 0 setgray 0.5 setlinewidth
  3 copy 0.94 mul 260 350 arc stroke 3 copy 0.87 mul 275 335 arc stroke
  3 copy 0.79 mul 295 315 arc stroke
%  3 copy 0.8 mul 115 135 arc
%  3 copy 0.6 mul 135 115 arcn closepath gsave 1 setgray fill grestore stroke
%  3 copy 0.7 mul 115 135 arc stroke 3 copy 0.6 mul 124.9 125 arc
%  0.8 mul 125 125.1 arc
  stroke grestore stroke
 } bind def

This will remove the "reflection", but keep the light shadowing (3 curved
lines) on the bottom edge of each sphere.

-------------------------------------------------------------------------
(2)
An optional procedure is to modify the Fortran file 'ps.f' and recompile
MolScript.  After modification, you don't need to worry about editing the
PostScript file all the time.  The modification described below simply
adds "%" comments in the appropriate locations in the output file.  If
you decide that you WANT reflections, simply remove the comments (%).

        (begins around line 101 in MolScript v1.4  ps.f)

      CALL PSSTR ('/Sphere {')
      CALL PSOUT
      CALL PSSTR ('  newpath 3 copy 0 360 arc gsave Sphcol fill 0 ' //
     $            'setgray 0.5 setlinewidth')
      CALL PSSTR ('  3 copy 0.94 mul 260 350 arc stroke ' //
     $            '3 copy 0.87 mul 275 335 arc stroke')
      CALL PSSTR ('  3 copy 0.79 mul 295 315 arc stroke ')
      CALL PSOUT
      CALL PSSTR ('%  3 copy 0.8 mul 115 135 arc')
      CALL PSOUT
      CALL PSSTR ('%  3 copy 0.6 mul 135 115 arcn closepath ' //
     $            'gsave 1 setgray fill grestore stroke')
      CALL PSSTR ('%  3 copy 0.7 mul 115 135 arc stroke ' //
     $            '3 copy 0.6 mul 124.9 125 arc')
      CALL PSSTR ('%  0.8 mul 125 125.1 arc ')
      CALL PSOUT
      CALL PSSTR ('  stroke grestore stroke')
      CALL PSOUT
      CALL PSSTR (' } bind def')
      CALL PSOUT

--------------------------------------------------------------------------
If anyone is interested in a few other little tricks, send me e-mail.
I'll offer one more trick:  Remove the border around the figure.

Comment out the lines after /MolScriptPlotSave up to and including "clip".

/MolScriptPlotSave save def
%50.00 100.00 moveto 550.00 100.00 lineto 550.00 700.00 lineto 50.00 700.00
%lineto closepath gsave
%gsave 1.0000 setgray fill grestore
%clip
newpath

The following modification to 'graphics.f' will also automatically 
comment-out the border in each PostScript file (around line 1148 in 
MS v1.4): 
As above, just delete the comment (%) if you want to have a border.

C
C Create plot area path
C
      CALL PSSTR ('%')             <<---  just add this line
      CALL PSREAL (AREA (1), 2)
      CALL PSREAL (AREA (2), 2)
      CALL PSSTR ('moveto')

-------------------------------------------------------------------------
Alternatively, you can thicken the border, or change its width or height
so that it forms a more even border around your figure.  It is even 
possible to make the background black if you want to send the image to
a slide maker.  (However, if you do this, you must make some of your
linecolours white, including labels).  Since raster3d doesn't do labels,
this is an alternative option when making slides...

	It is possible to fix just about any problem if you are 
determined enough.  For example, if you look in Nature Structural
Biology, October 1995 2:818, you can see an example where the bonds
command was drawing ligands directly to the interior of a calcium ion.
I was able to edit the PostScript file so that the ligands stop at
the outer surface of the ion.  
	One last easy trick for displaying side-chains is to make the 
alpha carbon radius tiny (thanks to Paul Laub for this trick):
		set atomradius CA 0.1;

This way, you can draw the side-chain bond to the alpha carbon without
having it display the alpha carbon atom.

 ball-and-stick require in residue 82 and not either atom C, atom N or atom O;
 
-- 

                                --  Mike S. (M_Sauder at fccc.edu)
				www.fccc.edu/research/labs/roder/mike.html




More information about the Xtal-log mailing list