There are some python helper scripts in scripts/python directory to build a XML data from PDB file. Users can create a XML data for wm3d using this script. These scripts are also used in the VMD plugin.
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). If you need these elements, please add manually.
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 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 shoud 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. Please change these strings if your STRIDE path is different from those default values.
See scripts/python/README for further information.