CONIC(1)

NAME

conic - generate CPK-style molecular models with shadows

SYNOPSIS

conic [ -p ] [ -f output-format ] [ -s ] [ -a mode ] [ -o
output-file ] [ -x pixels-wide ] [ -y pixels-high ] [ -c
config-file ] [ -e shell-command ] [ -t ] [ -v ] [ -A ] [ -C
] [ -F ] [ -S scale_factor ] [ -W ] [ PDB -file ]

DESCRIPTION

Conic reads a Protein Data Bank file and generates a Corey- Pauling-Koltun style image of the molecule. If no PDB file is specified, standard input is used. There can be an arbitrary number of light sources. Specular highlights, diffuse reflections, and shadows are all computed properly.

``Capturing Screen Images'' in Part III of the MidasPlus manual discusses saving, converting, and printing conic images.

COMMAND-LINE FLAGS

The command-line flags interpreted by conic are:

-p
Use preview mode. Set the image size to 645x484 and antialias mode to none (see below).

-s
Invoke imgview(1) on the computed image file (SGI or TIFF image formats). This flag is only meaningful when used in conjunction with the -o flag or the output configuration file option.

-a mode
Set the antialias mode. Mode is the same as the argument to the antialias option in the configuration file (see below).

-o file
Store the computed image in file in the selected image format (see the -f flag). The default save format is TIFF. The image is not displayed unless the -s flag is also specified.

-x size
Set the horizontal image size to size pixels.

-y size
Set the vertical image size to size pixels.

-e shell-command
Execute the shell command when the image has finished drawing and exit when the command is done.

-c file
Use file as the conic configuration file.

-f output-format
Use the given output format if possible. The supported output formats are: screen, sgi, ps and tiff, which are: on the screen, SGI image file, Encapsulated PostScript file and TIFF file formats respectively. The default format is tiff if the -o flag (see above) is specified, and screen otherwise. Also, if you use the ps format, see the -H option.

-t
Make the background color transparent. This only works when writing output to SGI and TIFF image files, and it adds an alpha channel to the file so that the resulting image can be composited onto other backgrounds.

-v
Print progress messages.

-A
Ignore USER COLOR, USER RADIUS, and USER MATPROP records present in the input file. Since the MIDAS pdbrun command provides USER COLOR and USER RADIUS records for each atom, this flag must be used if atomic information is coming from MIDAS but a color scheme specified in an atom information file is desired (see the COLORING THE MOLECULE section of this manual page).

-C
Force conic to display full spheres at the near clipping plane. This option affects those spheres whose centers lie across the near clipping plane from the viewer, but whose nearest extent crosses the clipping plane (conic always discards spheres whose centers are closer than the clipping plane). By default, conic shows the sphere with a portion ``cut away.'' With this option, the entire sphere is shown. It should be noted that the ``cut away'' depiction is inaccurate in two regards: the partially cut spheres still cast full shadows, and no part of a sphere is shown if its center is in front of the clipping plane, even though it may extend through the plane. Typically these inaccuracies are not noticeable, but in some situations (such as using point light sources) they may produce odd-looking results.

-F
Set the image size to be the full screen.

-H
If the output format is ps, causes binary data to be hex-encoded. Though raw binary format is more space- efficient, many printers cannot print binary data unless it is hex-encoded. Note that future versions of conic may make hex-encoding the default (and the -H flag would turn it off).

-S scale_factor
Zoom in on the center of the image by the specified factor. The size of the window remains unchanged.

-W
Force MIDAS to wait until conic has exited before continuing.

NeXT DIFFERENCES

The -s option is not supported. Only the TIFF and Encapsulated PostScript file formats are supported. You should place the output in a file whose name ends with .tiff or .eps, so the Workspace may open it correctly. MIDAS simulates the effects of the -s option.

CONFIGURATION FILE

The scene computed by conic is described by a list of options in a configuration file. If the configuration file is absent, or the option is omitted, then a default value will be used. Lines beginning with `#' are comments and are ignored. All other lines are options, which begin with a keyword and are followed by space-separated values. The available options are listed below.

ambient r g b
Set the ambient light to the given RGB value, which is three floating-point intensities ranging from 0 to 1. The default ambient lighting is (0.2 0.2 0.2).

antialias mode
Set the antialiasing algorithm. Mode may be none, for no antialiasing; 3/2, for mapping 3x3 calculation pixels onto 2x2 image pixels; or 2x2, for mapping 2x2 calculation pixels onto single image pixels. Antialiasing improves the picture quality at the expense of computation time. The time increase is proportional to the number of pixels computed modulo the startup time. Thus, for small molecules, which have low startup times, going from mode none to 2x2 will increase the computation time four-fold. The relative increase is less for large molecules since the startup time for large molecules is a significant fraction of total computation time. The default antialias mode is none.

atinfo file
Use the given file as the atom information file, which contains default information on how each type of atom should be colored. Coloring the molecule is described in greater detail below. This option has no effect if conic is invoked from within MIDAS, as MIDAS fully specifies atom colors and radii.

background r g b [r g b [ r g b ] ]
Set the background color for the image. If only one RGB value is given, then the entire background is set in that color. If two RGB values are given, then the background is interpolated between the two colors from bottom to top. If three RGB values are specified, then the background is smoothly interpolated from the first color at the bottom of the image to the second color in the middle to the third color at the top. The default background color is (0 0 0). NOTE: if this option is given in the configuration file, it will override any color specified in the input PDB file.

cone x y z r g b dx dy dz angle
Define a cone light. The absolute Cartesian coordinates of the light source are (x y z). The color of the light is given by (r g b). The Cartesian direction of the cone light is given by (dx dy dz), and the half-angle of the cone is angle degrees.

eye r g b
Conic places an additional point light source which coincides with the eye position. The purpose of this light source is to weakly illuminate shadowed areas so that they have discernible features rather than a uniform color. The eye option sets the color of the point light source. The default value is (0.3 0.3 0.3).

format image-format
Use the given image format if possible (see the -f option above).

fov angle
Sets the field-of-view half-angle, in degrees. The default value is 15 degrees.

input file
Use file as the Protein Data Bank file.

light x y z r g b
Add an infinite light source to the scene being computed. The direction of the light source is specified by (x y z). The color of the light source is specified by (r g b). By default, conic defines a light source with direction (1 1 1) and color (1 1 1). The default light source is removed if other sources are specified via the light option.

location x y
Sets the image location on the screen. This parameter is only meaningful if the output is to the screen, i.e., for output format screen.

ls_flags flags
Change the default flags of subsequently specified light sources. By default, a light source only shines on a point if there are no intervening spheres. If the noshadow flag is specified, however, all points are considered to be lit. The shadow flag will undo the effects of a noshadow flag for subsequent light sources. The noshadow flag is generally used if the scene is very complex, and having shadows makes the resulting image difficult to interpret. This problem may also be mitigated by using multiple light sources.

matprop kd ks power
Define default material properties. Kd is the diffuse reflection coefficient. Ks is the specular reflection coefficient. Power controls how sharply defined a specular light is, and must be a positive even integer. The higher the value of power, the smaller the specular reflection area. The default values are 0.5, 0.25, and 8, respectively. Kd and ks must be in the range 0-1, and power must be 2 or higher.

output file
Store the computed image in file in the selected image format (see the -f and -o options above).

point x y z r g b
Define a point light source. The arguments are the same as those for the light option, except that (x y z) defines the light position rather than direction.

quad x1 y1 z1 x2 y2 z2 x3 y3 z3
Define a quadrilateral (actually a parallelogram) in the image. Since the quad is a parallelogram, only three vertices are necessary to define it. Quads are ``second-class'' objects: They can be in shadow from first-class objects (spheres), but cannot cast shadows themselves. In fact, they cannot even block first- class objects; first-class objects show through. Quads are typically used to construct large background areas that show the shadow of the scene as a whole. For best results, there are two important things to note. First, the default field-of-view for conic is quite narrow, and if you do not see an expected shadow it may be because it is falling outside the field of view. In such a case, you may want to expand the field of view half-angle (using the fov keyword, see above) from the default 15 degrees to 25 or 30 degrees. The second thing to note is that, because of ambient light, shadows will not be black. If you desire black shadows, turn off ambient lighting (using the ambient keyword, above).

quad_color r1 g1 b1 [ r2 g2 b2 r3 g3 b3 r4 g4 b4 ]
Define the vertex colors of following quads. The interior color of the quad will be smoothly interpolated between the vertex colors. If only one RGB triple is specified, all vertices will have that color.

rcone x y z r g b dx dy dz angle
Rcone is to cone as rpoint is to point.

rpoint x y z r g b
Define a point light source relative to the scene, similar to point. The (x y z) coordinate is relative to the center of the scene, with lengths normalized such that the distance from the eye to the center of the scene is 1. Thus, the option

rpoint 0 0 1 1 1 1

would define a point light source that coincided with the eye, whereas

rpoint 0 2 0 1 1 1

would define a point light source directly above the center of the scene, twice as far above the scene as the distance from the center of the scene to the eye.

rquad x1 y1 z1 x2 y2 z2 x3 y3 z3
Rquad is to quad as rpoint is to point.

rspot x y z r g b dx dy dz power
Rspot is to spot as rpoint is to point.

size x y
Sets the image size. The default image size is 1280x1024. If conic is invoked from within MIDAS, then the default image size will be the same as the MIDAS window size.

spot x y z r g b dx dy dz power
Define a spotlight. The absolute Cartesian coordinates of the light source are (x y z). The color of the light is given by (r g b). The Cartesian direction of the spotlight is given by (dx dy dz). The intensity of the spotlight drops off as the angle between the spotlight direction and the pixel direction; the rate of decrease is the cosine of the angle raised to the powerth power. Power must be an even integer; odd integers will be incremented silently.

COLORING THE MOLECULE

Conic uses two sources of atom radius and coloring information. If neither source of information yields a radius and color for an atom, then the atom is ignored.

     The first source is embedded in the input to conic, which is
     an extended Protein Data Bank format.  The format is
     identical to standard PDB format except that ATOM and HETATM
     records may be preceded by USER records, whose text field
     contains a keyword and some values.  (The pdbrun command of
     MIDAS generates output of this format.)  The keywords that
     conic uses are COLOR, RADIUS, and MATPROP.  COLOR is
     followed by three floating-point RGB intensities and a color
     specification.  RADIUS is followed by a floating-point
     number representing the atom radius in angstroms.  MATPROP
     is followed by the three parameters to the matprop option in
     the configuration file.  Once a COLOR, RADIUS, or MATPROP is
     given, it applies to all of the succeeding atoms in the
     file.  An example of the extended format follows.
          USER  COLOR 0.000 1.000 0.000 green
          USER  RADIUS   1.800
          USER  MATPROP   0.500   0.250  16.000
          ATOM      1  C   HIS     1      49.168  26.701  10.916  1.00 16.00
     If the input fails to specify the color, radius, or material
     properties  of  an atom, conic uses an atom information file
     to supply missing values.  The file contains comment  lines,
     which  begin  with  `#',  and  information lines, which have
     either five or eight fields:   atom  type,  radius,  an  RGB
     triple,  and  optionally three material property values (see
     the matprop keyword in the CONFIGURATION  FILE  section  for
     the  meaning  of  material property fields and their default
     values).  The atom type is either one or two characters  and
     is  used  to match the atom type in the PDB input.  The atom
     type `*' is a special case and matches any atom  which  does
     not  match  any  other  information  lines.   Using  an atom
     information  file,  simple  color-by-type  images   may   be
     generated from raw PDB files.
     The default atom information  file  contains  the  following
     lines:
          C    1.8  0.5  0.5  0.5
          N    1.8  0    0    1
          O    1.5  1    0    0
          S    1.85 1    1    0
          H    1.0  1    1    1
          P    1.9  1    0.5  0
          F    1.35 0    1    0
          CL   1.8  0    1    0
          BR   1.95 0    1    0
          I    2.15 0    1    0
          B    1.8  0.5  0    0
          FE   0.64 0.5  0    0
          CU   1.28 0.5  0    0
          ZN   1.38 0.5  0    0

EXAMPLES

     The  demonstration  images   included   on   the   MidasPlus
     distribution  CD  show  how to achieve a variety of striking
     effects and give detailed instructions on how each image was
     made.   If these demonstration images have been installed on
     your     system,     they     will     be      found      in
     /usr/local/midas/demos/images.   The  ``README.index''  file
     there has further information.  If the demonstration  images
     have  not  been  installed on your system, you need to mount
     the distribution CD-ROM, and you will find the images in the
     CD-ROM directory Midas-2.1/demos/images.

BUGS

Light intensity does not attenuate with distance.

SEE ALSO

midas(1)

FILES

     /srv/local/midas/resource/conic.atinfo   -   default    atom
     information file

AUTHORS

Eric F. Pettersen, Conrad Huang, Gregory S. Couch
UCSF Computer Graphics Laboratory