User:Karsten Theis/Molecular Playground
From Proteopedia
(New page: == Project name == Choose a project name, for example UvrB_1d9z. In the example, I combined the protein name with the PDB ID code of the coordinates I am showing. == First scene == The ea...) |
|||
Line 42: | Line 42: | ||
For the applet, the URLs are given in their complete form, so they should work on Proteopedia and on other platforms. Try opening up [https://chemapps.stolaf.edu/jmol/jsmol/simple.htm Jmol Simple], clicking on console, and pasting the code above to test. | For the applet, the URLs are given in their complete form, so they should work on Proteopedia and on other platforms. Try opening up [https://chemapps.stolaf.edu/jmol/jsmol/simple.htm Jmol Simple], clicking on console, and pasting the code above to test. | ||
+ | |||
+ | To test this in a molecular playground installation, you have to copy the *.pngj and the *.spt files into the assets folder, and ask the admin to add the project to one of the play lists. | ||
+ | |||
+ | To run it on Proteopedia, you upload the script, edit a page to make a rectangular window and add a Jmol link with the script in it: | ||
+ | |||
+ | <nowiki> | ||
+ | <Structure load='' size='[800,600]' frame='true' align='right' caption='' scene='' /> | ||
+ | <jmol> | ||
+ | <jmolLink> | ||
+ | <script> script /wiki/images/f/f6/Uvrb_1d9z.pngj</script> | ||
+ | <text>UvrB, a helicase adapted for DNA repair</text> | ||
+ | </jmolLink> | ||
+ | </jmol> | ||
+ | </nowiki> | ||
+ | |||
+ | You can find a working example [https://proteopedia.org/wiki/index.php/User:Karsten_Theis/Sandbox_2 here]. | ||
+ | |||
+ | |||
+ | == Summary == | ||
+ | |||
+ | Here are the steps without using Proteopedia: | ||
+ | 1) Create an initial scene as PNGJ file | ||
+ | 2) Create a script loading the initial scene (plus other commands, if desired) | ||
+ | 3) Give both files to the Molecular Playground administrator | ||
+ | |||
+ | Here are the steps with Proteopedia: | ||
+ | 1) Create an initial scene as PNGJ file, upload to Proteopedia and copy the URL | ||
+ | 2) Create a script loading the initial scene using the URL, upload to Proteopedia and copy the URL | ||
+ | 3) Call the script in a jmolLink on a page with a rectangular Jmol window |
Revision as of 15:29, 3 May 2025
Contents |
Project name
Choose a project name, for example UvrB_1d9z. In the example, I combined the protein name with the PDB ID code of the coordinates I am showing.
First scene
The easiest way to get started is with an existing Jmol scene (from Proteopedia, First Glance or from other sources - just make sure you have the rights to it). In the Jmol window, right-click somewhere on the top, and choose "console" from the menu. Then, type "write project_name.pngj" and save the file. This contains the coordinates and the drawing commands.
Then, start on your script file, named "project_name.spt". It could be as simple as:
load UvrB_1d9z.pngj spin on
This assumes that your "UvrB_1d9z.pngj" file is in the same folder as the script file, "UvrB_1d9z.spt", which is how the molecular playground is set up.
Banner
There is space for limited text at the top of the display, called the banner. We will add one command to set the banner to "DNA repair protein UvrB":
load UvrB_1d9z.pngj message driver:DNA repair protein UvrB spin on
When running in the molecular playground, the banner is also used to give feedback when the viewers hands are detected for rotation and zoom. This minimal file is ready for the molecular playground, but we will expand it a bit for testing.
Testing online or offline
With a little bit of extra work, we can write a script that you can test online on share (by posting on Proteopedia, for example), or run locally. You will see the line "if (_applet)" below, which checks if Jmol is running in an applet (i.e. is online). Here is the updated script:
if (_applet) { script https://proteopedia.org/wiki/images/6/65/Molecular_playground_helpers.spt load https://proteopedia.org/wiki/images/f/f6/Uvrb_1d9z.pngj } else { script Molecular_playground_helpers.spt load UvrB_1d9z.pngj } banner("DNA repair protein UvrB") spin on
For the applet, the URLs are given in their complete form, so they should work on Proteopedia and on other platforms. Try opening up Jmol Simple, clicking on console, and pasting the code above to test.
To test this in a molecular playground installation, you have to copy the *.pngj and the *.spt files into the assets folder, and ask the admin to add the project to one of the play lists.
To run it on Proteopedia, you upload the script, edit a page to make a rectangular window and add a Jmol link with the script in it:
<Structure load='' size='[800,600]' frame='true' align='right' caption='' scene='' /> <jmol> <jmolLink> <script> script /wiki/images/f/f6/Uvrb_1d9z.pngj</script> <text>UvrB, a helicase adapted for DNA repair</text> </jmolLink> </jmol>
You can find a working example here.
Summary
Here are the steps without using Proteopedia: 1) Create an initial scene as PNGJ file 2) Create a script loading the initial scene (plus other commands, if desired) 3) Give both files to the Molecular Playground administrator
Here are the steps with Proteopedia: 1) Create an initial scene as PNGJ file, upload to Proteopedia and copy the URL 2) Create a script loading the initial scene using the URL, upload to Proteopedia and copy the URL 3) Call the script in a jmolLink on a page with a rectangular Jmol window