User:Eric Martz/JSmol Notes
From Proteopedia
Contents |
Browser Performance with JSmol
Different web browsers operate JSmol with very different performances. The findings below are based primarily on tests with FirstGlance in Jmol, and possibly results may be different for other JSmol websites.
Overview
The above snapshot is taken from the help in FirstGlance in Jmol: display any molecule in FirstGlance, then click on Trouble? (bottom of upper left panel) or Can't see the molecule? (bottom of right panel). The help appears in the lower left panel, and you will have to scroll down to see the above overview table.
Details
For more details, see the section Browser Pecularities in the Notes for FirstGlance.
Converting Websites from Jmol to JSmol
Things To Be Aware Of Before Converting To JSmol
Advantages
Of course there are huge advantages to using JSmol:
- Users of a JSmol website do not need to install Java (which is a likely security risk).
- A JSmol website will likely work on iPads and smart phones. (Java is not available for these platforms, so Jmol is not an option for them.)
Disadvantages
Speed
JSmol is significantly slower than Jmol. Rotation will be jerkier. Large molecules (>20,000 atoms) may be slow to load and process. (Sometimes I’ve seen delays of up to a minute, even more, during which JSmol freezes. These delays tend to happen with large molecules but are not simply related to size.) Multiple-model ensembles (such as from NMR experiments) may cause JSmol to freeze, and take minutes to load, or never complete loading. Here is how two websites have handled these issues:
- FirstGlance in Jmol loads only the first model when there are more than one. It offers Jmol (Java) as an option (with a preference setting), and recommends using Java when the molecule has >10,000 atoms.
JSmol runs in the javascript of the browser (HTML5). Internet Explorer has unacceptably slow javascript (all versions, including version 11). Of course it is the most widely used browser (
1. Download Jmol. The download package includes both JSmol and the Jmol Java applet. Go to Jmol.Org, click Downloads.
2. Unzip the downloaded Jmol file. After unzipping, inside the main folder is jsmol.zip. Unzip that too.
3. Copy the jsmol folder (the one you unzipped in step 2) into the resource that you are upgrading. (You don’t need to copy any of the other files in the main folder.)
The following steps apply to the main html file of your resource:
4. Javascript files in the <header> section of the main html file. If the old page used Jmol.js, there will be a line like this that can be removed or commented out:
<!— COMMENT OUT THIS LINE <script src="jmol/Jmol.js"></script>
-->
Add these two lines. Jmol2.js replaces Jmol.js, defining the same functions you were already using in Jmol.js.
<script type="text/javascript" src="jsmol/JSmol.min.js"></script> <script type="text/javascript" src="jsmol/js/Jmol2.js"></script>
Other Conversion Advice
- Converting pages from Jmol to JSmol in the Jmol Wiki. This writeup is too technical for me to understand.