Help:Jmol in EcoliWiki: Difference between revisions

From EcoliWiki
Jump to navigation Jump to search
New page: 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...
 
Line 7: Line 7:
== Making the viewer ==
== Making the viewer ==
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.
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.
===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.
===Setting the pdb file===
===Setting the pdb file===
Put the name of the pdb file between  
Put the name of the pdb file between  
  <uploadedFileContents >pdb file name</uploadedFileContents>
  <uploadedFileContents >pdb file name</uploadedFileContents>
Alternatively, you can create a wiki page with the the coordinates and use  
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>
  <wikiPageContents>page of the wiki containing the molecular data</wikiPageContents>
or use
or use
  <inlineContents>contents of the molecular file</inlineContents>
  <inlineContents>contents of the molecular file</inlineContents>
to put the coordinates right in the viewer.
to put the coordinates right in the viewer.
== Making external links to control the viewer ==
== Making external links to control the viewer ==
As with the viewers, we suggest making link scripts on a separate wiki page and including them by transclusion.  For example, we made a subpage of the LexA products page [[lexA:Gene_Product%28s%29/catalytic_triad]] which is incorporated using  
As with the viewers, we suggest making link scripts on a separate wiki page and including them by transclusion.  For example, we made a subpage of the LexA products page [[lexA:Gene_Product%28s%29/catalytic_triad]] which is incorporated using  

Revision as of 05:38, 12 April 2009

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.

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

Embedding Jmol by transclusion

See Help:Jmol in EcoliWiki

Lex A C-terminal domain, residues 68-202 PDB:1JHE
<jmol>

 <jmolApplet>

<color>white</color>

   <uploadedFileContents >1JHE.pdb</uploadedFileContents>

<script> wireframe off; spacefill off; trace off; rotate ON; select *:A; spacefill on; color cyan; select *:B; cartoon on; color monomer; select *:3; color cyan; </script> </jmolApplet> </jmol>
<jmol> <jmolCheckbox > <scriptWhenChecked > rotate on; </scriptWhenChecked > <scriptWhenUnchecked > rotate off; </scriptWhenUnchecked > <checked>true</checked> <text>rotate</text> </jmolCheckbox > <jmolButton><script>reset; select all; wireframe off; spacefill off; trace off; rotate ON; select *:A; spacefill on; color cyan; select *:B; cartoon on; color monomer; select *:3; color cyan; </script><text>reset</text></jmolButton> </jmol>

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 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 {{Image:1JHE.pdb}}, 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

You can build a viewer from scratch, or you can start by using {{subst:Jmol_template}} 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.

The viewer block

The viewer settings reside inside flanking jmol and jmolApplet tags. For example:

 <jmol>
  <jmolApplet>
   <color>white</color>
   <uploadedFileContents >1JHE.pdb</uploadedFileContents>
   <script>
        wireframe off; trace off;
       rotate on;
       spacefill on;
       color chain;
  </script>
  </jmolApplet>
 </jmol>

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.

Setting the pdb file

Put the name of the pdb file between

<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

As with the viewers, we suggest making link scripts on a separate wiki page and including them by transclusion. For example, we made a subpage of the LexA products page lexA:Gene_Product(s)/catalytic_triad which is incorporated using {{:lexA:Gene_Product(s)/catalytic_triad}} to make this link: lexA:Gene Product(s)/catalytic triad.

Examples

Jmol documentation

References

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