What's new in v2.0?

Version 2.0 of MolScript is a major new release. There are several new output formats and several new features. In fact, it is an entirely new program, with much expanded functionality compared to previous versions (v1.4 and older). It is almost completely backwards-compatible with the previous versions.


OpenGL interactive graphics

A new interactive OpenGL output mode is available on computer systems that support OpenGL. The implementation uses the GLUT library by Mark Kilgard for the window system interface.

The rendering is based on the same graphics objects as the other output formats. The 3D OpenGL image is rotatable and scalable using the mouse, and the current rotation matrix can be output for the user to cut-and-paste into the MolScript input file. This considerably simplifies the process of defining a good view of a molecule, previously a cumbersome iterative process.

When an error in the input file is encountered, the OpenGL output mode does not abort the program. Instead, the graphics objects created so far in the script are rendered, so that the user can correct the input file, and re-read it within the same running MolScript process. This speeds up debugging of input scripts, and also makes it easy to test different modifications to the graphics state parameters.


VRML 2.0

The VRML 2.0 output mode is entirely new. VRML 2.0 is a standard for distribution of 3D objects on the Web. It is a very good option for publishing protein 3D structural data in carefully crafted models with accompanying annotation. In the current version, there is support for all graphical objects, and for making anchors (Web links) from the graphical objects.

The VRML 2.0 specification supports dynamic behaviour, and features based on this may be included in future versions of MolScript. Currently, investigations are being made to test support for dynamic behaviour in the models, such as molecular dynamics, illustrations of enzymatic reactions, or depiction of changes in quaternary structure.


Image files

It is now possible to create image files in the JPEG, PNG, Encapsulated PostScript (EPS) and SGI (aka RGB) formats directly from an input file. It is no longer necessary to use screen-capture programs or similar software to make JPEG files or other image files for use in Web sites.


Raster3D

The Raster3D implementation has three major new features:


MolAuto

The MolAuto program is a stand-alone program which reads a coordinate file, and produces a MolScript input file based on what is found there. Features such as secondary structure and ligands are identified and commands to render these are output.

The MolAuto program considerably simplifies the process of creating new MolScript images. The behaviour of MolAuto can be controlled to some degree by command-line options.


External objects interface

An interface to graphics objects created by external programs has been added to MolScript. The object command reads an object file containing the specification of the objects. The format of the object file is straightforward, and allows points, lines, triangles and triangle strips to be specified. This can be used for e.g. molecular surfaces or electron density representations generated by other software.

The appearance of the objects is determined by the same parameters as the ordinary graphical objects in MolScript. It is also possible to specify explicit colours in the object file. The object coordinates may be transformed by the view matrix specified by the most recent transform command.


Graphics commands


Graphics state parameters


Command-line options


Relaxed command syntax


Reimplementation in C

The MolScript program has been completely rewritten in the C programming language. The MolScript C source code is strict ANSI C, and should therefore compile with any ANSI-C compliant compiler. The previous versions (1.4 and older) were written in Fortran 77.

No static memory limits

There were many static limits on the size of molecules and the complexity of graphical objects that could be handled in MolScript v1.4. The cause of these limits was the lack of a dynamic-memory mechanism in standard Fortran 77. The values of the limits could be changed only by modifying the source code and recompiling the program.

In v2.0, there are no such limits; all memory usage is dynamic, and the size of the application is now limited only by the physical or virtual memory of your computer. This means that there will be no need to recompile the program when the applications increase in size and complexity.

Increased computational efficiency

The reimplementation has resulted in a considerably more efficient program. Tests on an SGI machine indicate that execution of equivalent input scripts are often more than 50 % faster with v2.0 compared with v1.4.

The memory footprint of the new v2.0 is almost always much smaller than in v1.4, since memory is dynamically allocated only when it is actually needed by the program. In v1.4, memory allocation had to be statically determined at compile time, and therefore set to the maximum expected application size. This could pose a problem on certain computer systems.

Organisation of the source code

The source code for v2.0 has been organised to facilitate implementation of new output formats. The set of routines that need to be written for a new output format are well-defined. The routines that create the graphics objects have been made independent of the output routines.


Backwards compatibility

There are a few cases where v2.0 is incompatible with previous versions, and where input files which work for v1.4 (and older) are no longer valid.

Completely different Encapsulate PostScript (EPS) output

The EPS format of the previous versions (v1.4 and older) was fundamentally problematic. It was nearly identical in form with the proper PostScript output. Although formally valid according to the PostScript Reference Manual, it apparently did not satisfy almost any available software.

The new EPS output mode has therefore been completely redesigned to produce a pixel-based image file format, containing a pixmap of the image rendered via OpenGL.

Only PDB coordinate files supported

In the current version, only PDB coordinate files are supported.

The reason for this was that no examples of the other input file formats could be easily obtained for testing during the reimplementation of MolScript.

The other coordinate file formats supported in the previous versions (v1.4 and older) have become even less important since 1993, and the PDB format (with all its limitations and problems) is the undisputed de facto interchange standard for biomacromolecules.

Parameter colourdepthcue removed

The colourdepthcue parameter in the graphics state has been removed. Its functionality has been replaced in v2.0 by the fog header command.

The reasons for this change were partly that the function of the old parameter was badly designed, partly that it was difficult to implement it in output modes other than PostScript.

The output mode cannot be specified in the input file

In previous versions of MolScript (v1.4 and older) it was possible to specify the output format produced by MolScript directly in the input file, by giving a keyword encapsulated or raster3d before the first plot. This possibility has been removed. The output format must now be specified as a command-line option.

The reason for removing this feature was that it was messy (both for the user and for the developer of MolScript) to have two different ways of specifying output format. Also, it was unclear how to resolve conflicts between an explicit setting in the input file and a given command-line option.

Crosses will be drawn for non-bonded atoms

A new parameter bondcross has been introduced in v2.0, which controls the size of crosses drawn for non-bonded atoms in the bonds command. The same behaviour as in previous versions of MolScript (v1.4 and older) can be obtained by setting the value of this parameter to 0.0.


Version development policy

The development of MolScript progresses at a very uneven speed. New versions containing novel features and/or bug fixes are planned, but the implementation of these take place whenever there is time. No commitment as to release dates can be given.

However, the author gives the following statement of intent:

No new features will conflict with previously available features. Later versions of MolScript will be proper supersets of earlier versions, i.e. everything that works with one version of MolScript will work with a later version.

Erroneous behaviour (i.e. bugs) may be changed between versions. In version 2.0, this applies especially to the implementation of lighting in the Raster3D output mode, which is suboptimal, and should be improved in future versions.

Only in extremely well-founded cases will there be exceptions to this (but see above). However, if any such exceptions are introduced, these will be high-lighted in the documentation.

The reason for giving this statement is to make it possible for other programmers to produce software that automatically generates MolScript input files, which will be valid also for later versions of MolScript.

Note that this policy statement does not refer to the internal implementation details of MolScript, nor to the details of the output file formats. For instance, the procedure definitions in the PostScript output file, or the PROTO's in the VRML 2.0 output file may very well change from one version to the next.


Not an API!

The MolScript software is not an API (Application Programming Interface). The internal features of the MolScript source code are not intended to be used as library routines in other software.

You may modify the MolScript software, or use parts of the code for your own programs. However, all such software is covered by the license agreement, and so cannot be distributed to others without express agreement with Avatar Software AB.

Note also that there is no guarantee that the organisation of the source code will be stable in future versions of MolScript. Any modifications you make will very likely break in future versions of MolScript.


Changes from previous versions


Version history


Top page