I. Design Concept: Presentation Contents Go Within the PDB File Header
In a scheme begun in 2003, the entire contents of a presentation are within the header of the PDB file(s) that contain the atomic coordinates needed for the presentation. The presentation contents are specified in a PiPE block inserted at the top of the PDB file header. Here is a schematic illustration of this.
II. Format of the PiPE Block in the PDB File Header
Structure of the "PiPE block":. The PiPE block is a single, uninterrupted block of lines inserted into the PDB file header that specifies a presentation. Although the PiPE block can be located anywhere within the header, it is recommended that the PiPE block be first, followed by the original PDB file header. The format of the PiPE block is as follows.
!html Here is some <b>bold text</b>.
!html This sentence is completed ! on a continuation line.
!html This sentence is completed !! (this comment line is ignored) ! on a continuation line.
!js put_button("@spt view05", "details_view05", ! "1d66.pdb");
!js.init pipe_background_color = "black"; ! pipe_start_spinning = true;
!spt #name=view03_uncertainty ! select all ! color temperature # uncertainty of atomic position ! spacefillIn command scripts, anything after "#" (until the end of the line) is a comment when processed by Chime. The "#name=whatever" is ignored by Chime, but it is not ignored by PE, which uses it to assign the specified name to the script. "# uncertainty of atomic position" is ignored by both Chime and PE.
!color color_medium_blue A0A0FF !color color_dark_red D00000 #optional comment here
!details #name=details_EF_hand ! <center><big> ! The EF Hand ! </big></center> ! ! The EF hand of recoverin binds calcium with oxygens of two ASP's, one GLU, ! one THR, and one ASN. Mostly sidechain oxygens are involved, but ! also two backbone oxygens. !
III. Using PiPE Elements.
Don't worry about the details of Chime command script language lines shown in the examples below. The command language is documented at MolviZ.Org, but you don't need to learn it. PE's Recorder will record the commands you need, and you can simply paste them into named scripts in the PiPE block, and then call them as explained below.
By default, the background color is white, and the message box is hidden. A PiPE chapter will start with a black background and a visible message box when:
!js.init ! pipe_background_color = "black"; // default is white. ! pipe_show_commands = true; // default is hide message box, etc.
!js.init ! pipe_start_spinning = true; // default is PE's Preference setting. ! top.nonStopSpin = true; // default: spinning stops after 3 min.A mechanism is also provided to guarantee that a particular molecular-view button will always start its view spinning (or not spinning). Include these lines at the end of the command script.
Similarly, a mechanism is provided to guarantee that a particular molecular-view button will always produce a view with a specified background color, regardless of the background color prior to pressing the button. To guarantee a black background, add this line to the end of the command script:
A script named, for example, active_site_spt, is invoked in another script with the syntax "@spt active_site_spt;".
!js put_button("select :a; color purple;");Alternatively, the button can call a named command script, for example (assuming a script named "view01" has already been defined)
!js put_button("@spt view01;");The word "@spt" preceding the script name signals calling a named script. Scripts can call other scripts, for example
!spt #name=view02 ! @spt view01 ! select :b ! backboneSimilarly, calls to scripts can be included among other commands in a molecular-view button script, for example
!js put_button("@spt view02; select :c; cartoon;");In addition to changing the molecular view by sending commands or command scripts to Chime, the put_button() function can specify a named block of details to be displayed in a popup window. The details must always be defined and named earlier in the PiPE block with a "!details" line (see above) The details-name must always be the second parameter, for example:
!js put_button("@spt view01;", "details_view01");All the above examples of "put_button()" employ the atomic coordinates ("molecule") included in the primary PDB file -- the same file that includes the PiPE block. However, a third parameter to "put_button()" may specify that the script be applied after a different PDB file (a secondary PDB file) is loaded into Chime. For example:
!js put_button("@spt view03;", "", "1d66.pdb");Note that in the above example, when no details were specified, the second parameter must be given as "" (an empty string of characters) in order to make the PDB filename the third parameter. Alternatively, the name of a details block could have been given in the second parameter.
Once a secondary PDB file has been loaded, any "put_button()" that does not specify an explicit PDB file will re-load the primary PDB file coordinates before applying its script.
If a molecular-view button's script should be applied to whatever PDB file is loaded when the button is pressed, the third parameter in that "put_button()" must be "*".
Only one copy of a large PDB file need be present. This is illustrated by the following hypothetical example:
!spt #name=dull_green_ligand ! select ligand ! color @color_dull_green ! !spt #name=color_ssbonds ! color ssbonds @color_sulfur
!html <font @color_dull_green><b>Ligand</b></font>The above html fragment writes the word Ligand in color_dull_green and boldface.
!spt #name=c1 ! @for $=0, 2 ! @spt select_grade$ ! @spt select_and_chain ! color @color_grade$ ! spacefill ! @endfor
Formatting requirements are as follows. Failure of any of these requirements will generate an appropriate fatal error message.
When properly formatted, the above script will be expanded to the following. Note that a copy of the segment between @for and @endfor is repeated once for each iteration, and that in each copy, $ is replaced with the number of the iteration.
!spt #name=c1 ! @spt select_grade0 ! @spt select_and_chain ! color @color_grade0 ! spacefill ! ! @spt select_grade1 ! @spt select_and_chain ! color @color_grade1 ! spacefill ! ! @spt select_grade2 ! @spt select_and_chain ! color @color_grade2 ! spacefill
In order for the above script to work script must have been defined with names select_grade0, select_grade1, etc. and colors must have been defined with names color_grade0, color_grade1, etc.
Again, most of the elements described above are illustrated in the PiPE Template.