CCP4i Documentation for Programmers: Core Documentation

Contents

File Viewer (src/fileviewer.tcl)

File Viewer

The procedures in the file src/fileselect.tcl are concerned with display of files. A procedure to display a specific file type such as LOG is called LOGViewer.

fileviewer Setup procedure called if file viewer is run stand-alone

Argument list: None

The name of file to display is passed from ccp4i script as system(SCRIPT)

ExitFileViewer Called on exiting file viewer - will terminate process in stand-alone mode

Argument list: None

FileViewer Display a file

Argument list: <file> <args>

See Programmers Documentation

fileviewer0 Display a file

Argument list: <file> <format> <ANY> <viewer>

The type of viewer to use is determined from the input parameters in order of preference: the specified viewer, the default viewer for the file type, the default viewer for the file type that is inferred from the file extension. If the file type can not be inferred then the file will be displayed as a text file.

file Name of file to display

format (Optional) The file format - should correspond to a file format defined in etc/types.def

viewer The viewer to use to display the file.

LOGViewer Display a log file

Argument list: <filename> <args>

The first few lines of file are read for an indication that the file is html. If it is then it is displayed in Netscape.

filename Name of log file to display

-summary

Display only the summary from the log file. Note that in the non-html display there is an option to toggle between full and summary display.

LogGraph_graph Use loggraph to display data from a 'graph' file

Argument list: <filename>

filename Name of graph file to display

LogGraph Display files using ccp4i loggraph

Argument list: <filename> <args>

filename Name of file to display

-format format

Specify format of input file: should be LOG or GRAPH (default LOG)

PDBViewer Display PDB file as text

Argument list: <file>

file Name of file to display

MAPViewer Use mapdump to read map header and display this

Argument list: <file>

filename Name of file to display

MTZViewer Use mtzdump to read mtz header and display this

Argument list: <file>

filename Name of file to display

mtzviewer_info pass-thru to set up new global array

Argument list: <arrayname>

mtzviewer_info0 Handle option for Extra Information when displaying MTZ files

Argument list: <arrayname> <mtz_arrayname>

mtz_info behaves like a usual task interface - this procedure creates a 'mtz_info' task window

arrayname Name of array for fileviewer interface parameters

mtz_arrayname Name of array for mtz_info interface parameters

mtzviewer_info_handler Handle the 'Run' command for mtz_info - Run mtzdmp or sftools

Argument list: <arrayname> <mtz_arrayname>

arrayname Name of array for fileviewer interface parameters

mtz_arrayname Name of array for mtz_info interface parameters

mtz_info_review Review and display the output from the mtz_info task

Argument list: <mtz_arrayname> <job_id>

This procedure is called automatically after the mtz_info job has finished when been run by 'run_command'

mtz_arrayname Name of array for mtz_info interface parameters

job_id Job id for the mtz_info job which has just completed

PSViewer Display a postscript file

Argument list: <file>

file Name of PostScript file

XMGRViewer Display xmgr file - as output by scala

Argument list: <file>

file Input xmgr file

PLOT84Viewer Use xplot84driver to display a plot84 file

Argument list: <file>

file Name of plot84 file

PLOT84PSViewer Convert plot84 format file to PostScript and display with PSViewer

Argument list: <file>

file Name of plot84 file

MRViewer Display (and edit) a mr (molecular replacement) file

Argument list: <file>

file Name of mr file

HAViewer Display (and edit) a ha (heavy atom) file

Argument list: <file>

file Name of ha file

mr_ha_viewer Pass-thru to mr_edit task which will display & edit mr and ha files

Argument list: <file> <mode>

file Name of mr/ha file

mode File mode - ha or mr

RunRasMol Run RasMol to display coordinates

Argument list: <filename>

filename Input PDB coordinate file

RunPyMol Run PyMol lto display coordinates

Argument list: <filename>

filename Input PDB coordinate file

RunMapslicer Run the mapslicer program

Argument list: <filename>

filename Input CCP4 format map file

RunCoot Run the Coot program

Argument list: <args>

Command line arguments to be passed directly to Coot

RunCCP4mg Run the CCP4mg program

Argument list: <args>

Command line arguments to be passed directly to CCP4mg

RunDbviewer Launch the Dbviewer application

Argument list: <args>

Command line arguments to be passed directly to DbViewer

DisplayTextFile Display a text file

Argument list: <filename> <args>

LoadTextWindow Load the text into the window set up by DisplayTextFile

Argument list: <arrayname> <text_list> <args>

arrayname Array for file display interface

text_list The text to insert - may be in the form of a list.

-append

Append new text to any test already in the window

display_next_frame handle the display of the next frame of text if displaying a very large file

Argument list: <arrayname> <w> <increment> <1>

arrayname Array for file display interface

w Window id for file display interface

increment

Number of frames to move on from the current frame (default is 1). Increment can be negative, to go to previous frames

display_read_frame Read a frame from a log file into memory so it can be displayed

Argument list: <arrayname>

Internal procedure called by display_next_frame. Returns the number of the current frame.

arrayname Array for file display interface

display_skip_frame Read through a frame from a log file and discard it

Argument list: <arrayname>

Called by display_next_frame. Returns the number of the current frame.

arrayname Array for file display interface

display_text_update_case Handle user changing the respect/ignore case option

Argument list: <field> <arrayname> <w>

field The user selection ignore or respect

arrayname Array for file display interface

w Window id for file display interface

display_text_close Handle user clicking Close button.

Argument list: <arrayname> <w>

arrayname Array for file display interface

w Window id for file display interface

display_text_save Handle user opting to save contents when using 'edit' mode

Argument list: <arrayname> <filename>

arrayname Array for file display interface

filename Name of file to save text to

display_text_find Handle user hitting Find or 'Close Find' button

Argument list: <mode> <w> <arrayname>

mode open or close

w The Tk id for the window

arrayname Name of data array

display_text_find_string Find and highlight given string in the text

Argument list: <mode> <arrayname> <args>

mode Mode of action: next= Just move to next instance of the search string previous= Just move to previous instance of the search string hilight= Just highlight the instances of the search string update= Search the text for the search string, highlight hits

arrayname Array for file display interface

-position position

In update mode do search from position (used when file is still been read in)

display_links Dispaly links in log file

Argument list: <arrayname> <w>

This is not used and may not be fully functional

MonitorFile Read and display a file that is still being written

Argument list: <w> <arrayname> <file> <mtime> <size> <delay> <terminator>

This procedure works by re-calling itself after a small time delay. If the file is not increasing in size then the time delay is increased. The procedure searches the file for some specified text string which indicates the file is complete and then MonitorFile will stop re-calling itself.

w Tk id of the text window

arrayname Array for file display interface

file Name of file to display

mtime The time at which file was last modified (a negative value signifies the first call to MonitorFile

size The size of the file when last modified

delay The delay before re-calling MonitorFile

terminator A text string whose presence in the file would indicate the end of the file

display_text_summary Handle the 'Show Summary' option

Argument list: <w> <arrayname>

w Display text interface window id

arrayname Name of display text interface array

display_text_full Handle the 'Show Full Text' option

Argument list: <w> <arrayname>

w Display text interface window id

arrayname Name of display text interface array

ExtractLogSummary Extract the text tagged as 'summary' from a log file

Argument list: <fullText> <summaryTextVar>

fullText Input the full text

summaryTextVar Output the text summary

HilightLogSummary Highlight the sections of log file which are tagged as 'summary'

Argument list: <fullText>

fullText Input the full text

GetViewerList Extract the list of file formats, viewers and full viewer commands from the typedef array

Argument list: <format> <viewerVar> <viewercmdVar>

The definitions have been read from the etc/types.def file into the typedef array. This procedure reformats the information as lists which are easier to handle.

format Output list of supported file formats

viewer Output list of viewer names (corresponding to format list) which is the name of the viewer as seen by the user

viewercmd Output list of the commands required to run viewers (corresponding to format and viewer lists)

Plugin Utilities (src/plugins.tcl)

Plugin Utilities

The procedures in this file provide support for a simple "plugins" mechanism within CCP4i. A "plugin" is another application outside of CCP4i which can be usefully invoked on behalf of the user to view files or perform a new action after a particular task has been run. For example, after a run of Refmac5 it might be useful to launch Coot to further work on the refined structure.

Data about which plugins are available for which task is stored in the ccp4i_plugins global array. Elements of the array are tasknames; the value of each element is a list of plugin names. For each plugin there should be a procedure called plugin_for_$pluginname, which returns a text string and a command for launching the application given the taskname and a list of files output from that task.

The GetPlugins procedure provides an interface to the available plugins: given a taskname and list of files, it returns the available plugin commands that could be invoked.

GetPlugins Return available plugins for a specific task

Argument list: <taskname> <filelist>

Given the name of a task plus a list of associated files, this command checks whether any plugins have been specified for that task and attempts to generate commands for launching any that are found.

The result of the command is a list of plugin specifications. Each specification is also a list, the first element being a string of text to be displayed in (e.g.) the "View Files from Job" menu, and the other the command to be invoked to start the plugin application.

If no plugins are found then an empty list is returned.

taskname Name of the task

filelist List of full filenames output from the task

get_plugin_executable Helper function: verify and return the executable name

Argument list: <program> <execVar>

This command wraps FindExecutable. It returns 1 if the specified executable is found, and the executable path is returned in the specified variable. Otherwise it returns 0.

program Name of the program executable to be found

execVar Name of the variable to return the name in, if found

Plugin Command Generation Functions

Plugin Command Generation Functions

The functions in this section generate the appropriate commands for launching the plugin applications for specified task contexts and available output files.

Each plugin should have an associated plugin_for_* procedure defined, which should take exactly two arguments: the first is the name of a task, and the second is a list of files from a job. The procedure should contain code specific to the plugin application, and return a list of two elements - the first is a string of text that describes the operation of the plugin when launched, and the second is the actual command to launch the plugin in background.

If no plugin is available then an empty list should be returned.

taskname Name of the task

filelist List of files output from a run of the task

taskname Name of the task

filelist List of files output from a run of the task

taskname Name of the task

filelist List of files output from a run of the task