Google

CCP4i Documentation for Programmers: Core Documentation

Contents

Handling CCP4-Specific File Formats

InitialiseProject The place for CCP4 specific initialisation

Argument list: None

InitialiseProject Load data from file CCP4/lib/data/symop.lib & CCP4/ccp4i/etc/crystal.lib

Argument list: None

Loaded into crystal_data array

ReadCrystalData Read etc/crystal.lib file and extract crystallographic info

Argument list: <file>

Save to array crystal_data

There are crystal_data(N_LAUE) laue groups stored as listof space groups in crystal_data(LAUE,$spgp)

The patterson info for space group spgp is stored in crystal_data(PATTERSON,$spgp) and is a list consisting of: patterson_spsgp_number, number of harker planes, definifion of planes

file Full path name of crystal.lib file

MTZ Column Selection

MTZ Column Selection

CreateLabinLine and CreateLaboutLine are the APIs with a lot of support procedures. There is also CreateCadLabinLine which is for the customised labin lines used in the CAD interface.

CreateLabinLine Draw task interface line for selecting input MTZ column labels

Argument list: <linein> <message> <filein> <label1> <name1> <\>

The MTZ label line can allow the user to select either one or two MTZ labels. The second label is expected to be associated with the first (such as a sigma or weight) and when the user selects the first label then the second is automatically updated to be the next column in the MTZ file (assuming that it is the appropraite label type). The label types are defined in CCP4I_TOP/etc/types.def

This procedure sets up commands so that when the user selects an input MTZ file the column names in the file are automatically read by the procedure ExtractMTZData and the menu(s) for users to select the column labels is updated by SetLabin

linein Output Tk frame id for the line

message Message line which appears if cursor over this line

filein Name of element in the task interface array which contains the name of the input MTZ file

label1 Text to appear in the task interface line

name1 Name of the element in the task interface array which contains the name of the input label

priority_name_list1 A list of possible column label names - if one of these appears in the MTZ file then it is set as the default.

-sigma label2 name2 priority_name_list2

The label, element name and priority labels for the second MTZ label

-toggle_display toggle_var toggle_state toggle_hitlist

Display this line in the task window dependendent on the value of toggle_var. If it takes any of the values in the list toggle_hitlist then set the display status to toggle_state. toggle_state can be 'open', the line is displayed, or 'hide', the line is not displayed.

SetLabin Handler to update Labin menu after user has seelcted MTZ file

Argument list: <arrayname> <filename> <args>

arrayname Name of data array

filename Element of array which contains the MTZ file name

labin_element1...labin_elementn Any number of elements of the array which are the input column labels which map onto the labin menu widgets

-setallelements

Flag that the labin elements are part of extending frames and have multiple instances with names element,n. Update the menus for all instances of the element

SetLabinUnassigned Set labin menu to 'Unassigned' if the user has deselected an MTZ file

Argument list: <arrayname> <element> <args>

arrayname Name of data array

element Name of labin element in array

-setallelements

Flag that the labin element is part of extending frames and has multiple instances with name element,n. Update the menus for all instances of the element

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

Argument list: <selection> <arrayname> <param0> <args>

selection The selected value for the first labin

arrayname Name of data array

param0 The name of the array element which contains the first labin on the CreatelabinLine

param1...paramn A list of the dependent labin elements. There is usually just one for the second labin in the CreateLabin line

SetLabelList Save a list of allowed column labels and types a labin array element

Argument list: <arrayname> <element> <name_list> <type_list> <mode> <>

This list corresponds to the list of values presented in the menu

arrayname Name of data array

element The name of the array element which contains the labin

name_list List of valid column names for this labin

type_list List of the column types for these column names

mode Optional 'append' to append to existing list, otherwise overwrite

GetLabelList Return the list of allowed column labels and types for a labin array element

Argument list: <arrayname> <element> <name_listVar> <type_listVar>

This list corresponds to the list of values presented in the menu

arrayname Name of data array

element The name of the array element which contains the labin

name_listVar Output. List of valid column names for this labin

type_listVar Output. List of the column types for these column names

ListAllLabels List all column labels in MTZ file to support the 'List all Labels' option on column label menu

Argument list: <arrayname> <element> <file>

arrayname Name of data array

element The name of the array element which contains the labin

file The full path name for the MTZ file

handle_list_labels handler to update column label when it is selected from 'List all Columns'

Argument list: <w> <arrayname> <element>

w The Tk id of the listbox which listed all column labels

arrayname name of data array

element Name of element in array containing the selected column name

EnterLabel Window for user to type colum label to support 'Enter Label' option on columns menu

Argument list: <arrayname> <ele>

arrayname Name of data array

ele The array element for the column label

CreateCadLabinLine Display the MTZ label selection line used in the Cad task interface

Argument list: <linein> <message> <filein> <label1> <name1> <label2>

See the Cad task interface for normal useage

linein Output Tk frame id for the line

message Message line which appears if cursor over this line

filein Name of element in the task interface array which contains the name of the input MTZ file

label1 Text to appear in the task interface line

name1 Name of the element in the task interface array which contains the name of the input label

label2 Text to appear in the task interface line

name2 Name of the element in the task interface array which contains the name of the output label

label3 Text to appear in the task interface line

type The MTZ column type for the output column

cad_update_labin Handler for CreateCadLabinLine to create menu of input column names

Argument list: <arrayname> <index> <name1> <name2> <type>

This procedure is invoked when an input MTZ column is selected from menu. The default values of the output column name and type are set to be the same as those of the input column.This procedure has an input 'index' which indicates which of the multiple column selection lines has been changed by the user. The procedure is complicated by the fact that the Cad task may have more than one input MTZ file and with multiple MTZ files then the 'index' parameter is 2-dimensional. The procedure GetLabelList is called to get a list of the column names and types associated with this column selection line and the list of names is searched to find the index in the list of the column selected by user. This index is then used to extract the correct column type from the list of columns.

arrayname Name of task interface array

index The number of the column selection line that is been updated

name1 Name of the element in the task interface array which contains the name of the input label

name2 Name of the element in the task interface array which contains the name of the output label

type The MTZ column type for the output column

CreateLaboutLine Draw a task interface line for user to specify output MTZ column name

Argument list: <linein> <message> <fileout> <label1> <name1> <args>

linein Output Tk frame id for the line

message Message line which appears if cursor over this line

fileout Name of element in the task interface array which contains the name of the output MTZ file

label1 Text to appear in the task interface line

name1 Name of the element in the task interface array which contains the name of the output labelpvar {$linein} line

CheckLabout Procedure to be called before running a task to check uniqueness of output MTZ column names

Argument list: <arrayname> <labout> <hklin>

Not currently used - code may not be reliable

arrayname Name of task interface array

labout Name of element in array which contains a list of the array elements which are output column labels.#d_arg hklin Array element which contains the name of the input MTZ file

PackLabinLine Pack, i.e. set the layout, of the task interface line to select MTZ columns

Argument list: <line> <args>

This procedure is needed to complement CreateLabinLine. When CreateLabinLine calls CreateLine with the line format 'MTZlabel' line procedure is used to layout the line.

Tk frame id for the line

Extracting Data from Map Files

InitialiseMAPData Initialise the MAP_file_data array with header info from the last selected input CCP4 map file.

Argument list: None

ReadCCP4Map Read a CCP4 map file using mapdump and return program output

Argument list: <file> <ttVar>

file Input map file name

ttVar Returned text output by mapdump program

ExtractMAPData Read header info from a CCP4 map file and save to MAP_file_data array

Argument list: <file>

file Input map file name

Extracting Data from PDB Files

InitialisePDBData Initialise the PDB_file_data array which holds header parameters from the last selected input PDB file.

Argument list: None

ExtractPDBData Read header from PDB file and load params into global array PDB_file_data

Argument list: <file>

GetCCP4SpaceGroup Return space group in CCP4 format

Argument list: <spacegp>

Extracting Data from MTZ Files

SetMtzParamField Put data value from MTZ header into an array element

Argument list: <paramtype> <arrayname> <filename> <element>

paramtype Parameter type - must one of the names of elements in MTZ_file_data array

arrayname Name of data array

filename Name of array element containing MTZ file name

element Name of array element to receive data from MTZ

GetMtzParam Return a specified data item from specified MTZ file

Argument list: <file> <param> <dataVar>

file MTZ file name

param Parameter type - must one of the names of elements in MTZ_file_data array

Returned data value

InitialiseMTZData Initialise the MTZ_file_data array with header info from the last selected input MTZ file

Argument list: None

ReadMTZ Read an MTZ file using mtzdump and return program output

Argument list: <file> <ttVar> <mtzdmp_args> <HEADER>

file Input MTZ file name

ttVar Returned text output by mtzdump program

mtzdmp_args (Optional, default=HEADER) Arguments to the mtzdump program.

ExtractMTZData Read header info from an MTZ file and save to MTZ_file_data array

Argument list: <file>

file Name of MTZ file

InitialiseParamFromFile Initialise the *_file_data arrays containing data from map/pdb/mtz file headers

Argument list: <format>

This is called when user loads a new def file into task and (possibly) changes the selected files from which header data has been loaded

format pdb, mtz or map or 'all' for al three

GetMtzColumnList Return the labelled columns of a specified type and one default

Argument list: <file> <name_listin> <type_listin> <default_name_in>

This procedure calls GetMtzColumnByType to recover the list of columns and then searches the list for any column name which matches any of the priority name list input to CreateLabinLine. This procedure, itself, is just setting the default selected column that the user sees immediately after selecting an MTZ file.

See also the docs for GetMtzColumnByType

file Name of MTZ file for which info required

name_listin Output. List of selected column names

type_listin Output. List of the types of the selected columns

default_name_in Output. The name of one default column

select_type A list of one or more required column types

priority_name_list A list of the preferred column names for the default

name_listin2 Output. List of selected column names

type_listin2 Output. List of the required column types

default_name2_in Output. The name of one default column

select_type2 Optional. A list of one or more required column types

priority_name_list2 A list of the preferred column names for the default

GetMtzColumnByType Return the labelled columns of a specified type found in an MTZ file

Argument list: <file> <select_type> <name_listin> <type_listin>

This procedure calls ExtractMTZData which loads the MTZ header info into the MTZ_file_data array if that array does not already hold data for the specified file. This procedure can output either one or two sets of selected columns. The second set of columns is expected to be something like a sigma or a weight and a column in this set is expected to appear in the MTZ file immediately after a column from the first set. If a column from the first selected set is followed in the MTZ file by a column of type unsuitable for the second set then the value 'Unassigned' is appended to the second set.

file Name of MTZ file for which info required

select_type A list of one or more column types which the selected columns may have.

name_listin Output. List of selected column names

type_listin Output. List of the types of the selected columns

select_type2 Optional. A list of one or more column types which the selected columns may have.

name_listin2 Output. List of selected column names

type_listin2 Output. List of the types of the selected columns

Accessing Standard Crystallographic Data

GetSpaceGroupNumber Return space group number from input space group code

Argument list: <code>

code space group code (or number will be handled OK)

GetSpaceGroupCode Return CCP4 space group code from input space group number

Argument list: <number>

number space group number (or code will be handled OK)

GetSpaceGroupStdCode Return PDB standard space group code from input space group number

Argument list: <number>

number space group number (or CCP4 code will be handled OK)

GetSpaceGroupNops Return the number of symmetry ops for a space group

Argument list: <number>

number space group number (or CCP4/PDB code will be handled OK)

GetSpaceGroupLattice Return the crystal lattice for a space group

Argument list: <number>

number space group number (or CCP4/PDB code will be handled OK)

GetSpaceGroupSymops Return the symmetry ops for a space group as a list

Argument list: <number>

number space group number (or CCP4/PDB code will be handled OK)

GetAsymUnit Return the CCP4 standard asymmetric unit

Argument list: <spgp_code>

spgp_code Space group code (CCP4 or PDB) or space group number

GetLaueGroupNumber Return an identifier for the laue group

Argument list: <spgp_code>

Will return 0 if not in the LAUE list from etc/crystal.lib file

spgp_code Space group code (CCP4 or PDB) or space group number

GetLaueGroup Return a list of space groups in given Laue group

Argument list: <laue_no>

laue_no Laue group number

GetPattersonSpaceGroup Return the Patterson space group for given space group

Argument list: <spgp_code>

spgp_code Space group code (CCP4 or PDB) or space group number

GetHarkerSections Return the Harker sections for given space group (as Tcl list)

Argument list: <spgp_code> <modein> <2>

spgp_code Space group code (CCP4 or PDB) or space group number

modein Maximum number of sections returned (or all). Optional, default 2

GetFFTSpaceGroups Get a list of space groups supported by FFT program

Argument list: <spgpVar>

spgpVar Returned list of space groups

GetChangeHandData Get resultant space group and transformations fro changing hand of data

Argument list: <spgp_code> <space_groupVar> <cxVar>

spgp_code Space group code (CCP4 or PDB) or space group number

space_groupVar Returned. Space group for data on changed hand

cxVar Returned. Tcl list of cx,xy,cz where change of hand tranformas x,y,z to cx-x,cy-y,cz-z

GetTwinData Get the transformation(s) for twinned data

Argument list: <spgp_code> <cxVar>

spgp_code Space group code (CCP4 or PDB) or space group number

cxVar Returned. A Tcl list of transformations of form -h,-k,l

GetLatticeFromSpaceGp Return the lattice type from space group name ('cos shelx can not!)

Argument list: <spacegp> <args>

shelx number code: P = -1 I = -2 F = -4 A = -5 B = -6 C = -7

spgp_code Space group code (CCP4 or PDB) or space group number

-shelx

Return the Shelx numbering code