Difference between revisions of "JSmol pros and cons"

From Jmol
Jump to navigation Jump to search
(styling the table)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span style="color:red; font-size:150%">This page is under construction</span>
+
<span style="font-size:130%;">This page could also be titled '''Things To Be Aware Of When Deciding between JSmol/Java and JSmol/HTML5 (no Java)'''.</span>
  
 +
For other pages about JSmol, please see [[JSmol]].
  
<span style="font-size:150%;">This page could also be titled '''Things To Be Aware Of Before Converting From Jmol (Java) To JSmol'''.</span>
+
JSmol allows development of a page that can use Java or just HTML5 (no Java), can use WebGL or not when using HTML5, and can also load molecules using [[Lightweight JSmol]], a very small (50K) footprint (mostly nonscriptable) non-Jmol viewer option. When developing a page using JSmol, you need to decide which of these options you want. You specify that through [[Jmol_JavaScript_Object/Info#Modality|the '''Info.use''' parameter]] that is passed to the JavaScript library that sets up your page.
  
==Advantages of JSmol==
+
==Advantages of Selecting use:HTML5 (no Java)==
  
Of course there are huge advantages to using JSmol:
+
Advantages to using HTML5 (no Java) include:
*Users of a JSmol website do not need to install [http://proteopedia.org/w/Java Java] (which is a [http://proteopedia.org/w/Java#Java_is_a_security_threat likely security risk]).
+
*Users of a website that does not use Java do not need to install Java.
*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.)
+
*A website using HTML5 will work on iPads and smart phones. (Java is not available for these platforms, so Java is not an option for them.)
 +
*A website using HTML5 will work on the Chrome browser (Java applets are no longer supported in Chrome, even in computers.)
  
==Disadvantages of JSmol==
+
==Disadvantages of Selecting use:HTML5 (no Java)==
  
===JSmol is slower than Jmol===
+
===JavaScript is slower than Java by a factor of 6-10===
  
<table width="300" cellpadding="4" style="background:#e0e0e0" align="right" hspace="10">
+
<table class="wikitable" style="width:300px; background:#e0e0e0; float:right; margin-left:1ex;">
<tr><td colspan=3>
+
<caption>Macromolecules of Various Sizes</caption>
<center>Molecules of Various Sizes</center>
 
</td></tr>
 
 
<tr>
 
<tr>
 
<td>
 
<td>
[[PDB code]]
+
[http://proteopedia.org/w/PDB_code PDB code]
 
</td><td>
 
</td><td>
 
Atoms (Kilo)
 
Atoms (Kilo)
 
</td><td>
 
</td><td>
KD ([[Asymmetric Unit]])
+
kDa ([http://proteopedia.org/w/Asymmetric_Unit Asymmetric Unit])
 
</td>
 
</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>
 
<td>
[[1d66]]
+
[http://firstglance.jmol.org/fg.htm?mol=1d66 1d66]
 
</td><td>
 
</td><td>
 
1.7
 
1.7
Line 38: Line 38:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[2bvw]]
+
[http://firstglance.jmol.org/fg.htm?mol=2bvw 2bvw]
 
</td><td>
 
</td><td>
 
6
 
6
Line 47: Line 47:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[2cvo]]
+
[http://firstglance.jmol.org/fg.htm?mol=2cvo 2cvo]
 
</td><td>
 
</td><td>
 
12
 
12
Line 56: Line 56:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[7ahl]]
+
[http://firstglance.jmol.org/fg.htm?mol=7ahl 7ahl]
 
</td><td>
 
</td><td>
 
23
 
23
Line 65: Line 65:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[1g3i]]
+
[http://firstglance.jmol.org/fg.htm?mol=1g3i 1g3i]
 
</td><td>
 
</td><td>
 
45
 
45
Line 74: Line 74:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[3j36]]
+
[http://firstglance.jmol.org/fg.htm?mol=3j36 3j36]
 
</td><td>
 
</td><td>
 
60
 
60
Line 83: Line 83:
 
<tr>
 
<tr>
 
<td>
 
<td>
[[2bbn]]
+
[http://firstglance.jmol.org/fg.htm?mol=2bbn 2bbn]
 
</td><td>
 
</td><td>
 
57 (2.7K x 21 NMR models. Includes hydrogen.)
 
57 (2.7K x 21 NMR models. Includes hydrogen.)
Line 91: Line 91:
 
</tr>
 
</tr>
 
<tr><td colspan="3">
 
<tr><td colspan="3">
Models with &gt;10,000 atoms are in the largest ~10% of the [[PDB]]; with &gt;20,000 atoms, the largest ~5%; with &gt;50,000 atoms, the largest ~1.5% (counting all models for NMR ensembles).
+
Models with &gt;10,000 atoms are in the largest ~10% of the [http://proteopedia.org/w/PDB PDB]; with &gt;20,000 atoms, the largest ~5%; with &gt;50,000 atoms, the largest ~1.5% (counting all models for NMR ensembles).
 
</td>
 
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
  
JSmol is significantly '''slower''' than Jmol. Rotation will be jerkier. Smaller molecules (<10,000 atoms) are handled quite well. '''Large molecules''' (>20,000 atoms; see table at right) may be slow to load and process. (FirstGlance, when using JSmol, sometimes freezes for up to a minute, even more. These delays tend to happen with large molecules but are not simply related to model size.) Multiple-model ensembles (such as from [[NMR]] experiments) may cause JSmol to freeze while taking minutes to load the ensemble, or loading may never finish.
+
HTML5 is significantly '''slower''' than Java. For large systems it is strongly advised to use the [[PlatformSpeed|'''set platformSpeed''']] setting (or allow the user to set that). Smaller molecules (<10,000 atoms) are handled quite well. '''Large molecules''' (>20,000 atoms; see table at right) may be slow to load and process. (FirstGlance, when using HTML5, sometimes freezes for up to a minute, even more. These delays tend to happen with large molecules but are not simply related to model size.) Multiple-model ensembles (such as from [http://proteopedia.org/w/NMR NMR] experiments) may cause the page to freeze while taking minutes to load the ensemble, or loading may never finish.
  
Here is how two websites that now use JSmol by default have handled these issues:
+
Here is how two websites that now use no-Java-JSmol by default have handled these issues:
  
*[[FirstGlance in Jmol]] loads only the first model when there are more than one (in JSmol). It offers signed Jmol_S (Java) as an option (and a preference setting). The unsigned Jmol applet is no longer offered because it is [http://en.wikipedia.org/wiki/Deprecated deprecated] and Oracle says that eventually it won't be allowed. FirstGlance recommends using Java when the molecule has >20,000 atoms, and even more strongly recommends it when >50,000 atoms.  
+
*[http://firstglance.jmol.org FirstGlance in Jmol], when using HTML5 (no Java, its default), loads only the first model when there are more than one. It offers using the signed Java applet as an option and a preference setting. When using FirstGlance it is recommended that one select Java when the molecule has >20,000 atoms, and especially when there are >50,000 atoms.  
  
*Proteopedia loads only amino acid alpha carbon atoms (or nucleic acid phosphorus atoms) and ligand atoms, since its ribbon view (secondary structure schematic) works fine without the other atoms. A prominent message is displayed that a ''simplified model'' is being shown, and there is a button to load the complete model. For registered users who are logged in, Proteopedia has a preference setting that will use Jmol_S instead of JSmol.
+
*[http://proteopedia.org Proteopedia] loads only amino acid alpha carbon atoms (or nucleic acid phosphorus atoms) and ligand atoms, since its ribbon view (secondary structure schematic) works fine without the other atoms. A prominent message is displayed that a ''simplified model'' is being shown, and there is a button to load the complete model. For registered users who are logged in, Proteopedia has a preference setting that will use Java instead of HTML5.
  
 
===Poor performance in Internet Explorer and Opera===
 
===Poor performance in Internet Explorer and Opera===
  
JSmol runs in the javascript of the browser (HTML5). Different web browsers operate JSmol with very different performances. '''Chrome runs JSmol best''', Safari is good, and Firefox is usually OK (see note under table below). '''Internet Explorer is unacceptably slow''' (all versions, including version 11), and [http://www.netmarketshare.com it is the most widely used browser]. In '''Opera, rotation of the molecule is slow and jerky'''.  
+
Different web browsers have JavaScript engines with different performances. '''Chrome runs HTML5 best''', Safari is good, and Firefox is usually OK (see note under table below). '''Internet Explorer is unacceptably slow''' (all versions, including version 11). In '''Opera, rotation of the molecule is slow and jerky''' when [[PlatformSpeed|setPlatformSpeed]] is not utilized.  
  
*FirstGlance in Jmol detects the browser being used, and recommends a different browser when being displayed in Internet Explorer or Opera.
+
*[http://firstglance.jmol.org FirstGlance in Jmol] detects the browser being used, and recommends a different browser when being displayed in Internet Explorer or Opera.
  
The findings below are based primarily on tests with [[FirstGlance in Jmol]], and possibly results may be different for other JSmol websites.
+
The findings below are based primarily on tests with [http://firstglance.jmol.org FirstGlance in Jmol] in its default HTML5 modality, not using [[PlatformSpeed|'''set platformSpeed''']].  Results may be different for other JSmol websites.
  
 
[[Image:Jsmol-vs-browsers.png|center]]
 
[[Image:Jsmol-vs-browsers.png|center]]
The above snapshot is taken from [[FirstGlance in Jmol]]. For more details, see the section ''Browser Pecularities'' in the [http://bioinformatics.org/firstglance/fgij/notes.htm Notes for FirstGlance].
+
The above snapshot is taken from [http://firstglance.jmol.org FirstGlance.Jmol.Org]. For more details, see the section ''Browser Pecularities'' in the [http://bioinformatics.org/firstglance/fgij/notes.htm Notes for FirstGlance].
 +
 
 +
----
 +
For other articles about JSmol, please see [[JSmol]].

Latest revision as of 00:05, 21 November 2015

This page could also be titled Things To Be Aware Of When Deciding between JSmol/Java and JSmol/HTML5 (no Java).

For other pages about JSmol, please see JSmol.

JSmol allows development of a page that can use Java or just HTML5 (no Java), can use WebGL or not when using HTML5, and can also load molecules using Lightweight JSmol, a very small (50K) footprint (mostly nonscriptable) non-Jmol viewer option. When developing a page using JSmol, you need to decide which of these options you want. You specify that through the Info.use parameter that is passed to the JavaScript library that sets up your page.

Advantages of Selecting use:HTML5 (no Java)

Advantages to using HTML5 (no Java) include:

  • Users of a website that does not use Java do not need to install Java.
  • A website using HTML5 will work on iPads and smart phones. (Java is not available for these platforms, so Java is not an option for them.)
  • A website using HTML5 will work on the Chrome browser (Java applets are no longer supported in Chrome, even in computers.)

Disadvantages of Selecting use:HTML5 (no Java)

JavaScript is slower than Java by a factor of 6-10

Macromolecules of Various Sizes

PDB code

Atoms (Kilo)

kDa (Asymmetric Unit)

1d66

1.7

28

2bvw

6

87

2cvo

12

160

7ahl

23

233

1g3i

45

826

3j36

60

900

2bbn

57 (2.7K x 21 NMR models. Includes hydrogen.)

416 (20K x 20 NMR models)

Models with >10,000 atoms are in the largest ~10% of the PDB; with >20,000 atoms, the largest ~5%; with >50,000 atoms, the largest ~1.5% (counting all models for NMR ensembles).

HTML5 is significantly slower than Java. For large systems it is strongly advised to use the set platformSpeed setting (or allow the user to set that). Smaller molecules (<10,000 atoms) are handled quite well. Large molecules (>20,000 atoms; see table at right) may be slow to load and process. (FirstGlance, when using HTML5, sometimes freezes for up to a minute, even more. These delays tend to happen with large molecules but are not simply related to model size.) Multiple-model ensembles (such as from NMR experiments) may cause the page to freeze while taking minutes to load the ensemble, or loading may never finish.

Here is how two websites that now use no-Java-JSmol by default have handled these issues:

  • FirstGlance in Jmol, when using HTML5 (no Java, its default), loads only the first model when there are more than one. It offers using the signed Java applet as an option and a preference setting. When using FirstGlance it is recommended that one select Java when the molecule has >20,000 atoms, and especially when there are >50,000 atoms.
  • Proteopedia loads only amino acid alpha carbon atoms (or nucleic acid phosphorus atoms) and ligand atoms, since its ribbon view (secondary structure schematic) works fine without the other atoms. A prominent message is displayed that a simplified model is being shown, and there is a button to load the complete model. For registered users who are logged in, Proteopedia has a preference setting that will use Java instead of HTML5.

Poor performance in Internet Explorer and Opera

Different web browsers have JavaScript engines with different performances. Chrome runs HTML5 best, Safari is good, and Firefox is usually OK (see note under table below). Internet Explorer is unacceptably slow (all versions, including version 11). In Opera, rotation of the molecule is slow and jerky when setPlatformSpeed is not utilized.

  • FirstGlance in Jmol detects the browser being used, and recommends a different browser when being displayed in Internet Explorer or Opera.

The findings below are based primarily on tests with FirstGlance in Jmol in its default HTML5 modality, not using set platformSpeed. Results may be different for other JSmol websites.

Jsmol-vs-browsers.png

The above snapshot is taken from FirstGlance.Jmol.Org. For more details, see the section Browser Pecularities in the Notes for FirstGlance.


For other articles about JSmol, please see JSmol.