CCP4i Documentation for Programmers: Core Documentation


The Procedures

Initialisation and Utilities (system.tcl and utils.tcl)
Initialisation and Utilities
Def Files
Def Files
InitialiseArray Initialise an array with data from a def file
WriteIdentifier Write header to CCP4i file (mainly used for def files)
SaveArray Save the data in an array to a def file
WriteDefLine Create a text line for the def file to define one parameter
WriteDefLine1 Create a text line for the def file to define one parameter including it's data type
Preferences Files
Preferences Files
InitialisePreferences Initialise the parameters from preferences configure and directories def files
SavePreferences Save a directories/preferences/configure/status.def file to user's directory
SaveInstallPreferences Save the preferences to the CCP4i installation area
update_defdir_menu Update the project/alias menus that appears in file selection
CCP4i Startup Utilities
ElementExists Test if a given element name exists in an array
autoconf_UNIX_configure Attempt to configure the configure parameters for a UNIX system
autoconf_WINDOWS_configure Attempt to configure the configure parameters for a WINDOWS system
autoconf_WINDOWS_system Attempt to configure the system parameters for a WINDOWS system
set_configured_menus Create menus which are based on data in the configure def file.
set_typedef_menu Use a list of values from indexed array element(s) to define a menu data type
set_default_mapviewer (Re)set the default mapviewer
set_default_pdbviewer (Re)set the default PDB viewer
set_default_viewer Set the default viewer for a particular file type
SetDefaultMapFormat Return the default map format set by the user in preferences
TestEnvVariables Test CCP4 environment variables set - used at ccp4i startup.
InitialiseDotCCP4 Create/update the $HOME/.CCP4 directory
SetDomain Unused. Part of project to support multiple machine domains
CreateSessionLog Open a session log file which is written to by the Report
Report Write diagnostics to the session log file
WarningMessage Minimal WarningMessage proc to output diagnostic from WindowsNT
Saving Global Parameters
Saving Global Parameters
GetSystemVar Get a global parameter from array system_save
SetSystemVar Save a global parameter in array system_save
Querying the Operating System
Querying the Operating System
GetHostname Return the name of the machine running the process
GetUserId Return the user's id.
GetVersion Return the CCP4i version.
GetPid Return the process id of the current process
GetCurrentDir Return the name of directory from which current process was started
GetDate Return the date/time appropriately formatted
BinPath Return path name for an executable
Execute Execute a program with a command script and some error trapping
Handling File Names
GetEnvPath Get operating system environment variable
GetFullDirName Return full path name for given directory alias
GetFullFileName Return full path name for given file name and directory alias.
GetFullFileName1 GetFullFileName version used in ExecuteScript
GetFullFileName0 Return the full path name of a file which is defined in an array.
GetCurrentProject Return the project alias for the currently open user project.
GetDefaultDirPath Return the full path name for an input project/directory alias.
SearchPath Return full path name for a CCP4i code or data file.
datapath Return the full path name for a configure file in the user's home directory.
GetTmpFileName Return a unique name for a temporary file
GetFileFormat Return the file type as inferred from the file extension
FileJoin Concatenates file names using the correct path separator for platform.
FileRootName Return file base name - i.e. remove the file extension and path name.
Manipulating Files
OpenFile Open a file
CloseFile Close a file
ReadFile Read contents of file into a text variable
ReadEndOfFile Return specified number of lines from the end of a file.
WriteFile Write text to a file
DeleteFile Delete a file or directory
DeleteFiles Delete multiple files.
FileWritable Return flag to say if file is writable
MoveFile Move (i.e. rename) a file.
CopyFile Copy file - i.e. make a new version and keep existing file
TranscribeFile Append contents from one file to the end of another file
CompressFile Compress file using gzip
UnCompressFile Uncompress file using gzip
UnTarFile Apply 'tar -xf' to a file
CompressExtension Return the expected extension for conpressed file
Handling Directories
CreateDir Create a directory
CopyDir Copy a directory
ChangeDirectory Change working directory
Parsing Files
Parsing Files
ExtractFromFile 'grep' text from a file
GetWords Return selected words in a line as a Tcl list
ExtractTextLine Extract words from a line of text
ExtractFromText 'Grep' for a line in text and return specified fields from line.
StringSame String comparison - is the first argument the same as any of the other argements.
Socket Handling
Socket Handling
OpenClientSocket Open a client side socket
ListenClientSocket Listen for input from a server socket.
TestSocket Test if a socket is open - return true (1) is socket responds
PutsSocket Write to a socket
Handling Data Types
Handling Data Types
GetType Returns the data type for an input array element
Indxv Generate the element name for multi-dimensional data
GetIndx Parse the name of a dimensioned element
Indxv0 For indexed element names (eg root,4) return the zero index (eg root,0)
Indxv0 name Name of an array element
GetTypeInfo Return some information which is a property of the data type of an element
get_type_list Get the full list of properties of the data type of an array element
get_type_info_error Output warning message when fail to find type information
get_type_info_error Get the full list of properties of the data type of an array element
GetWidget Return the Tk id of the widget representing an array element
DefineVariable Define the data type and initial value of a variable
DefineMenu Define a data type which is of class menu
GetMenuValue Return the alias for the value of an array element which is a menu
GetMenuText Return the text which appears on the menu for given value of parameter
Handling Arrays
GetIndexedElements Return all the indexed elements in an array with a given root
GetIndexedElements0 Return all the indexed elements in an array with a given root
ArrayToList Copy data values from all the instaces of an indexed element to a list
CopyArray Copy all elements of arrayname in array(PARAM_LIST) to arrayname1
CheckUnique Check that all instances of an indexed variable are unique
CreateNewArray Create new unique global array with name $root_$n
ArraySearch Return the name of an indexed element with a value of 'text'
DeleteArray Delete an array
Simple Mathematical Functions
max Return the maximum value of the values in the argument list
min Return the minimum value of the values in the argument list
iremainder Return the mod of n and m
push Push a parameter onto a stack (i.e. append to list)
pop Pop a parameter off a stack (i.e. append to list)
maxdecimal Round an input number to given number of decimal places
sortorder Sort a list using Tcl lsort and return a list of offsets to position in input list
String Handling
IfSet Test if input argument(s) are not blank strings
StringSame String comparison - is the first argument the same as any of the other argements
RemoveMetaChars Return text string with non-alphnumeric characters & leading/trailing spacesremoved
The Task Mode (src/task.tcl)
The Task Mode
task Initiallisation to run CCP4i in task mode.
The Taskbrowser (src/taskbrowser.tcl)
The Taskbrowser
taskbrowser Initiallise CCP4i to run the taskbrowser
Utilities for CCP4i Main Window (src/browser_utils.tcl)
ReadTaskList Read the etc/$OPSYS/modules and $USER/.CCP4/$OPSYS/modules files
UpdateModulesList Update the lists of modules and tasks
CreateTaskBrowser Draw the main graphical window of ccp4i
module_help Handle user clicking for help on the Module menu
update_module Update task menu when user changes modules
MailHandler Create mail window for interface
MailtoDev Define the 'Mail CCP4' dialog box
send_mail Handler for MailtoDev 'Send Mail' command
Utilities for manipulating CCP4i modules.def files (src/modules_utils.tcl)
GetModuleList Return a list of the modules in the specified modules def file
GetTaskList Return a list of the tasks in the specified module of a modules def file
AddModule Add a new module reference to the specified modules def file
UpdateModule Change the module title text
DeleteModule Remove a module reference from the specified modules def file
AddTaskReference Add a new task reference to the specified modules file
UpdateTaskReference Update the attributes of a particular task reference
DeleteTaskReference Remove a task reference from the specified modules def file
Handling CCP4-Specific File Formats
InitialiseProject The place for CCP4 specific initialisation
InitialiseProject Load data from file CCP4/lib/data/symop.lib & CCP4/ccp4i/etc/crystal.lib
ReadCrystalData Read etc/crystal.lib file and extract crystallographic info
MTZ Column Selection
MTZ Column Selection
CreateLabinLine Draw task interface line for selecting input MTZ column labels
SetLabin Handler to update Labin menu after user has seelcted MTZ file
SetLabinUnassigned Set labin menu to 'Unassigned' if the user has deselected an MTZ file
UpdateDependentLabin Update the second labin column in a line when user selects the first labin#d_desc This procedure is called when the user selects a new item from the labin menu
SetLabelList Save a list of allowed column labels and types a labin array element
GetLabelList Return the list of allowed column labels and types for a labin array element
ListAllLabels List all column labels in MTZ file to support the 'List all Labels' option on column label menu
handle_list_labels handler to update column label when it is selected from 'List all Columns'
EnterLabel Window for user to type colum label to support 'Enter Label' option on columns menu
CreateCadLabinLine Display the MTZ label selection line used in the Cad task interface
cad_update_labin Handler for CreateCadLabinLine to create menu of input column names
CreateLaboutLine Draw a task interface line for user to specify output MTZ column name
CheckLabout Procedure to be called before running a task to check uniqueness of output MTZ column names
PackLabinLine Pack, i.e. set the layout, of the task interface line to select MTZ columns
Extracting Data from Map Files
InitialiseMAPData Initialise the MAP_file_data array with header info from the last selected input CCP4 map file.
ReadCCP4Map Read a CCP4 map file using mapdump and return program output
ExtractMAPData Read header info from a CCP4 map file and save to MAP_file_data array
Extracting Data from PDB Files
InitialisePDBData Initialise the PDB_file_data array which holds header parameters from the last selected input PDB file.
ExtractPDBData Read header from PDB file and load params into global array PDB_file_data
GetCCP4SpaceGroup Return space group in CCP4 format
Extracting Data from MTZ Files
SetMtzParamField Put data value from MTZ header into an array element
GetMtzParam Return a specified data item from specified MTZ file
InitialiseMTZData Initialise the MTZ_file_data array with header info from the last selected input MTZ file
ReadMTZ Read an MTZ file using mtzdump and return program output
ExtractMTZData Read header info from an MTZ file and save to MTZ_file_data array
InitialiseParamFromFile Initialise the *_file_data arrays containing data from map/pdb/mtz file headers
GetMtzColumnList Return the labelled columns of a specified type and one default
GetMtzColumnByType Return the labelled columns of a specified type found in an MTZ file
Accessing Standard Crystallographic Data
GetSpaceGroupNumber Return space group number from input space group code
GetSpaceGroupCode Return CCP4 space group code from input space group number
GetSpaceGroupStdCode Return PDB standard space group code from input space group number
GetSpaceGroupNops Return the number of symmetry ops for a space group
GetSpaceGroupLattice Return the crystal lattice for a space group
GetSpaceGroupSymops Return the symmetry ops for a space group as a list
GetAsymUnit Return the CCP4 standard asymmetric unit
GetLaueGroupNumber Return an identifier for the laue group
GetLaueGroup Return a list of space groups in given Laue group
GetPattersonSpaceGroup Return the Patterson space group for given space group
GetHarkerSections Return the Harker sections for given space group (as Tcl list)
GetFFTSpaceGroups Get a list of space groups supported by FFT program
GetChangeHandData Get resultant space group and transformations fro changing hand of data
GetTwinData Get the transformation(s) for twinned data
GetLatticeFromSpaceGp Return the lattice type from space group name ('cos shelx can not!)
Interaction with Operating System & Local Packages(src/local.tcl)
Interaction with Operating System & Local Packages(src/local.tcl)
SendMail Send email using system Mail utility
Interaction with Netscape
Interaction with Netscape
start_netscape Start the Netscape program
start_hypertext_viewer Start the hypertext viewer program defined in configure
open_url Open a specified file in a Netscape window
warning_no_netscape Output warning message when fail to open page in Netscape
warning_no_hypertext_viewer Output warning message when there is a failure to open a URL
poll_netscape Make repeat attempts to load page into Netscape
Running Program Scripts
Running Program Scripts
RunBatchJob Submit a job to a local batch queue
RunRemote Start a job on a remote machine
RunServer Procedure not fully implemented. Start a job on a server
CreateBatchCom Create a command file to start a job on a remote machine or batch queue
KillScript Kill a non-graphical ccp4i process
GetProcessList Return the process information from the Unix ps command
get_process_list Execute and return the output of Unix command ps ...
KillProcess Kill a system process
KillChildProcesses Kill a system process id and all its child processes
KillRemoteScript Kill a ccp4i non-graphical script running on a remote machine
ReadLogPid Read log file header to get process id
Server-Side Socket Handling
Server Side Socket Handling
OpenServerPort Open a port in the CCP4i server i.e. the main graphical process
ServerAcceptSocket Accept a socket connection from a client
ServerAcceptInput Accept input from a client
Database Utilities (src/database.tcl)
Database Utilities
APIs to Access the Database
DbRegisterJob Register a new job with the project database.
DbUnregisterJob Unregister job at some stage in job startup
DbSetJobData Assign a value to database item(s)
DbGetJobData Return a data item from the database
DbGetJobFileRoot Return the root name for files such as script and log files
GetLogFileName Return the full file name for the log file
GetLogFileFormat Return the full file name for the log file and its format
DbGetJobFiles Return a list of either INPUT/OUTPUT files
AddProject Add a new project to list of projects
DirIsProject Check whether a directory is a project directory
Database GUI
Database GUI
db_handle_selection Handler for user picking a job from list
db_command_handler Handle a user pick of the utility menu
DbDrawUtilityMenu Draw the utility menu
db_draw_utilities Draw a utility menu on the right side of main window.
DbViewJobMenu Update "View Job File" menu to list the in/output files for selected job
DbUpdateList Update the list of jobs displayed and save data to file.
db_update_list Draw any generic list of parameters from database to the job list window.
DbJobDescription Append all database information for one job into one string for display
Initialising, Loading & Saving the Database
DbInitialise Initialise project database.
DbLoadFile Load a database.def file into the database array
DbSaveFile Save the current contents of the database to database.def
DbRepair Repair a corrupted database array
DbLockFileName Return the lock file name
DbLockFileStatus Return status of lock file
DbLockFilePid Return the process id which owns the lock file for current project database
DbCreateLockFile Create a lock file
DbDeleteLock Delete lock file for current project database
DbChangeFile Change the project database
DbCreateNewFile Create new database file
Handling Input from Running Jobs
Handling Input from Running Jobs
DbReceive Update database parameters after receiving status report from external job
DbAddOutputFile Update list of job output files after receiving command from external job.
DbUpdateOutFiles Check the existence of the listed output files for a job
DbCheckOutputFiles Look through all jobs and check uniqueness of output file name
DbUpdateStatus For any job with status RUNNING check log file to see it it has finished
ReportJobFinish Read end of logfile to find termination status
DbHandleOverwrite Remove filename from database for file that user has opted to overwrite
Database Utility GUIs
db_archive_window Draw the window with archive/delete options
db_archive_window_update Update archive/delete window if user changes default
db_archive_handler Delete/achive output files & log file as specified in archive window
db_removeoutput_handler Delete all output files for the selected job
db_cleanup_handler Apply the defined cleanup after a job
db_restore_window Draw the window with file restore options
db_select_warning Write warning message if user picks utitlity menu without selecting job(s)
db_rerun Draw interface for rerunning a selected job
db_edit_info Edit the information stored for a job
db_load_taskinfo Load database data for job into a task array
DefFileName Return the full path name of a def file in project database directory
DbArchiveExists Look if there is archive file for filename
DbArchiveFile Archive or restore a file
ArchiveFileName Return the appropriate name for an archive file
db_edit_notebook Display & allow edit of the notebook for one job
DbMergeComFiles Merge com files for a job so they can be displayed
db_sort_tmpfiles Comparison command for lsort in DbMergeComFiles
DbKillJob Kill a job whose current status is REMOTE or RUNNING
DbStopJob Not implemented - stop job cleanly after next program finish
db_view_session_log Display the session log file
DbAutotest Handle command line running of autotest
db_autotest Interface to automatic regression testing - rerun jobs in project
db_autotest_handler Automatic regression testing - rerun jobs in project
AutotestRunjob Check status of automatic test jobs and start new job
UpdateAutoTestDef Update the def file when running regression tests
db_change_db Change the type of database used - not currently used
DbFlushCommandBuffer Flush the command buffer and execute the commands
DbGetBufferFile Return the name of the database command buffer file
Starting Jobs (src/runjob.tcl)
Starting Jobs
run_command Create a def file, add new job to database and run a job
RunScript Run a job - start a new ccp4i process and pass it the def file name
RunCshScript Placemarker for code to run csh scripts
RunFileCheck Before running a task check input files exist and output files do not.
InputFileCheck Check task input file exists and warn user if not
OutputFileCheck Check if task output file does not exist and offer to delete or abort
SetDefaultTitle Set a task title if user has not entered one
ChooseRunMode Present 'Remote' window for user to choose remote/batch mode
handle_chooserunmode Run remote/batch after user clicks 'Run' in 'Remote' window
Creating Windows (src/window.tcl)
Creating Windows
OpenWindow Open a graphical window
OpenGridWindow Similar to OpenWindow but uses grid geometry manager
CloseWindow Close a window opened by OpenWindow, OpenGridWindow or OpenTaskWindow
CreateFrame Set up a frame structure (i.e. folders) in a window opened by OpenWindow
CloseFrame End the definition of a frame.
OpenFolder Begin the definition of a folder in a task window
update_folder Update visibility of folder dependent on protocol defined by OpenFolder
update_folder_display Switch on or off the display of folders dependendent on the value of the switch parameter
OpenSubFrame Open a sub frame within the context of OpenWindow/CreateFrame or CreateTaskWindow
CloseSubFrame Close a sub frame
toggle_frame_display Set up a trace command for handler controlling visibility of a line or subframe
update_frame_display Handler controlling visibility of a line or subframe
update_table_row Toggle the display of a line in the table dependent on value of some varaible
scrolled_frame Create a scrollable frame
update_main_scroll Update the scrollable extent of a task window.
UnsetArrayExtras Delete the 'extra' elements from a task window array
run_update_script After defining a new window tidy up the extending frames
GetNewWindowName Return a unique name for an array root_$n
Help, Message Line and Wait Commands
SetProgramHelpFile Set the name of the help file for the current window
KeywordHelp Open a web browser to display a help document.
SetMessage Bind cursor entering a widget to putting text in the message line
set_message Display the given text in the message line
PleaseWait Display a 'Please wait' message
TkBusy' Iteratively set the cursor for all child windows to a watch/arrow
TkBusy Set the cursor style for a window and all of it's children
File Selection Widgets
CreateInputFileLine Draw a line to select an input file
CreateOutputFileLine Draw a line to select an output file
FileViewer0 Extracts file name from a data array and passes to FileViewer
FileDialog Open a file selection dialog box associated with one file input line
DirBrowser Present a 'file' browser for user to select a directory
CheckFileInput Check user input to file selection and return 1 if OK, 0 otherwise
ResolveUnixFileSymbols Interpret tilda or environment variable, or a relative path
IsPathADefaultDir Check if explicitly entered path corresponds to a project or aliased directory.
CheckDirInput Validate user input of directory path
update_default_dir Update the path to file name in file selection line when user changes default directory
MoveFileNameLeft For long file name move position of file name in widget
UpdateOutputFilename Derive an output file name from an input file name
add_file_command Bind a command to be issued after user has selected a file
SetParamFromFile Handler for the -setfileparam argument to CreateInputLine
GetParamFromFile Get specified type of data from a specified file header
The Generic Line Widget
CreateLine Draw a line in a window
CreateLineTemplate Define a template for the layout of a line
PackByTemplate Apply the template defined by CreateLineTemplate to pack a line
UpdateDependentParams Callback afer user selects item from menu update the array element
initialise_menu Create a menu or reinitiallise an existing one
UpdateVarLabel Update a variable label to an explicitly entered value
update_varlabel Update a variable label when the associated variable is changed
add_command Bind a command to a widget which may be a menu or an entry widget
paste_into_entries Paste into multiple fields
continue_paste Handler for user input for paste GUI
toggle_on Handler to toggle on a checkbutton when user inputs anywhere on a line
check_input Check entry widget input is consistent with data type
set_field_colour Set the colour of an input widget dependent on validity of user input
Other Complex Widgets
CreateButton Create an action button in the 'button' frame of a window created by 'CreateFrame'
CreateText Create a Tk text widget, optionally scrollable.
AppendTextWindow Append text to CreateText widget
break_menu_column Internal procedure to set the -columnbreak value for items in a menu
Task Window Utilities (src/taskwindow.tcl)
Task Window Utilities (src/taskwindow.tcl)
RunTask Initialise parameters for task and draw task window
draw_task_window Procedure called at end of RunTask to actually put the window on the screen
CreateTaskWindow Called from taskname_run to define general appearance of task window
DrawRunButton Draw the 'Run' button for task windows
UnsetProjectDefault Handle 'Unset Project default' option on Save or Restore menubutton
task_display_log Handle option to 'Display Log FIles' which is presented to user in 'task' mode of running ccp4i.
redraw_task_window_title Redraw task window title with information on the origin of the initial parameters
SaveUserDefinedDef Handler to save current parameters to user specified file
SaveProjectDef Handler to save current parameters to the user or the project default file.
RedrawTaskWindow Redraw a task window from scratch after destroying existing window.
ReCreateTaskWindow Load parameters from a def file and redraw the task window.
DeleteTaskWindow Close a task window cleanly.
SaveOnProgramExit Specify a task array which will be saved to a def file if the user exits the interface.
ExitInterface On exiting the interface save the status file and database file
CreateTitleLine Draw the title line which is standard at top of task window.
check_title_line Hander when user enters title line test to remove 'bad' characters
WriteCredits Write author credits at bottom of task window
Extending and Toggle Frames (src/exframe.tcl)
Extending and Toggle Frames
CreateToggleFrame Create a toggle frame widget
create_toggle_button Create the title line for the toggle frame
SetToggleTitle Reset the title for a toggle frame
update_subframe_display Update the visiblity of a toggle frame.
UpdateExtendingFrame Explicit programmer command to add or remove lines from an extending frame
set_open_frame Save information on the currently open frame (i.e. the one currently being drawn) to the systemvar array.
create_addline_command Draw the Edit menubutton and the increment button for toggle frames and extending frames.
exframe_select Update the edit menu button after the user has selected a row for editting
exframe_edit Handle mouse click tied to editting extending frames
delete_frame Delete a frame
delete_frame_data Delete the data when a frame is deleted
unset_child_indexed_params Unset the array variables for all the child frames of def_proc
copy_frame Copy the data in one row to another row
copy_frame_c1 Copy parameters of a child frame from one parent (from) to another (to)
append_extend_frame Add another frame to the bottom of extending frame
append_toggle_frame Add another frame to the bottom of a toggle frame widget
append_frame_c1 Draw child frames when called from append_*_frame
bind_edit_select Add the edit function right-mouse button bindings
SetIndexedParam Assign values to a group of indexed elements with the same index
UnsetIndexedParam Unset the elements of array for a parameter, its data type and widget
Using the BLT Table Widget
Using the BLT Table Widget
CreateTable Create a table using the BLT table function
CreateTableTitle Draw column titles in table
table_edit_buttons Draw the edit menu button and increment button under the table
TableDrawRow Draw one row of a table
TableAddRow Add an extra row to the table to support the edit functions
TableDeleteRow Delete a row from the table
TableDeleteContents Delete the entire contents of the table but keep the column titles.
TableGetExtent Return the Cnumber of rows in the table
get_table_extent Return the Cnumber of rows in the table
TableUpdateScroll Update the scrollable area of the table.
Variable Menus (src/varmenu.tcl)
Variable Menus
create_varmenu Called from CreateLine procedure to update array(DEPVARS_$deflistVar)
UpdateVariableMenu Invoked by user to update the variable menu
update_varmenu Handler to update one item of variable menu
update_menu Called from UpdateVariableMenu to redraw the menu(s) associated with one variable.
update_menu0 Update each individual instance of a variable menu
General Utility Windows (src/util_windows.tcl)
General Utility Windows
WarningMessage Output a 'warning' message to the user - the one default action is 'Dismiss' to close the window.
warning_message_command Handler for exit button on the warning message window
ChooseOptionDialog Give user multiple choice with one button per option
choose_opt_command Handler for action buttons on the choose option window
choose_opt_sel handler for listbox selection in ChooseOptionDialog listbox mode
InputParamDialog Present user dialog box with simple list of variables to edit
EditComFile Display a program command script and command line for user to edit
handle_edit_com_file Handler for action button in EditComFile
Code for Uniqueify, Harvesting and HKL Rejects
UniqueifyFrame1 Uniqueify interface - a fragment of several task interfaces
UniqueifyFrame2 Uniqueify interface - a fragment of several task interfaces
SetHarvestParams Initialise parameters for tasks which interface to harvesting mechanism
CreateHarvestLine Draw the two lines interface to harvesting commands
UpdateHarvestMTZ Fill in default project and dataset name when the user selects MTZ
HklRejects Define one line of extending frame for rejects in combat/scalepack2mtz/d*trek
File Selection Window (src/fileselect.tcl)
File Selection Window
SelectFile Open a file seelction window
fileselectDefdir Update file list when user changes the default directory alias
fileselectFilter Handle user changing the filetype selection filter
fileselectViewers Set up the menu to allow user to select a viewer for a given file type.
fileselectList Update list of directories and files visible to user
fileselectOK Handle user selection of a file or directory
fileselectCancel Handle user clicking the cancel button.
fileselectClick Take the file item the user clicked on in listbox
dirselectClick Take the directory item the user clicked on
fileselectTake Take the currently selected list item
fileselectComplete Do file name completion for the file name in the input text widget
up_directory Handle user selection of the 'go up a directory' widget
sort_files Sort list of files by criteria of date or name
compare_date The sorting procedure for the Tcl lsort command sorting by date
display_file_list Put list of files into display listbox
Projects and Directories Interface (src/directories.tcl)
Projects and Directories Interface
directories Initialise interface if user open the 'Directories' window stand alone.
check_directory_alias Check that user input project or directory alias is unique
DefineDirectory Create the graphics for defining one directory
DefineProject Create the graphics for defining one project
undo_DefineProject Handler when user removes project definition from the extending frame list
Directories Draw the 'Projects and Directories' window
exit_directories Handle updates on exiting the window
make_one_word Force all project and directory aliases to be one word
File Viewer (src/fileviewer.tcl)
File Viewer
fileviewer Setup procedure called if file viewer is run stand-alone
ExitFileViewer Called on exiting file viewer - will terminate process in stand-alone mode
FileViewer Display a file
fileviewer0 Display a file
LOGViewer Display a log file
LogGraph_graph Use loggraph to display data from a 'graph' file
LogGraph Display files using ccp4i loggraph
PDBViewer Display PDB file as text
MAPViewer Use mapdump to read map header and display this
MTZViewer Use mtzdump to read mtz header and display this
mtzviewer_info pass-thru to set up new global array
mtzviewer_info0 Handle option for Extra Information when displaying MTZ files
mtzviewer_info_handler Handle the 'Run' command for mtz_info - Run mtzdmp or sftools
mtz_info_review Review and display the output from the mtz_info task
PSViewer Display a postscript file
XMGRViewer Display xmgr file - as output by scala
PLOT84Viewer Use xplot84driver to display a plot84 file
PLOT84PSViewer Convert plot84 format file to PostScript and display with PSViewer
MRViewer Display (and edit) a mr (molecular replacement) file
HAViewer Display (and edit) a ha (heavy atom) file
mr_ha_viewer Pass-thru to mr_edit task which will display & edit mr and ha files
RunRasMol Run RasMol to display coordinates
RunMapslicer Run the mapslicer program
DisplayTextFile Display a text file
LoadTextWindow Load the text into the window set up by DisplayTextFile
display_next_frame handle the display of the next frame of text if displlaying a very large file
display_text_update_case Handle user changing the respect/ignore case option
display_text_close Handle user clicking Close button.
display_text_save Handle user opting to save contents when using 'edit' mode
display_text_find Handle user hitting Find or 'Close Find' button
display_text_find_string Find and highlight given string in the text
display_links Dispaly links in log file
MonitorFile Read and display a file that is still being written
display_text_summary Handle the 'Show Summary' option
display_text_full Handle the 'Show Full Text' option
ExtractLogSummary Extract the text tagged as 'summary' from a log file
HilightLogSummary Highlight the sections of log file which are tagged as 'summary'
GetViewerList Extract the list of file formats, viewers and full viewer commands from the typedef array
Utilities called from Run Scripts (src/execute.tcl)
Utilities called from Run Scripts
ExecuteScript Read the def file and source the run script.
GetJobid Return the job id
SetOutputFileRoot Return a root file name which identifies the job that created the file
Execute Execute a command and handle editting of command script and program failure.
AppendCommand Append the command line as a comment to input script
TerminateScript Cleanly terminate a run script process and notify the main CCP4i proccess
InitialiseLog Write ccp4i header to the log file for the job
WriteTerminationToLog Write ccp4i footer to the log file
WriteToLog Write comments to log file with wrappers to indicate that comments are from ccp4i script.
WriteHtml Write an html tag to log file
WriteTable Write a neatly formatted table to log file or other summary file
Creating the Program Command Script
CreateComScript Create the program command script using a template.
UpsetVar Set a variable at a higher level in the procedure calling stack
set_at_filename Handle the AT command in a com file - save the name of a file to be sourced
get_at_filename Return the name of the 'AT' file
set_label_stack Handling the LABELLINE keyword for MTZ LABIN/LABOUT
getcomline Read the next line from the 'com' template file
Automatic Test Mode
ExecuteAutoTest Execute a script in autotest mode
UpdateAutoTestDef Copy def file to working test directory and update the def file header and file names
Procedures for Communication to Main CCP4i Process
RunNotification Send message to main CCP4i process to say this process is running
FailNotification Send message to main graphical CCP4i process to say this process has failed
AddOutputDir Notify the main CCP4i process of additional output dirs
AddOutputFile Notify the main CCP4i process of additional output files
Communication between Script not written in Tcl and CCP4i
ExecuteSocket Use ccp4ish to communicate to CCP4i main process from a non-Tcl script
BufferSocketCommand Add a command to the buffer for execution later
GetBufferFile Return the name of the database command buffer file
OpenSocket Open a client side socket to connect to the server in the main CCP4i process
GetServerPort Return server port for CCP4i process associated with current project
Map Handling Utilities (utils/map_utils.tcl)
ExtendMap Interface to mapmask program to extend map to cover molecule
ConvertMapAsu Run mapmask convert map to cover the standard CCP4 asymmetric unit
ConvertMapFormat Convert from CCP4 to alternative map formats
CreateMap Create a map of optional type in various formats
MakeOMapMacro Create a macro for O to display map(s)
MakeXtalMacro Create a macro and crystal file for xtalview to display map(s)
GetCellfromMtz Extract header information from an MTZ file
GetMapHeader Extract header information from a map file
ConvertMapCell Extend map to cover unit cell
WatPeak UNTESTED Search input differnce map for water peaks
AddXtalMapFom Add an extra column of dummy FOMS to an XtalView phases file
CalcCellVolume Calculate the cell volume
Coordinate Handling Utilities (utils/pdb_utils.tcl)
CalcCellVolume Get the atomic contents of PDB file
AtomType Return the Element name for a given atomic number
GetAminoInfo Return some information for a given input amino acid type
ParsePDBId Extract the cards relevant to the atom id from a PDB ATOM line
ParsePDBIz Extract atomic number from PDB atom card (or element type from name)
PDBRemoveZeroOcc Remove atoms with zero occupancy from PDB file
ExtractPdbColumns Extract columns from the ATOM records of a PDB file
MergePdbFiles Merge 2 or more PDB files
PdbGetChains Get a list of the chains and the first & last residue ids in a PDB file
ReadSequence Read a sequence file
HandleHarvestFile Add the output harvest file to the output file list for a job
FindNCSTransforms For multi-chain PDB find the inter-chain transformations using Lsqkab program
Mol Procedures for Handling Coordinate Data
MolReadPDB Read some or all atoms from a PDB file into the Mol array
MolReadCif Read atoms from a CIF file into the Mol array
read_cif_name Strip the inverted commas (quotes) from a cif atom name
MolReadSybyl Read some or all atoms from a Sybyl file into the Mol array
MolConvertSybylType placemarker for code to convert Sybyl atom types
MolConvertSybylBond placemarker for code to convert Sybyl bond types
MolBoundingBox Find centre of mass and bounding box for coordinates in Mol
MolTranslate Apply a translation to all coordinates in Mol array
MolWriteCifCoords Write out a CIF coordinate format file
write_cif_name Put quotes about name if it contains a quote character
MolReadPdbRestraints Read MODRES/SSBOND/LINK/CISPEP cards from pdb file
MolCheckPdbRestraints Not implemented - should check sensible restraints defined
MolCheckReadFile Not implemented - should check sensible atom name input etc.
MolFindFragments Find all the separate non-bonded fragments in Mol array
MolChiralVolume Find the chiral volume of four atoms in the Mol array
MolSaveParam Make a backup of Mol array values
Utilities for Phasing Tasks (utils/phasing_utils.tcl)
ExtractShelxLog UNTESTED - Extract info from the Shelx log file
MakeShelxDismat Convert the distance list from shelx log file into a neat distance matrix
NpoMapScale Devise scale for NPO plots with orthogonal sections on same scale
FindScaleitDiff Run scaleit to find optimal value for exclude cutoff for Patterson
scaleit_analysis Extract date from scaleit log file for correlation analysis
scaleit_write_tab Write the summary of the scaleit log file(s) to the table file
Uniqueify Run the Tcl version of 'uniqueify' script to standardise MTZ and add FreeR column
AMoRe Utilities (utils/amore_utils.tcl)
amore_get_tabling_data Extract data from the amore tabling log file
amore_calc_model_cell Use the model extent and radius to calculate reasonable model cell
amore_get_log_solution Extract solutions from log file
amore_update_database Update the mr_database.def file
amore_get_solution Extract solutions from an 'mr' file and write in input format for Amore
amore_block_mr_database send command to main ccp4i to block update of the mr database
Utilities for managing task installation (src/CCP4i_packages_utils.tcl)
Utilities for managing task installation
InstallTaskPackage Driver procedure to perform installation of a new task
ExportTaskPackage Driver procedure to create a task package archive file
UninstallTaskPackage Driver procedure to uninstall a previously installed task package
ExamineTaskArchive Examine the contents of a task archive package file
MakeTmpTaskInstallDir Create a temporary directory in which to unpack an archive file
GetTaskInstallDir Return the root path for the installation area
GetTaskInstallFileDir Return the root path for the installation modules and packages files
UnpackTaskArchive Unpack a CCP4i task package archive file.
GetPackageList Return a list of CCP4i package names from a ccp4i_packages.def file
GetPackageFiles Return a list of files for a package registered in a CCP4i subdirectory
GetPackageReferences Return a list of associated task references registered with a package
GetPackageVersion Return the version string of a CCP4i task package in the ccp4i_packages.def file
UpdatePackagesEntry Update an entry in a ccp4i_packages.def file
RemovePackagesEntry Remove an existing entry from a ccp4i_packages.def file
CreateTarFile Apply 'tar cf' to dir to create a tar file
ValidatePackageName Check that the supplied package name is valid
ComparePackageVersions Compare version strings for CCP4i task packages
InstallReport Report a message from the install procedures.
Vector and Matrix Arithmetic (src/vector.tcl)
vmult return vector (a list) which is vector a multiplied by factor b
vdotp return the dot product of two vectors
vlen return the magnitude of the vector
vdist return the distance between two points
vadd return the sum of two vectors
vsub return the difference of two vectors
vcent return the average coordinate of a list of 2D coordinates
vscal return vector (a list) which is vector v scaled by factor s
vrot Apply a rotation to a 2D coordinate
vmatmult apply rotation matrix rmat to vector a
vmirror apply a mirror transformation in x or y axis