User:Eric Martz/Molecular Playground/Authoring: Difference between revisions

Eric Martz (talk | contribs)
→‎A Complex Animation: adding content
Eric Martz (talk | contribs)
x
 
(40 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| style="background:pink;"
This page has been moved to a permanent location, [[Molecular Playground/Authoring]].
| This page is under development. It is presently very incomplete!
|}
 
This page makes recommendations and offers shortcuts for authoring effective presentation modules for Molecular Playground (MP; see [http://molecularplayground.org MolecularPlayground.Org]).
 
==Components of a Module for MP==
 
Each module in MP will ideally include the following components:
<ol>
<li> A '''Jmol script''' that
  <ol type="a">
  <li>
Displays a '''molecule''', optionally with animations, labels, and color keys.
  </li>
  <li>
Displays a '''one-line text banner''' stating the name of the molecule and why it is important, plus a second line with the invitation "More at MolecularPlayground.Org".
  </li>
  </ol>
</li>
<li>
A '''web page''' that plays the above Jmol script, and also provides more information about the molecule for a general audience, with links to information in greater depth. The author of the module can choose to put the web page in Proteopedia, or elsewhere.
</li>
</ol>
For examples, see "The Molecules" web pages linked to [http://molecularplayground.org MolecularPlayground.Org].
 
==Jmol Scripting Options==
 
===A Single Molecular Scene, Spinning===
 
The '''simplest option''' is a '''single customized molecular scene''',  with the molecule '''spinning''' slowly. Such a scene, lacking complicated animations, can be created in Proteopedia -- without learning any Jmol scripting language. Proteopedia offers ''Molecular Scene-Authoring Tools'' that make this relatively easy. Details will be found below under [[#Procedure|Procedure]], but first, let's look at a concrete example.
 
<applet size='[450,338]' frame='true' align='right' scene='User:Eric_Martz/Molecular_Playground/Authoring/3ckz_relenza_tyr274/9' caption='Relenza binding to influenza neuraminidase N1 mutant H274Y (3ckz).' />
 
====Example====
At right is an example of a
customized molecular scene<ref>This scene shows the anti-influenza drug ''Relenza'' binding to mutant neuraminidase H274Y ([[3ckz]]). This mutant is resistant to ''Tamiflu''. For more information, see [[Avian_Influenza_Neuraminidase%2C_Tamiflu_and_Relenza#Resistance_to_Tamiflu_and_Relenza]].</ref> (<scene name='User:Eric_Martz/Molecular_Playground/Authoring/3ckz_relenza_tyr274/9'>restore initial scene</scene>), created with Proteopedia's ''Scene Authoring Tools''.
 
Now we'll use the MP support script (explained in the procedure linked below) to put a banner at the top of Jmol<ref name="button">The font sizes in the banner and color key will be proportionally larger when projected in MP, but they will not be larger in the ''Popup'' window in Proteopedia. Using the MP support script in Proteopedia requires that we upload our main script. Uploaded scripts can be played with buttons, as demonstrated above, but are not played with green links.</ref>.
<jmol>
<jmolButton>
<script>
script "/wiki/images/6/6c/MP_relenza01.spt"
</script>
<text>Add Banner</text>
</jmolButton>
</jmol>
([[:Image:MP_relenza01.spt|MP_relenza01.spt]])
 
Next, we'll use the MP support script (explained below) to add a color key<ref name="button" />.
<jmol>
<jmolButton>
<script>
script "/wiki/images/3/31/MP_relenza02.spt"
</script>
<text>Add Color Key</text>
</jmolButton>
</jmol>
([[:Image:MP_relenza02.spt|MP_relenza02.spt]])
 
Finally, we can jazz up the entrance with zooming <ref name="button" />.
<jmol>
<jmolButton>
<script>
script "/wiki/images/5/54/MP_relenza03.spt"
</script>
<text>Add Zooming Entrance</text>
</jmolButton>
</jmol>
([[:Image:MP_relenza03.spt|MP_relenza03.spt]])
 
====Procedure====
 
The step-by-step procedure for constructing scripts, similar to those exemplified above, will be found at [[Molecular Playground/Procedures#Installing a state script from Proteopedia]]. This procedure includes an explanation of how to use the MP Support scripts that will be required ([[Image:MPSceneVersion01.spt]] and [[Image:MPSupportVersion01.spt]]).
 
===A Complex Animation===
If your module will be more complex than can be produced by a single scene in Proteopedia, then you will need to write much of the script by hand. However, we still strongly recommend that you first do a module based upon a single Proteopedia scene. This will familiarize you with key points that will not be repeated below.
 
In creating a script for a complex animation, you don't have to start from scratch! You should start by downloading the script from whichever of these existing modules has the most in common with your plans:
* [[Molecular Playground/Tamiflu]] (a single molecular model)
* [[Molecular Playground/HIV Protease Inhibitor]] (a multiple-model animation)
 
You will find links for downloading the scripts on the above-linked pages. These scripts contain crucial sections for initialization (including calling the support script), defining useful variables, loading the molecule,  etc. They will show, by example, how to do the things displayed in these modules. You can change the module-specific parts of one of these scripts to customize it for your module. The first step is to change the local PDB file loaded from tamiflu.pdb or hivdrug.pdb to yourMolecule.pdb . It is a good idea to test the script after each change. That way, if something doesn't work, you'll know which change caused the problem.
 
Proteopedia contains a support script for Molecular Playground, [[Image:MPSupportVersion01.spt]]. The support script contains functions that make it easy to do commonly needed tasks, such as
* colorAllLightCPK: makes the default colors for carbon, nitrogen, and oxygen lighter, so they show up better when projected in a well-lighted room.
* showBannerAcrossTop() places a banner across the top of Jmol. It sets up a white background for the banner, and automatically adjusts the font size for projection vs. an applet on the web page.
* labelAtomWithPointer()
* zoomRotatableTo() zooms slowly (up or down), and permits the onlooker to rotate the molecule during zooming.
* growSpacefill() and growWireframe() make the selected atoms "grow" slowly into spacefilled or wireframe representations, permitting rotation by the onlooker during these transitions.
 
==Web Pages==
 
Your MP web page need not be in Proteopedia. You can put it on another server, and it can be linked to the name of your module at [[http://molecularplayground.org Molecular Playground]].
 
==Displays to Avoid==
The following displays cause spinning or rotation to become slow and jerky in the full-sized (1024 x 768 pixels) MP projection. Your displays will be more satisfying if these can be avoided. A good way to test this is to try your scripts in the Jmol application at 1024 x 768 pixels.
 
* '''Large numbers of spacefilled atoms''', such as spacefilling all atoms in a protein. The higher the zoom, the jerkier the spinning.
 
* '''Translucency'''.
 
* '''High-Quality Display''', namely ''set antialiasdisplay true''. The MPSupportVersion01.spt actually uses high-quality when the script is displayed in the applet, because at the typical applet size (450 x 350 pixels) the speed penalty is acceptable.
 
* '''Trace''' is slower than backbone. Thick traces are slower than thin traces. High zoom levels are even slower. You can get away with a thin trace at low zoom for a moderate-sized protein.
 
==Dimensions of Projected Jmol==
 
The UMass ISB<ref>[http://MolecularPlayground.Org MolecularPlayground.Org]</ref> projector projects a rectangle 1024 pixels wide by 768 pixels high. Zoom values, in particular, differ for square vs. rectangular Jmols. (Proteopedia uses a square Jmol by default, but a rectangular Jmol can be specified.) When you are running Jmol to develop and test a script, it should have the same width/height ratio, 1.333. The Jmol application displays the pixel size of the molecular display area at the bottom of its window. Molecular Playground pages in Proteopedia should also use rectangular Jmol's (size='[450,338]'). For convenience, here are some pixel dimensions with width/height = 1.333:
{| class="wikitable" border="1" style="margin: 1em auto 1em auto"
|-
! colspan="2"| Pixels for 1.333 width/height ratio
|-
|  align="center"|1024 x 768
|  align="center"|800 x 600
|-
|  align="center"|640 x 480
|  align="center"|600 x 450
|-
|  align="center"|450 x 338
|  align="center"|400 x 300
|}
 
 
==Notes and References==
<references />
 
[[Category: Molecular Playground]]