Molecular Playground/Authoring: Difference between revisions
Eric Martz (talk | contribs) |
Eric Martz (talk | contribs) |
||
Line 125: | Line 125: | ||
The step-by-step procedure for constructing Level II scripts, similar to those exemplified above, will be found at [[Molecular Playground/Procedures]]. These procedures explain how to use the MP Support scripts that will be required ([[Image:MPSceneVersion01.spt]] and [[Image:MPSupportVersion01.spt]]). | The step-by-step procedure for constructing Level II scripts, similar to those exemplified above, will be found at [[Molecular Playground/Procedures]]. These procedures explain how to use the MP Support scripts that will be required ([[Image:MPSceneVersion01.spt]] and [[Image:MPSupportVersion01.spt]]). | ||
After preparing the script files, you can finish your web page, following the instructions below: [[#Web Page Procedure in Proteopedia]]. | |||
===Level III: A Complex Animation=== | ===Level III: A Complex Animation=== |
Revision as of 03:48, 16 March 2010
This page makes recommendations and offers shortcuts for authoring effective presentation modules for Molecular Playground (MP; see MolecularPlayground.Org).
Components of a Module for MPComponents of a Module for MP
Each module in MP will ideally include the following components:
- A Jmol script that
- Displays a molecule, optionally with animations, labels, and color keys.
- 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".
- 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.
For examples, see "The Molecules" web pages linked to MolecularPlayground.Org.
Designing An Effective ModuleDesigning An Effective Module
Use light colors on a black backgroundUse light colors on a black background
Because MP projects in a well-lit atrium, generally a black background (which will appear medium gray) works best. Dark colors are hard to see on the black background, so use light colors as much as possible. In particular, Jmol's default CPK colors for carbon, oxygen and nitrogen are marginally visible. Therefore the support script provided for MP includes a function colorAllLightCPK that applies lighter colors to these elements. See the example below demonstrating the difference.
Facilitate rotation by onlookersFacilitate rotation by onlookers
MP invites onlookers to interact by rotating the structure at any time. Therefore, scripts should be designed to permit rotation as much of the time as possible. Furthermore, it may be desirable for the user-set orientation to remain while the script proceeds, perhaps all the way to the end of the script. For example, a moveto command precludes rotation until the specified orientation is completed. In the version of Jmol currently used in Proteopedia (11.8.9 in December, 2009), zoomto commands also enforce the current orientation, "fighting" with the onlooker who attempts rotation during the timed zoomto. Therefore, the support script provided for MP includes a function zoomRotatableTo() that performs the zoom while permitting rotation.
Avoid displays that seriously slow JmolAvoid displays that seriously slow Jmol
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.
Test your script at 1024 x 768 pixelsTest your script at 1024 x 768 pixels
The UMass ISB[1] projector projects a rectangle 1024 pixels wide by 768 pixels high. When testing your scripts, it is best to size the Jmol application window close to 1024 x 768 pixels. (The pixel dimensions are shown at the bottom of the Jmol application window.) Speed and jerkiness of rotation are affected by the window size. Also, zoom values differ for square vs. rectangular Jmols. (The support script provided for MP specifies set zoomLarge off, which makes 100% zoom show the entire molecule within the smaller dimension of Jmol.)
Molecular Playground pages in Proteopedia should also use rectangular Jmols, rather than the default square ones. A good size is 450 x 338 (which has the same width/height ratio of 1.333 as does 1024 x 768). This can be specified in the applet tag in the wikitext editing box with size='[450,338]'. To see exactly how to do this, try editing the section below that contains a Jmol, which has this recommended size.
Jmol Scripting OptionsJmol Scripting Options
Three LevelsThree Levels
Three levels of scripting are available for creating modules for MP. Each is described below, and examples are shown.
Level I: A single script fileLevel I: A single script file
This is the quickest and easiest way to prepare a module for MP. It will be a single customized molecular scene, spinning, without any transitions or animation. It may include labels on specific atoms, but will lack a color key. If you later decide that you want to add a color key, it is straightforward to reconfigure your Level I script into a Level II module. An example of how a Level I module will look when projected in MP is seen below when you press the Add Banner button in the next section.
An MP module at Level I consists of two files plus two pieces of information that will be submitted to the MP team. The first three below are required in your initial submission.
- A single file of Jmol script commands that specifies a single molecular scene.
- A PDB file that provides the molecular model displayed by the script.
- A banner title, which should be of length 65 characters or less.
- The URL of your "more information" web page. If your web page is not yet ready, this can be submitted later.
There are two ways to prepare the script file.
- In Proteopedia, using its Molecular Scene Authoring Tool. You don't need to be familiar with Jmol command scripting language. You save the "state script" from Jmol in Proteopedia. Instructions are provided both for making the script file, and for using it in a web page in Proteopedia.
- By hand. This requires familiarity with the Jmol Command Scripting Language. No instructions are provided here for this method, either for constructing the script file, or for making a supporting web page.
Level II: A Single Molecular Scene With A Color KeyLevel II: A Single Molecular Scene With A Color Key
This method is a bit more complicated than Level I. The only advantages are that adding a color key is easy, and have a "zooming in entrance" is easy. Let's look at a concrete example.
|
ExampleExample
At right is an example of a customized molecular scene[2] (), 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[3]. Notice also that the chemical element colors for carbon, oxygen, and nitrogen (CPK colors) are now lighter, as recommended above.
*
(MP_relenza01.spt)
- This is also how a Level I module would look.
Next, we'll use the MP support script (explained below) to add a color key[3]. (MP_relenza02.spt) Please remember that the Molecular Playground desires a balance between science and "art." Too much annotation detracts from the attraction of the playground.
Finally, we can jazz up the entrance with zooming [3]. (MP_relenza03.spt)
A module at Level II consists of:
- A master (top level) Jmol script file.
- A Jmol state script file that produces the customized molecular scene.
- A PDB file that provides the molecular model displayed by the scripts.
- The URL of your "more information" web page. If your web page is not yet ready, this can be submitted later.
In a Level II module, the banner text is built into the master script file. The script files use support scripts that are already available in MP, and are common to all modules.
ProcedureProcedure
The step-by-step procedure for constructing Level II scripts, similar to those exemplified above, will be found at Molecular Playground/Procedures. These procedures explain how to use the MP Support scripts that will be required (File:MPSceneVersion01.spt and File:MPSupportVersion01.spt).
After preparing the script files, you can finish your web page, following the instructions below: #Web Page Procedure in Proteopedia.
Level III: A Complex AnimationLevel III: 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 Level II module. 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, File: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.
If you need a transition or function that is not included, don't hesitate to ask for help in adding it. Please contact .
Web PagesWeb Pages
MP offers more information about the molecule displayed in each module by going to MolecularPlayground.Org. The web page providing that information should be brief, should emphasize the impact or importance of the structure displayed, and should be designed for a general audience of non-scientists. Links to articles in greater depth (possibly within Proteopedia, or at Wikipedia) can be provided for those who want more.
Examples:
- Molecular Playground/Relenza -- a simple scene (the one above).
- Molecular Playground/HIV Protease Inhibitor -- a complex animation.
- Molecular Playground/Tamiflu -- a complex animation.
Advantages of using ProteopediaAdvantages of using Proteopedia
Creating the web page in Proteopedia has numerous advantages.
- Creation and later editing of the page, using the wikitext mechanism, are quite easy, requiring no specialized knowledge of HTML.
- Other visitors to Proteopedia may improve the web page in a collaborative effort. Alternatively, should you prefer, you can protect your page from editing by anyone but yourself. It is also possible to hide the page from others while you are developing it, using Proteopedia's Workbench mechanism.
- Installing Jmol on your page is very easy, requiring no specialized knowledge of the Jmol applet.
- You may show the exact scene or animation, as projected at MP, in Jmol on the web page in Proteopedia.
- You do not need to provide a web server. Proteopedia's web server makes your page available to the world immediately, with no additional effort, free of charge.
- Detailed instructions are provided (below).
Your MP web page need not be in Proteopedia. You can put it on another server if you prefer. If you use a server other than Proteopedia, the procedures here do not apply, and you will need to know how to build HTML pages and how to use Jmol.
Web Page Procedure in ProteopediaWeb Page Procedure in Proteopedia
-
Identify the page in Proteopedia where you will develop your article to provide more information as a supplement to your module in MP.
There are three options:
- A protected page that only you can edit. This can be the temporary or permanent location of your web page. See Help:Protected Pages. We recommend that you develop your web page in a temporary page that you create named User:Your Name/Sandbox 1 (or 2 or higher if you already have a Sandbox 1 -- see Sandboxes). When your page is finished, you can move the content to a new permanent page named Molecular Playground/Your Molecule (see item (c) below).
- A page that only you can view. If you are uncomfortable about others seeing your page while you are developing it, you could use this option. Note that Proteopedia administrators can see such pages. For instructions, see Proteopedia:Workbench.
- A permanent page. Such a page should be titled "Molecular Playground/Your Molecule" (where "Your Molecule" is replaced by the name of your molecule). This will distinguish it from a page titled simply "Your Molecule", which would be intended to treat the subject in more depth for an audience of scientists. Content developed on a protected page or a workbench page could be moved to such a permanent page when it is finished. For instructions, see Help:Editing#How_To_Create_A_New_Page.
- Write the text for your page, dividing it into logical sections. See the example pages linked above. On the example pages, use the edit this page tab to see how the wikitext is done, then Cancel editing (so that you don't change the example pages).
-
Copy the applet tag below and paste it into your page where you want Jmol to appear. This makes a rectangular Jmol with the correct shape for MP.
<applet size='[450,338]' frame='true' align='right' scene='XXX' caption='YYY' />
Make sure there are no spaces before any of the lines you pasted in.
- Replace 'XXX' with the name of your scene: Edit the page where you developed the scene, and show the Scene Authoring Tool. Load the scene. In the Wikitext box (at the bottom) copy the quoted name (without "name=" and without the quotes), and paste that to replace XXX. Make sure the scene name has one single quote mark at each end. Save your page. Your scene should appear automatically shortly after the page loads.
- Replace 'YYY' with a descriptive caption for your scene. This is a good place to mention the PDB code for the model you are showing. Put the lower case PDB code between double square brackets, like this [[3ckz]], which will make a link like this: 3ckz.
- This step applies only to Level II modules, and even for those, it is optional: Insert a button that will show the scene as projected in MP. See Molecular Playground/Procedures#Displaying a Level II Scene in a Proteopedia Web Page.
- Insert {{Template:MP_masthead}} at the top of your page to show the MP masthead photographs. Depending on what follows, you may need to put several blank lines after it to force the Contents table down, as done in Molecular_Playground/HIV_Protease_Inhibitor. Or you may need to insert {{Clear}} as done in Molecular Playground/Tamiflu.
- At the very bottom of your page, paste in [[Category: Molecular Playground]]. This adds your page to that Category, which lists all such pages.
- Just above the previous item, paste in {{Template:Molecular Playground animation description}}.
- Search for related pages in Proteopedia, Wikipedia, and the scientific literature and provide links to them.
- Optional: Near the bottom of your page, include a Methods section, patterned after those on the example pages, with links to all the scripts and PDB files employed on your page.
- Notify the MP team (see email addresses at MolecularPlayground.Org) asking them to link your page.
Notes and ReferencesNotes and References
- ↑ MolecularPlayground.Org
- ↑ 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,_Tamiflu_and_Relenza#Resistance_to_Tamiflu_and_Relenza.