Help:Jmol in EcoliWiki: Difference between revisions

From EcoliWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==Description==
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].
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].


Working with Jmol in EcoliWiki is a bit of an advanced topic, so it may be useful to familiarize yourself with MediaWiki markup conventions.  Start with the [[Help:Editing|Editing help page]] and see [[:Category:Help]] for more advanced topics.
==What types of structures to Display==
The structures that are most displayed are protein, nucleotide, inorganic and organic molecules, etc.


== Embedding Jmol by transclusion ==
==Selecting a Compatible File==
{{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.
There are several file formats compatible with the jmol viewer, such as .pdb, .mol.  Other file formats such as .pse will not work.   


== Making the viewer ==
==Embedding the Image==
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 on the right that allows text to wrap around it, 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.
1. 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 allow, please contact '''us''' for help.   
===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 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 ==
2. When you upload your pdb file, put <nowiki>{{subst:Jmol_template}}</nowiki> in the description txt box.  The template automatically loads all the details necessary to make this work. If you try to edit the image page from now on, there will be a lot more text than what you wrote (that's suppose to happen).
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.  For example,
* The structure above is at [:Image:1JHE.pdb]]
* Discussion of the structure file is at [[Image_talk:1JHE.pdb]]
* Subpages of the talk page can be used for scripts that save specific views.


Example: [[Image_talk:1JHE.pdb/catalytic_site]] contains a Jmol link script, which is incorporated to make this link {{Image_talk:1JHE.pdb/catalytic_site}}using <nowiki>{{Image_talk:1JHE.pdb/catalytic_site}}</nowiki>
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.
 
3. To embed this image into your page of interest. To insert an image anywhere in EcoliWiki, place <nowiki>{{Image:1JHE.pdb}}</nowiki>, where the Image: 1JHE is replaced with the title of your image page.




=== Known bugs  ===
* the transclusion does not work if the markup is included in the wiki markup for a list or indented text
* start the next word after the transclusion immediately after - don't leave a space.


=== More examples  ===
=== More examples  ===

Revision as of 16:21, 5 June 2009

Description

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.

What types of structures to 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 will not work.

Embedding the Image

1. 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 allow, please contact us for help.

2. When you upload your pdb file, put {{subst:Jmol_template}} in the description txt box. The template automatically loads all the details necessary to make this work. If you try to edit the image page from now on, there will be a lot more text than what you wrote (that's suppose to happen).

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.

3. To embed this image into your page of interest. To insert an image anywhere in EcoliWiki, place {{Image:1JHE.pdb}}, where the Image: 1JHE is replaced with the title of your image page.


More examples

Jmol scripting

Here, we'll just cover a few commonly used commands. See below for links to more extensive documentation and tutorials.

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]


edit table


See also

References

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