Availability and implementation: 3Dmol.js is distributed under the permissive BSD open source license. Source code and documentation can be found at http://3Dmol.csb.pitt.edu
Molecular visualization is an essential tool for computational chemists and biologists. Due to the demanding nature of three-dimensional (3D) graphics, most molecular viewers are desktop applications. The need to install specialized applications and, in some cases, the restrictive nature of the software licenses, introduces hurdles to the sharing of molecular data. Unlike a desktop application, a standards-based client-side web application comes pre-installed with every computer and mobile device with a modern web browser and can be seamlessly integrated into online environments for accessing and analyzing molecular data.
An alternative to the software-based rendering of Jmol/JSmol is to use hardware-accelerated graphics, as is done with desktop applications. This is enabled by the recently adopted WebGL 1.0 standard, which is now supported natively by all major desktop and mobile browsers. PV (http://biasmv.github.io/pv) and GLmol (http://webglmol.sourceforge.jp) are two examples of WebGL-based molecular viewers. GLmol was the first WebGL viewer and uses the Three.js (http://threejs.org) framework for interfacing with WebGL. However, GLmol lacks a full featured API and the use of the Three.js library results in performance inefficiencies. We forked GLmol and radically reworked its architecture to overcome these deficiencies and create 3Dmol.js. PV, like 3Dmol.js, uses WebGL directly, but has a focus on displaying protein structures and does not provide the same set of features as 3Dmol.js.
2.2 Embeddable viewer
2.3 Hosted viewer
End users may use 3Dmol.js through a hosted viewer as shown in Figure 1d. In this case, the molecular data is set and styled through a URL specification. Data may be retrieved from a remote URL, such as a publicly accessible shared folder on cloud storage. This allows users to easily share complex scenes without requiring that the recipients have any software other than a modern web browser.
3 Performance comparison
The initial creation time for a scene can be more time consuming in 3Dmol.js compared to a software-rendering approach like Jmol. The scene needs to be decomposed into a mesh of triangles since this is what is expected by the graphics subsystem. However, once a 3D scene is created, interactions with the scene that do not change its fundamental geometry, such as rotating, translating and zooming, are extremely fast (a few milliseconds) since the 3D scene data are managed by the native graphics subsystem. Consequently, even complex scenes can be smoothly manipulated by the user.
We are grateful to Takanori Nakane for creating GLmol. We would also like to thank Caleb Martin for his contributions.
This work was supported by the National Institute of Health [R01GM108340]. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.
Conflict of Interest: none declared.