Although many tools for 3D visualization of small molecules and biopolymers have been released as desktop applications, relatively few programs are available for use in Web applications. GLmol is one such tool that takes advantage of fast in-browser 3D graphics capabilities now available through WebGL. This article introduces GLmol by discussing its main features, and provides fully-functional examples of deployment and scripting.
The GLmol download package contains a sample page illustrating the most important features:
- Load PDF files from a local directory or by URL
- View proteins using a variety of standard representations, including: thick ribbons; thin ribbons; strands; and cylinders/plates.
- Zoom, pan, translate, and slab
- Show additional information, including crystal packing, unit cell, and sidechains.
- A variety of coloring options.
- Screenshot capture
Deployment Demo: Embedding a Protein Structure
GLmol can read PDB files loaded via asynchronous HTTP calls. This use is illustrated in the protein embedding demo:
Note that same origin policies may prevent direct loading of files from sources other than the original host in some situations.
Scripting Demo: Spinning Molecule
WebGL is now supported on all modern browsers except Internet Explorer. Microsoft has so far not publicly indicated whether WebGL would be supported in IE 11.
Those wanting a more detailed look at how to use WebGL in the context of a molecule display element may find a recent tutorial helpful.
GLmol offers many possibilities for both interactive and scripted 3D molecule visualizations. Avoiding the Java Plugin and its accompanying complications, GLmol offers an attractive alternative to the popular Jmol applet. GLmol's liberal open source license (MIT or GPL3) makes it an appealing starting point for further development.