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.
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.
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.0The color and radius are used to XML output, vdw-radius is used to determine covalent bonds.
There are two ways to use "builder.py" which is the main routine.
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.
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
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.
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.
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.swfThis will make SWF file /somewhere2/xml.swf from XML data /somewhere2/xml.xml.
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 Representations | WM3D XML data style |
| Lines Bonds Licorice | BONDs |
| VDW | ATOMs |
| CPK | ATOMs and BONDs |
| Tube | COILs |
| Ribbons NewRibbons Cartoon NewCartoon | RIBBONs and COILs |
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.
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.
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.