Molecular surface calculation and visualization with Javascript and WebGL


Surface representation is a convenient way to visualize protein-protein and protein-ligand interactions. However, surface calculation of macromolecules is computationally and memory intensive. Furthermore, calculated mesh is very complex, often exceeding 500000 polygons. Therefore its implementation in Javascript/WebGL was considered to be very difficult.

However, I found that EDTSurf algorithm published by Dong Xu and Yang Zhang in 2009 is very efficient and runs with practical speed even after I ported it to Javascript. I integrated it with GLmol, my WebGL-based molecular viewer, and release it here.


You can calculate molecular surface, solvent excluded surface, solvent accessible surface or van der Waals surface of macromolecules.

Example: Solvent excluded surface of horse deoxyhaemoglobin (PDBID: 2DHB)

Computation time and Memory usage

In modern computers with Intel Core i5/i7 processor, grid size up to 180x180x180 can be calculated in acceptable time (5-10sec). Although Firefox 8 was about 3 times slower than Chrome, with Firefox 9, the difference is getting smaller.

Current problem is its memory usage. It uses about 500MB RAM for computation. The original version written in C++ doesn't use so much memory. Now I am working to reduce memory usage in my Javascript version.

System requirements

Basically, if GLmol runs on your PC, this demo should work. For better performance, I recommend Google Chrome with sufficient memory (>1GB for browser).


You can try alpha version from the following link. Please note that this is ALPHA version and there remains many issues.

WARNING! This program consumes lots of memory (500-700MB). Your browser and computer might GET VERY SLOW and EVEN CRASH if memory is insufficient!

Demo version
To limit CPU & memory usage, calculation grid size is restricted to 180x180x180. Therefore, if you calculate a large surface, output quality will be compromised.


EDTSurf: Quick and accurate construction of macromolecular surfaces
D. Xu, Y. Zhang (2009) Generating Triangulated Macromolecular Surfaces by Euclidean Distance Transform. PLoS ONE 4(12): e8140.

Surface calculation code is ported from their original implementation, which is released under the following license.

Permission to use, copy, modify, and distribute this program for any purpose, with or without fee, is hereby granted, provided that this copyright notice and the reference information appear in all copies or substantial portions of the Software. It is provided "as is" without express or implied warranty.


Comments and suggestions are welcome. Please mail to biochem_fan at or write in the forum.