About
RasCtrl is an ActiveX control for visualizing
proteins and motifs. It provides not only general functions to visualize
proteins but also special functions to visualize and manipulate motifs, which are local substructures having conserved spatial arrangements across a group of proteins.
RasCtrl can be easily plugged into windows applications.
RasCtrl is developed for the Motif
Space project at the Computer Science department of the University of North Carolina at Chapel Hill, NC. RasCtrl has been embedded to
MotifSpace Client that performs protein and motif visualization with the help of the MotifSpace database. A screenshot of the MotifSpace Client with several RasCtrl components is shown as following.
RasCtrl is adapted from Rastop, a
stand-alone application with graphical interface developed by Philippe Valadon.
Similar to Rastop, the "RasMol molecular engine" is used to render
proteins. In order to satisfy the Motif Space project requirements, following
modifications have been made:
The RasMol engine has been
wrapped into a class to avoid memory confliction and allow multiple RasCtrl
controls be embedded in a same client.
The interactions between the
RasMol engine and the client are achieved by using methods and events
defined in the ActiveX interface. All RasMol commands are supported through
the ActiveX interface.
The special functions are
provides to manipulate motif structures. Motifs on different proteins can
be overlapped in a same RasCtrl window. The manipulation of motifs can be
synchronized among several RasCtrl windows. These functions help users to compare the structure of
motifs on different proteins and to
understand the spatial arrangements of motifs.
A hybrid rendering approach is
applied to combine software rendering of the RasMol engine with the hardware
rendering of OpenGL. The RasMol engine is used to render proteins in
standard ways. OpenGL rendering is used to render motif annotations with
rich visual effects that cannot provide by the Rasmol engine, such as
semi-transparent annotations. These annotations help users to identify
motifs from complex protein structures.
Infrastructure
The infrastructure of a client application using RasCtrl is shown as
following.

The client application can embed several RasCtrls. This enables several
proteins to be shown side by side. The client controls drawing styles and poses of proteins through the
RasCtrl methods. A user can interactively manipulate proteins shown in an individual RasCtrl window, such as rotating
proteins, zooming in/out proteins, or selecting substructures on proteins. The user actions are sent to the client through the events fired from RasCtrl.
A RasCtrl control occupies an area of the client window. Its methods and events are defined in
the ActiveX interface.
Behind the interface is a CRasAdaptor object that actually handles the method calls from the interface. It contains two rendering engines: the Rasmol engine for rendering
proteins and the OpenGL engine for rendering motif annotations. The CRasAdaptor object dispatches rendering tasks to the two engines and combines the rendering results from these engines.
The class CRasmol wraps the RasMol engine. The Rasmol engine is a widely used
protein visualization tool developed by Roger Sayle. It is a pure software-rendering engine that relies on highly optimized algorithms to achieve real time rendering of
proteins. The original program of RasMol is written in C. There are a lot of global variables and static variables in the code. Directly using this C code to build ActiveX will cause problem, because the global variables and static variables of different
controls share same memory. In order to make RasCtrl controls run independently without interfering with each other, the global variables and static variables in the Rasmol are changed to the member variables of CRasmol.
The class CRasOpenGL is responsible to render motif annotations. The annotations with special visual effects, such as semi-transparent annotations, are provided thanks to the support from OpenGL.
The rendering results from the two engines are combined seamlessly. When rendering a scene, the
RasMol engine is invoked first to obtain a color image and a depth image of the rendered
proteins. Then the color and depth buffer of OpenGL are initialized by transferring the color and depth image to the corresponding buffers. Finally OpenGL engine is used to render motif annotations based on the initialized buffers.