PiPE Implementation
A document within Protein Explorer

This document can be ignored by users of Protein Explorer and authors of PiPEs. It provides a technical description of the PiPE javascript for programmers interested in understanding or modifying PiPE.

Generally, code that sets up the PiPE control panel is in protexpl and shared, while code that operates after the PiPE control panel is set up is in protexpl/pipe_sup. PiPE documentation is in protexpl/pipedoc.

  1. After thorough browser and Chime compatibility testing, PE loads fs_1.htm which sets up two frames, the control frame (fr_control) and the molecular image frame (fr_chime).

  2. fs_1.htm loads queryids.js which sets top.pipemode from query parameter pm= with possible values of "a", "i", "d" for audience, individual, or development, or "" if unspecified..

  3. When a PDB file is pre-specified (as a query parameter in the link to PE), PE loads the PDB file into Chime in the molecular image frame.

  4. If the PDB filename ends in _pipe.pdb or _pipe.mmol, PE hides the molecule so it can fetch the view01 script from the PDB file header.

  5. The PDB file header is retrieved via messageCallback() by sending "show pdbheader" to Chime (or by loading filename_pipe_h.htm in IE, because in IE, "show pdbheader" causes the browser to crash). (shared/hcquery.js)

  6. If the PiPE block exists (has nonzero length), hcquery.js calls setup_pipe(), defined in protexpl/pipe.js.

  7. setup_pipe() initializes font size etc. according to top.pipemode (audience, individual, development). Default is development.

  8. setup_pipe() calls parse_pipe() which parses the PiPE block into typed subsegments or (sub) "blocks", emitting alerts if formatting errors are detected.

  9. js.init javascript is executed.

  10. setup_pipe() calls set_pipe_controls() based on javascript variable assignments processed in js.init. All variables have default values and are optional except for the title.

    1. top.pec_cmdpct is set to 1 (%) or "" according to pipe_show_commands (default: false)

    2. top.pec_bgcolor is set to pipe_background_color (default "white")

    3. top.tpx_xld is set to pipe_title (no default, error alert if missing)

    4. top.pec_start_spinning is set to pipe_start_spinning (default "" = PE's preference setting)

  11. The PiPE control panel document defaults to pipe_sup/pipe_cp1.htm (but a custom control panel document can be set in js.init with pipe_cp1="filename.htm"). The filename is assigned to

    1. top.tpx_fn (used for links from the Site Map or other control panels that return to the PiPE control panel)

    2. top.docfn_ur (used by fs_rite1.htm to display the initial control panel).

  12. fs_rite1.htm is loaded into the control frame -- now it knows how large to make the lower left frame (large for the message box, or small for only the PiPE controls).

  13. pipe_cp1.htm, onLoad, executes write_pipe_control_page() defined in pipe.js, which lays out the control panel and buttons (calls to put_button()), diplaying the PiPE control panel.

  14. If there is no view01 script defined in the PDB file header, the molecular image remains blank with the correct background color.

  15. If there is a view01 script defined in the PDB file header, it is sent to Chime, and if a button has that script attached, that button is checked.

  16. The background color starts as specified (default white, or specified with pipe_background_color in the js.init). Pressing the Bkg button toggles the background in both the molecular image and in the control panel. Button-scripts don't change the background (unless individual scripts contain commands to force the background), so the user is free to toggle it at will.

  17. Pressing a button executes button_visited(n) (defined in pipe_sup/present.js) where n is the button number on the control panel and an index into the array of scripts butspt[n].

  18. If put_button() specifies the name of a block of details, a window is popped up to display the details (see popwin() in pipe_sup/present.js).

  19. If put_button() specifies a secondary PDB filename, that PDB file is loaded before the script is sent to Chime. If the secondary PDB file contains a PiPE block in its header, it is ignored (top.isPIPE in shared/hcquery.js).