• Showing Page History #75721

Usage

  • Mouse Operatios
  • Keyboard Operations
  • Attach on powerpoint slide
  • Attach on OpenOffice.org/LibreOffice impress slide
  • Usage for web-pages
  • Usage of Builder Script
  • Compile XML data manually
  • Usage of VMD Plugin

Mouse Operations

Left Button

  • translation/rotation (click and drag; depends on the mouse mode )

Wheel

  • scale molecule/change depth (change camera position); depends on the mouse mode

Keyboard Operations

  • "a" : show about
  • "c" : clear current view and reload data
  • "d" : switch mouse mode to depth mode (wheel)
  • "e" : invoke edit window
  • "l" : load XML file
  • "r" : switch mouse mode to rotation mode (left; default)
  • "s" : switch mouse mode to scale mode (wheel; default)
  • "S" : save current XML data and view into the XML file
  • "t" : switch mouse mode to translation mode (left)
  • arrows : do translation/scale change/depth change; depends on the mouse mode
  • "+" : same as up arrow
  • "-" : same as down arrow

Please type "c" to reset view if you resize thw window or if the rotation center is apart from the window center. The latter case happens when the program misunderstands the window size, which is almost specific to the projector content debugger.

Attach on powerpoint Slide

tested on Powerpoint2003@Windows XP

Find and click "Control Toolbox" and select "Shockwave Flash Object" from the list. Then, draw the control in your slide. Right-click at the control and select "Properties". Specify your movie location on the "Movie" property and modify "WMode" property to "Direct" or "gpu". (default value "Window" is not valid for Stage3D swfs.)

See also Microsoft Support page for detailed instruction.

Attach on OpenOffice.org/LibreOffice impress slide

i gave up. is it possible to change wmode parameter to "gpu" or "direct"?

Usage for web-pages

WM3D swf files can be used on web pages without compilation, since XML data can be loaded through javascript. You can set XML data of the swf file through "Redraw" command. See the following example, where the object id of the wm3d swf file is assumed to be "WM3D".

  document.WM3D.Redraw(
'<WMXML>\n' +
  '<ATOM pos="4 4 4" color="0xFF0000" radius="5" />\n' +
  '<ATOM pos="4 10 4" color="0xFF0000" radius="5" />\n' +
  '<ATOM pos="4 4 10" color="0xFF0000" radius="5" />\n' +
  '<ATOM pos="10 4 4" color="0xFF0000" radius="5" />\n' +
'</WMXML>');

Note: parameter wmode should be set to "gpu" (or "direct"?) in your "object" or "embed" tag.

Usage of Builder Script

NOTICE: If you use VMD plugin, you may don't have to use this script.

There are some python helper scripts in scripts/python directory to build XML data from PDB file. Users can create a XML data for wm3d using this script.

It is to be noticed that these scripts are also used in the VMD plugin internally.

ATOM definition

Information about atoms are defined in scripts/python/DEFAULTS. In default, only some elements which are common for proteins are registered. If you want to register atoms, please add its name, color, radius, and vdw-radius(in angstrom) to this file.

# lines begun with "#" are ignored
# atomtype color radius van-der-waals-radii(used to determine bond)
H 0xAAAAAA 6 1.2
C 0x00FF00 10 2.0
# for alpha carbon, not for calcium
Ca 0x00FF00 10 2.0
N 0x0000FF 10 2.0
O 0xFF0000 10 2.0
F 0xF8ABA6 10 2.0
Na 0xAFDFE4 12 2.0
Mg 0x001F43 14 2.5
S 0xFFFF00 14 3.0
P 0xF8ABA6 14 3.0
Cl 0x008000 14 3.0
The color and radius are used to XML output, vdw-radius is used to determine covalent bonds.

Script Usage

There are two ways to use "builder.py" which is the main routine.

  1. use command line arguments
  2. interactive mode

This script can create XML data of objects such as spheres, sticks, coils, and ribbons, but never create setting-related elements (<SETTING> and its child elements). Please add them manually when you need these kinds of elements.

Use command line arguments

Here is a sample usage. In this sample, XML data of the protein backbone are generated in COIL style.

% ./builder.py -l pdb.pdb -s -Z > output.xml

Use interactive mode

Interactive mode can be invoked if no arguments are given to builder.py. Sample usage is shown in the following, where lines begun with ">>" are output by the XML (to stderr) and the others are user input.

% ./builder.py > output.xml
>> entering command line mode.
>> type "exit" or press Ctrl+D to exit.
>> type "help" to show list of commands
load pdb.pdb
>> read xxxx atoms from the pdb file
select
>> select xxxx atoms
gencoil
>> finished to generate chains
exit
>> bye.

This sample do the same thing as the command line sample above.

Notices

You should MANUALLY add <WMXML> and </WMXML> tags in the beginning and end of the output.xml, respectively.

Stride is used to determine the secondary structure, when you create <RIBBON>s. The path of the Stride is given in system.py, where default path is "/usr/local/lib/vmd/stride_LINUX" for Linux and "C:/Program Files/University of Illinois/VMD/stride_WIN32.exe" for Windows, where these locations are standard path for standard VMD users. Please change these strings if your Stride path is different from those default values.

Stride is used only on secondary structure assignment. Therefore, genchains (commandline: -z) is the only affected command. Other commands such as genatoms(-x), genbonds(-y), gencoils(-Z) can be used without Stride.

See scripts/python/README for further information.

Compile XML data manually

NOTICE: If you use VMD plugin, this section may not worth to read.

You should create .hxml file to compile swf data. There is a sample hxml file in src/template directory. Actual compilation is done by the following command, which works both on Linux and Windows.

% haxe (hxmlfile)

For Linux users, there is somewhat easier way using "make". I here assume wm3d is in /somewhere and xml data named xml.xml is in /somewhere2.

% cd /somewhere/wm3d/src
% make /somewhere2/xml.swf
This will make SWF file /somewhere2/xml.swf from XML data /somewhere2/xml.xml.

VMD Plugin Usage

See wiki:wm3d/VMD_Plugin first, where the way to setup of this plugin is described.

In the following example, I assume you are (at least somewhat) familiar with VMD. First of all, launch VMD and load structure data and modify representations.

Plugin Error: attach file not found: sample_data2.png

For example, fragment of calmodulin molecule (PDB id: 1F55) is loaded and shown in ribbons and spheres. You then launch WM3D plugin from Main menu (see figure above). If you cannot find wm3d plugin, see wiki:wm3d/VMD_Plugin and message in the terminal window.

Plugin Error: attach file not found: sample_data3.png

The WM3D plugin window will appear like this. You may modify some fields in the window such as WM3D directory and view option. What you should do next is to click "Generate XML" button in the bottom-left. If your setting is OK, the textfield will be filled with XML data. You then click "Generate SWF" to generate SWF file.

Data conversion is performed for each representations. VMD representations shown in the table below are converted to the corresponding XML data, others are simply ignored. Note that representations are the only inheritable setting. Other settings, such as "Materials" and "Coloring Method", are currently never be inherited.

VMD RepresentationsWM3D XML data style
Lines Bonds LicoriceBONDs
VDWATOMs
CPKATOMs and BONDs
TubeCOILs
Ribbons NewRibbons Cartoon NewCartoonRIBBONs and COILs
Plugin Error: attach file not found: sample_data4.png

Swf file will be generated on the same directory of the source data file (usually pdb file) if everything is OK, and you can see the flash movie if the relevant viewer is chosen. You can then try to edit XML data in the plugin window and click "Generate SWF" to get modified swf file.

Save View

You can save view/scale of the flash movie. XML data generated by save command, "S" (capital s), contains the information about scale and view.

Plugin Error: attach file not found: sample_data5.png

For example, I set view and scale like this and save XML data into a file "watermelon.xml". The xml data can be loaded from the "File" menu of VMD plugin window to its textfield (of course, you can build swf file without VMD).

Plugin Error: attach file not found: sample_data6.png

As you can see in this text data, loaded data contain MATRIX element which knows the scale and view at the saved state. Rebuilding SWF file using this XML data generates the swf file with the modified initial view/scale.

Notices

Program sometimes misunderstand the width/height of the window, which often happens on the projector content debugger. Please type "c" to reload the data in such cases. You should also type "c" if you resize the window.