Help:Jmol in EcoliWiki: Difference between revisions

From EcoliWiki
Jump to navigation Jump to search
 
(48 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Jmol is a Java-based molecular visualization tool.  Extensive documentation can be found on the [http://jmol.org Jmol website].  This page describes how you can embed images and set scenes inside EcoliWiki using [http://wiki.jmol.org:81/index.php/MediaWiki Jmol's MediaWiki extension].
==About==
Jmol is a Java-based molecular visualization tool.  Extensive documentation can be found on the [http://jmol.org Jmol website].  This page describes how you can embed images and set scenes inside EcoliWiki using [http://wiki.jmol.org:81/index.php/MediaWiki Jmol's MediaWiki extension] and custom EcoliWiki templates.


Working with Jmol in EcoliWiki is a bit of an advanced topic, so it may be useful to familiarize yourself with Mediawiki markup conventions.  See [[:Category:Help]]
==What Types of Structures Can I Display?==
== Embedding Jmol by transclusion ==
The structures that are most displayed are protein, nucleotide, inorganic and organic molecules, etc.
{{Image:1JHE.pdb}} The markup for Jmol can be verbose, and putting Jmol scripts directly in pages can make them hard to edit.  So we suggest making a page for your Jmol viewer and including it in the desired page by [[Help:Editing:Intermediate|transclusion]].  A convenient way to do this is to use the Image page created by uploading a .pdb coordinate file. For example, the page at [[:Image:1JHE.pdb]] was created when the JHE.pdb file was uploaded to the wiki.  The page was then edited to add the Jmol viewer.  To put it in this page, we used <nowiki>{{Image:1JHE.pdb}}</nowiki>, where the curly brackets tell Mediawiki to copy the content of the Image page.  Similar approaches can be used to transclude an image from any other page in the wiki, in case you want different default behavior.


== Making the viewer ==
==Selecting a Compatible File==
You can build a viewer from scratch, or you can start by using <nowiki>{{subst:Jmol_template}}</nowiki> and saving to incorporate a template viewer. You'll still have to edit it, but this will put the viewer in a box that allows text to wrap around it on the right, add the Help link, set the background to white, and so on.
There are several file formats compatible with the jmol viewer, such as .pdb, .mol.  Other file formats such as .pse (from PyMol) will not work.  Files can be found at the Protein Data Bank at http://www.pdb.org, as well as other sites.
===The viewer block===
The viewer settings reside inside flanking jmol and jmolApplet tags. For example:
<pre>
  <jmol>
  <jmolApplet>
  <color>white</color>
  <uploadedFileContents >1JHE.pdb</uploadedFileContents>
  <script>
        wireframe off; trace off;
      rotate on;
      spacefill on;
      color chain;
  </script>
  </jmolApplet>
  </jmol></pre>


The '''script''' tags are used in several contexts in the Jmol extension.  Here, they tell the applet the default script to run when the applet loads.
=="How To" Embed the Image==
===Setting the pdb file===
[[File:Jmol help1.jpg|thumb|right|400px|Text inserted by the Jmol_template]]
Put the name of the pdb file between
[[File:jmol help2.jpg|thumb|right|400px|Setting the file name to the correct file]]
<uploadedFileContents >pdb file name</uploadedFileContents>
Note that this is just the filename, without Image: or Media; prefixes. Alternatively, you can create a wiki page with the the coordinates and use
<wikiPageContents>page of the wiki containing the molecular data</wikiPageContents>
or use
<inlineContents>contents of the molecular file</inlineContents>
to put the coordinates right in the viewer.


== Making external links to control the viewer ==
*Click on the ''Upload File'' link toolbox to the left.  EcoliWiki allows you to upload .pdb files so you may display a picture of the structure on any page you wish. If you encounter a file format that EcoliWiki does not support, email us at {{Email}} for help. 
As with the viewers, we suggest making link scripts on a separate wiki page and including them by transclusion. A convenient way to arrange these is to put some documentation for Jmol links in the talk page for an uploaded pdb file, and make the scripts as subpages.
**On the '"Upload File" page, select the file using the '''Choose File''' button in the ''Source Filename'' field.  The ''Destination filename'' should automatically fill out, and you can change the filename here if needed. You do not need to enter any information in the ''Summary''.
**'''Upload file''' using the button at the bottom.


*When your file is uploaded, you will be redirected to your file's page.  There will be no image, just a File History section.  Use the '''edit''' tab at the top of the page, and on the ''Editing File:'' page enter
<nowiki>{{subst:Jmol_template}}</nowiki>


For example, we made a subpage of the LexA products page [[lexA:Gene_Product%28s%29/catalytic_triad]] which is incorporated using
:in the description box.  Click '''Save page'''. The template will automatically load all the technical details necessary to make this work. This will put the viewer in a box on the right that allows text to wrap around it, add the Help link, set the background to white, and so on.  There will not be an image yet.
<nowiki>{{:lexA:Gene_Product(s)/catalytic_triad}}</nowiki>
to make this link: {{:lexA:Gene_Product(s)/catalytic_triad}}.


== Jmol scripting ==
*You will need to replace some text in your picture file.  Click the "'edit'" link again and there will be a lot more text than what you wrote (that's supposed to happen). In place of "REPLACE_WITH_FILENAME" (several lines from the top), insert the pdb file name (just XXXX.pdb).  This will allow EcoliWiki to upload the file contents of the file.  
Here, we'll just cover a few commonly used commands.  See below for links to more extensive documentation and tutorials.
**If you can add a short, useful title, replace "Text label", which is on the fourth line from the top, with the appropriate text.  (Explanations, links to the paper, or other comments go in the "Notes" section directly below the "Structure" and "Structure Figure" boxes back on the Gene Products page.)
<protect><!--box uid=63ce1649aab8b3180235b0af7618f667.150401.D49e185e8b9d29-->
*Click '''Save'''. Your picture should be visible and should be rotating around.  Highlight and copy the title of the page (at the top) for the next step.  
<!--
******************************************************************************************
*
*  ** PLEASE DON'T EDIT THIS TABLE DIRECTLY.  Use the edit table link under the table. **
*  
****************************************************************************************** -->
{|class = 'sortable' border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; border: 1px #aaa solid; border-collapse: collapse;" 
|-
!|Command!!Notes!!Examples
|-
|
select [atom-expression]
|
You need to select things to work on them selectively.  Atom expressions include:
* numbers for residues
* :chain_id for chains (subunits)
* backbone
* sidechains
|
* select 1-10; selects residues 1-10 in all chains
* select *:A; selects all atoms in chain A
* select 84:A, 156:B; selects two residues, one in chain A and one in chain B.
|-
|
spacefill (on/off/only)
(synonym: cpk)
|
Shows atoms as VdW sized spheres
|
|-
|
wireframe (on/off/only)
|
shows the bonds between atoms.
|
|-
|
cartoon (on/off/only)
|
shows helices and sheets in cartoon form.
|
   
|-
|
* zoom (atom-expression) %zoom
* zoomto (atom-expression) %zoom
|
centers on atom-expression and zooms there to the specified percentage of the 100% default.  The zoom factor can range from 5 to 20,000, where larger numbers are zoomed in.
|
zoomto (84:A) 500;
|-
|
color [drawn-object] [RGB-color]
|
if drawn-object is ommitted, color uses whatever is selected. Colors can be:
* color names:
**white, blue, red, cyan, etc.
**special names
*** monomer - gives a rainbow from N to C
*** cpk
*** amino - by aa type for proteins
*** shapely - by base type for nucleic acids
*** structure - helices and sheets
*** chain - subunits
* hex values: [xRRGGBB] (brackets needed)
* RGB triples:  [255,0,255]
|
   
   
*Go to the gene product page where you want to embed the image.  Scroll down to the ''Structure figures'' heading next to the ''Structure'' table, and click the '''edit''' link for ''Structure figures''. Paste the image title into the text box and add 2 sets of curly brackets:
  <nowiki>{{File:1D9U.pdb}}</nowiki> 
*Click '''Save''' and the image should display on the page.
**The ''Notes'' section on this page is the appropriate place for paper references, notes about the figure, etc.
== Troubleshooting ==
* Biological vs crystallographic units: The coordinate files from the PDB are usually for the crystallographic asymmetric unit.  This means that there may be multiple molecules in the same file, or that there may only be part of a multimer.  The PDB provides a separate file for the biological unit in many cases.  See [http://www.pdb.org/pdb/staticHelp.do?p=education_discussion/Looking-at-Structures/bioassembly_tutorial.html this tutorial at the PDB].


|-class='sortbottom'
==Examples==
|[{{SERVER}}{{SCRIPTPATH}}?title=Special:TableEdit&id=63ce1649aab8b3180235b0af7618f667.150401.D49e185e8b9d29&page=150401&pagename={{FULLPAGENAMEE}}&type=0&template= edit table] || ||
* [[:Image:1LMB.pdb]]  shows the page you'll need to edit text on
|}
* [[Image_talk:1LMB.pdb]] shows more images used on the main page
<!--box uid=63ce1649aab8b3180235b0af7618f667.150401.D49e185e8b9d29--></protect>
* [[lambda_repressor/N-domain]] is the interactive end product


== See also ==
== See also ==
* [http://wiki.jmol.org:81/index.php/Scripting Scripting] on the Jmol wiki.
* [http://wiki.jmol.org/index.php/Scripting Scripting] on the Jmol wiki.
* [http://jmol.sourceforge.net/jscolors/ Colors]
* [http://jmol.sourceforge.net/jscolors/ Colors]
* [http://chemapps.stolaf.edu/jmol/docs/?ver=11.8 scripting commands]
* [http://chemapps.stolaf.edu/jmol/docs/?ver=11.8 scripting commands]
Line 129: Line 46:
{{RefHelp}}
{{RefHelp}}
<references/>
<references/>
[[Category:Help|{{PAGENAME}}]]

Latest revision as of 17:52, 24 August 2011

About

Jmol is a Java-based molecular visualization tool. Extensive documentation can be found on the Jmol website. This page describes how you can embed images and set scenes inside EcoliWiki using Jmol's MediaWiki extension and custom EcoliWiki templates.

What Types of Structures Can I Display?

The structures that are most displayed are protein, nucleotide, inorganic and organic molecules, etc.

Selecting a Compatible File

There are several file formats compatible with the jmol viewer, such as .pdb, .mol. Other file formats such as .pse (from PyMol) will not work. Files can be found at the Protein Data Bank at http://www.pdb.org, as well as other sites.

"How To" Embed the Image

Text inserted by the Jmol_template
Setting the file name to the correct file
  • Click on the Upload File link toolbox to the left. EcoliWiki allows you to upload .pdb files so you may display a picture of the structure on any page you wish. If you encounter a file format that EcoliWiki does not support, email us at ecoliwiki@gmail.com for help.
    • On the '"Upload File" page, select the file using the Choose File button in the Source Filename field. The Destination filename should automatically fill out, and you can change the filename here if needed. You do not need to enter any information in the Summary.
    • Upload file using the button at the bottom.
  • When your file is uploaded, you will be redirected to your file's page. There will be no image, just a File History section. Use the edit tab at the top of the page, and on the Editing File: page enter
{{subst:Jmol_template}} 
in the description box. Click Save page. The template will automatically load all the technical details necessary to make this work. This will put the viewer in a box on the right that allows text to wrap around it, add the Help link, set the background to white, and so on. There will not be an image yet.
  • You will need to replace some text in your picture file. Click the "'edit'" link again and there will be a lot more text than what you wrote (that's supposed to happen). In place of "REPLACE_WITH_FILENAME" (several lines from the top), insert the pdb file name (just XXXX.pdb). This will allow EcoliWiki to upload the file contents of the file.
    • If you can add a short, useful title, replace "Text label", which is on the fourth line from the top, with the appropriate text. (Explanations, links to the paper, or other comments go in the "Notes" section directly below the "Structure" and "Structure Figure" boxes back on the Gene Products page.)
  • Click Save. Your picture should be visible and should be rotating around. Highlight and copy the title of the page (at the top) for the next step.
  • Go to the gene product page where you want to embed the image. Scroll down to the Structure figures heading next to the Structure table, and click the edit link for Structure figures. Paste the image title into the text box and add 2 sets of curly brackets:
 {{File:1D9U.pdb}}  
  • Click Save and the image should display on the page.
    • The Notes section on this page is the appropriate place for paper references, notes about the figure, etc.

Troubleshooting

  • Biological vs crystallographic units: The coordinate files from the PDB are usually for the crystallographic asymmetric unit. This means that there may be multiple molecules in the same file, or that there may only be part of a multimer. The PDB provides a separate file for the biological unit in many cases. See this tutorial at the PDB.

Examples

See also

References

See Help:References for how to manage references in EcoliWiki.