|
CCP4 Molecular Graphics Documentation |
|
Picture Definition File Object Attributes |
This documentation page has not been updated for CCP4mg 2.0.
The page will be updated soon and will be available as part of the
programs automatic update. If you have any queries meantime please contact
ccp4mg@ccp4.ac.uk
Introduction
This document lists the attributes associated with each type of data object and display object for the benefit of anyone writing or editing a picture definition file. Note that, rather than create a picture definition file from scratch, it is probably much easier to set up a display within CCP4mg, save a picture definition file and edit it.
There are some attributes which are common to all data objects and display objects and these are described first.
Data Object Attributes
attribute |
key |
data type |
default |
description |
name |
|
string |
Derived from data filename |
Must be one word and unique |
filename |
|
list of three strings |
['','',''] |
See below |
visible |
|
logical (0 or 1) |
1 |
If 0 then all display objects are not displayed |
Display Object Attributes
attribute |
key |
data type |
default |
description |
name |
|
string |
Derived from name or parent data object |
Must be one word and unique |
visible |
|
logical (0 or 1) |
1 |
If 0 then objects is not displayed |
transparent |
|
logical (0 or 1) |
0 |
If 1 object transparent with opacity |
opacity |
|
float range 0.0 to 1.0 |
1.0 |
0.0 is totally transparent, 1.0 is totally opaque |
MolData
attribute |
key |
data type |
default |
description |
transform_matrix |
|
list of 16 floats |
[1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
0.0,0.0,0.0,1.0 ] |
coordinate transformation see here |
load_animation |
|
dictionary |
|
Details of loaded animation see here |
|
filename |
list of three strings |
['','',''] |
For file_format 'multiple_PDBs', first of PDB files defining trajectory.See below. |
| file_format |
string |
'multiple_PDBs' |
'multiple_PDBs' or 'NMR_models' |
| frame_range |
list of 2 integers |
|
First and last frame; reset on loading trajectory |
| current_frame |
list of 2 integers |
[-999,1] |
The current frame number (or -999 for unset) and the increment for next frame (1 or -1) |
|
legend_name | | | | |
DSSP_file | | list of three strings | ['','',''] | A DSSP file containing secondary structure assignment | |
symmetry | | | | | |
MolDisp
attribute |
key |
data type |
default |
description |
selection |
|
string |
'all' |
a selection command |
selection_parameters |
|
dictionary |
|
Selection details for consistent GUI. See below |
colour |
|
string |
'atomtype' |
colour scheme see below |
colour_parameters |
|
dictionary | |
Colouring details.See below |
style |
|
string |
'BONDS' |
drawing style |
style_parameters |
|
dictionary | |
Drawing style details.See below |
drawing_style |
string |
The name of a model drawing style parameters manager associated with this display object |
selection_parameters keys
selection_parameters is a dictionary attribute of a MolDisp object which should provide sufficient information to correctly initialise the selection menu on the MolDisp GUI. The selection attribute, on its own, is enough to define which atoms are displayed. The most important item in the dictionary is the select key which indicates which selection mode is being applied. Dependent on the value if the select key, various other items will be necessary in the dictionary.
key |
select value |
data type |
description |
notselect |
Any value |
logical (0 or 1) |
If 1 then display all atoms but those selected. |
ranges |
'peptide', 'main', 'side' or 'catrace' |
list of strings |
Each item is residue range e.g. '//A/25-47'. |
secstr |
'peptide', 'main', 'side' or 'catrace' |
list of strings |
Each item is secondary structure type ('SSE_None', 'SSE_Strand', 'SSE_Bulge', 'SSE_3Turn', 'SSE_4Turn', 'SSE_5Turn', 'SSE_Helix') |
restype |
'restype' |
list of strings |
Each item is a residue type (e.g. 'ALA' or 'T') |
elementtypes |
'elementtypes' |
list of strings |
Each item is an atomic element (e.g. 'C') |
property |
'property' |
list of strings |
Each item is a property ('B', 'OCC', 'X', 'Y', 'Z', 'ATOM_SAS', 'RES_SAS', 'ATOM_CONTACT', 'RES_CONTACT', 'SEC'). |
property_lt_value |
'property' |
list of floats |
Lower limit to property value. List must be same length as property list. |
property_lt_op |
'property' |
list of strings |
Less than operator ('<' or '<='), must be same length as property list |
property_gt_value |
'property' |
list of floats |
Upper limit to property value. List must be same length as property list. |
property_gt_op |
'property' |
list of strings |
Greater than operator ('>', '>=' or '=='), must be same length as property list. |
neighb_mol |
'neighb' |
string |
MolData object >name for the central atoms - default is the parent MolData |
neighb_sel |
'neighb' |
string |
a selection commands command for the central atoms |
neighb_rad |
'neighb' |
float |
selection radius |
neighb_hb |
'neighb' |
logical (0 or 1) |
If 1 select only those groups which HBond to central atoms |
neighb_group |
'neighb' |
string |
Group of atoms to select: 'atom', 'residue', 'chain', 'model', 'catrance', 'main', 'side', 'main_side', 'solvent' |
neighb_excl |
'neighb' |
logical (0 or 1) |
If 1 then exclude the central atoms |
neighb_excl_solvent |
'neighb' |
logical (0 or 1) |
If 1 exclude solvent |
neighb_excl_monomer |
'neighb' |
logical (0 or 1) |
If 1 then exclude atoms in momomers |
neighb_excl_peptide |
'neighb' |
logical (0 or 1) |
If 1 exclude peptide bond atoms |
neighb_selobj |
'neighb' |
string |
A MolDisp name; alternative to neighb_sel for selecting central atoms - only used if neighb_sel is undefined. |
neighb_and |
'neighb' |
logical (0 or 1) |
If true combine the main neighbourhood selection by a logical operation 'and' with neighb_and_selection or neighb_and_selobj |
neighb_and_selection |
'neighb' |
string |
A selection command. If neighb_and is true then only the neighbourhood atoms that are also in this selection are included in the final selection. |
neighb_and_label |
'neighb' |
string |
A simple label describing the neighb_and_selection which will appear in the GUI. |
neighb_and_selobj |
'neighb' |
string |
A MolDisp name; alternative to neighb_and_selection for selecting the central atoms. |
buried_sel |
'buried' |
string |
a selection commands command for a group of atoms that may exclude solvent (i.e. bury) the atoms in selection buried_and_selection |
buried_and_selection |
'buried' |
string |
A selection command. Find the atoms in this selection that are buried by the atoms in buried_sel. This must be defined. |
buried_and_label |
'buried' |
string |
A simple label describing the buried_and_selection which will appear in the GUI. |
buried_and_selobj |
'buried' |
string |
A MolDisp name; alternative to buried_and_selection. Only used if buried_and_selection is undefined. |
cid |
'cid' |
string |
cid=coordinate id. A selection command that should be the same as the MolDisp selection |
selection_scheme |
'selection_scheme' |
string |
The name of a saved selection. |
colour_parameters
colour_parameters is a dictionary attribute of a MolDisp object which contains information in addition to the colour attribute. No colour_parameters is necessary if colour has one of the following values: 'atomtype', 'restype', 'bychain', 'mainside', 'secstr', 'bvalue', 'occupancy', 'charge', 'res_sas','atom_sas', 'thru_chain', 'bymodel', 'bymol'.
Within the program there are two ways to customise these colour schemes and the customisation can be written to the picture definition file:
The details of these colour schemes (which will be applied to all the loaded models) can be changed in the Preferences window (see in the Model colours folder). By default the colour scheme details are not written out to the picture definition file by CCP4mg but the Save options option on the picture definition sub-menu can be used to select colour scheme to save.
To customise a colour scheme for an individual display object use the Edit colour scheme option on the colour menu. The customised scheme is saved as the colour_rules item of colour_parameters.
key |
select value |
data type |
description |
colour_mode |
Any value |
|
Should have same value as colour |
one_colour |
'one_colour' |
string |
A recognised colour name |
stick_colour |
Any value |
string |
The stick colour in ball-n-stick. A recognised colour name or 'ATOM' |
non_C_atomtype |
Any value |
logical (0 or 1) |
If 1 colour non-C atoms by their element type |
colour_rules |
'colour_rules' |
list of [colour,selection] |
Each item is a list of two items: a recognised colour and a selection rule |
colour_blend |
'blend' |
dictionary |
See below for dictionary items |
contact_MolDisp |
'res_contact' or 'atom_contact' |
string |
The name of another MolDisp |
user_scheme |
'user_scheme' |
string |
Name of saved colour scheme |
Below are the items in colour_blend dictionary. The items ranges_first, ranges_last, colour and direction are lists which must be the same length.
key |
data type |
description |
type |
string |
Apply to type of model: 'amino_acid', 'nucleic' or 'all' |
default_colour |
string |
A recognised colour name |
group |
string |
all atoms in 'residue'/'SSE' are same colour |
ranges_first |
list of strings |
Each item in list is coordinate id of first chain/residue in range |
ranges_last |
list of string |
Each item in list is coordinate id of last chain/residue in range |
colour |
list |
Each item is list of two recognised colour names for start/end of range |
direction |
list of strings |
Each item is direction around colour wheel: 'clockwise' or 'anti-clockwise' |
style_parameters
key |
data type |
description |
inter_dispobj_bond |
logical (0 or 1) |
If 1 (the default) bonds will be drawn to atoms in other MolDisp objects |
SurfaceDispObj
Displays a surface over selected atoms in the MolData object.
HBonds and Contacts
HBonds and Contacts are displayed for the parent MolData object. These object types have very similar attributes which are listed below.
attribute |
data type |
description |
selection |
string |
Same as MolDisp.selection. A selection command |
selection_parameters |
dictionary |
Same as MolDisp.selection_parameters |
colour |
string |
a recognised colour name |
style |
string |
A selection command for the context atoms |
style_parameters |
dictionary |
Same as MolDisp.selection_parameters with extra select option: 'same_as'. |
inter_model |
logical (0 or 1) |
If 0 (the default) do not draw bonds between NMR models |
line_width |
integer |
Width of lines: 1,2,3,4, or -1 (=cylinders) |
label_mode |
logical (0 or 1) |
If 1 label the bonds with bond length |
Annotation
Annotation is arbitrary text positioned on the MolData object. See tutorial.
attribute |
data type |
description |
text |
string |
Text string for annotation |
colour |
string |
a recognised colour name |
position |
list [float,float,float,string] |
Position x,y,z and a selection commands. Position is centre of atoms selected by selection commands (if it is set) with x,y,z offset. |
font |
dictionary |
A font |
AnisoU
This object display thermal ellipses. See tutorial.
attribute |
data type |
description |
selection |
string |
The name of a MolDisp object. Thermal ellipses drawn for the selected atoms of the MolDisp. |
colour |
string |
a recognised colour name |
style |
string |
drawing style:'Solid', 'Axes' or 'Solid&Axes' |
scale |
float |
Scale the ellipses (default=1.0) |
quality |
int |
Drawing quality: 1 (default)=fast, 2=smooth |
MapData
The data object for electron density maps loaded from MTZ structure factor file or a CCP4 map file. For MTZ files the map is calculated from the specified data columns. Also has general data object attributes.
attribute |
data type |
description |
filetype |
string |
'MAP' or 'MTZ' filetype of loaded file |
f |
string |
Structure factor column label in MTZ file |
phi |
string |
phase column label in MTZ file |
wt |
string |
Optional weight column label in MTZ file |
rate |
string |
For MTZ file only. Sampling rate i.e. map resolution in Å. |
MapDisp
The display object for electron density maps; displays one contour level in variety of possible styles. Also has general display object attributes.
attribute |
data type |
description |
radius |
float |
Size of the displayed block of map |
clip_mode |
string |
Map clipping mode. 'SELECTION': clip to selected display object. 'POINT':clip around point. 'OFF': no clipping. |
clip_MolDisp |
string |
For clip_mode 'SELECTION'. The name of a MolDisp. The map is clipped to the atoms in the model display object. |
atom_clip_radius |
string |
For clip_mode 'SELECTION'. Clip map to this distance from atoms in clip_atoms. |
clip_point |
list of floats |
For clip_mode 'POINT'. The x,y,z coordinate of centre point. |
colour |
string |
A recognised colour name |
contour_level |
float |
The contour level in absolute electron/Å**3 |
surface_style |
string |
The surface drawing style: 'chickenwire','solid','solid_chickenwire','dots','slice' or 'mask' |
Crystal
A crystal object controls the crystal and symmetry display of the associated map and model(s). To enable the usual symmetry options a picture definition file should contain one crystal object for each MapData object.
attribute |
data type |
description |
source |
string |
Data object name (MapData or MolData) |
models_in_crystal |
list of strings |
List of MolData; the models which should be treated as part of the crystal. |
style |
string |
The style of symmetry display: 'CONTINUOUS': continuous Crystal, 'UNITCELL': contents of unit cell, or 'OFF' |
symm_diff_colour |
logical (0 or 1) |
If 1 colour carbon atoms of symmetry mates in different colours |
cell_edges |
logical (0 or 1) |
If 1 display the cell edges |
unit_cell_shift |
list of three logicals(0 or 1) |
If style is 'UNITCELL' show contents of adjacent unit cells in x,y, or z if first, second or third item in list is 1. |
2D Objects
Images and legends are grouped together on the GUI Display Table and are treated as display objects.
Image
A 2D image loaded from an picture file such as .png or .jpg.
attribute |
data type |
description |
filename |
list of strings |
picture file filename. See below |
scale |
float |
Scale the picture size. |
aspect |
float |
Aspect ratio x/y |
x |
float |
Translation, as fraction of screen size, across screen from left side, of left side of image |
y |
float |
Translation, as fraction of screen size, up screen from bottom, of bottom of image |
Legend
A 2D text string displayed on the screen. See tutorial.
attribute |
data type |
description |
selection |
string |
A text string to be displayed |
x |
float |
Translation, as fraction of screen size, across screen from left side, of left side of text |
y |
float |
Translation, as fraction of screen size, up screen from bottom, of bottom of text |
text_colour |
string |
A recognised colour name |
font |
dictionary |
A font |
VectorsData
The data object for generic vectors loaded from vectors file.
VectorsDispobj
A display object for generic vectors. The display object attributes can also be set in the vectors file.
attribute |
data type |
description |
selection |
list of strings |
List of tags to be displayed |
line_parameters |
dictionary |
elements of dictionary as described for vectors file |
label_parameters |
dictionary |
elements of dictionary as described for vectors file |
font |
dictionary |
A font |
scaling_mode |
int |
0=no scaling, 1=scale all vectors by 'UNTAGGED' scale, 2=scale by tags |
scale |
dictionary of floats |
Dictionary elements are 'UNTAGGED' and tag names. Values are scale factors to apply to all or just the tagged vectors. |
ParamsManager
A generic ParamsManager class is used in CCP4mg to handle many of the Preferences interfaces. The ParamsManagers are listed in the Save options interface to be selected for output to the picture definition file. An example of a ParamsManager in a picture definition file:
ParamsManager(
name = 'surface_drawing_style',
resolution_delta = 20.0,
dot_spacing = 0.01,
blend_edges = 1 )
The ParamsManager should always have a name attribute which identifies which set of preferences it handles. Some types of data object or display object can have a ParamsManager associated with then to handle the options specifically for that object. For example a SurfaceDispObj can have an associated 'surface_drawing_style' ParamsManager which has the same attributes as the global 'surface_drawing_style' ParamsManager and has a name which conventionally is 'surface_drawing_style_SurfaceDispObj name'. To tie the display object to the ParamsManager the SurfaceDispObj object needs to have an attribute drawing_style with the value of the ParamsManager name.
ColourSchemeManager
A generic ColourSchemeManager object is used to handle the colour schemes which can be accessed in the Model colours folder of the Preferences interface. The attributes of ColourSchemeManager are:
attribute |
data type |
description |
name |
string |
name of colour scheme:'atomtype','restype','secstr','bvalue','occupancy','charge','atom_sas','res_sas','atom_contact','res_contact' |
ranges |
list |
list of strings for name is 'atomtype','restype','secstr' or list of floats |
colours |
list of strings |
List should be same length as ranges and values are recognised colour names |
interpolate_mode |
string |
Relevant if ranges are floats. 'RGB' or 'HSV' |
colour_wheel_direction |
string |
If interpolate_mode is 'HSV' then interpolation around colour wheel is 'clockwise' or 'anti-clockwise' |
For the colour schemes that have float values in the ranges (everything but 'atomtype','restype','secstr') the first and last colour are the warning colours for any atom with property values below or above the normal range and the first and last value in the ranges list are not actually used. See the colour schemes documentation.
Colours
The standard colour names that are always defined within CCP4mg: blue, red, green, grey, yellow, magenta, royal blue, cyan,coral,pale green,pink,lemon,purple,tan,black. The colour name 'complement' will give the colour which complements the background colour (e.g. for black background gives white).
There is an option on the Picture Definition File Save options interface to save Colour definitions. To define a new colour in the picture definition file looks like this:
Colours ( yuck = [ 0.5 , 0.5, 0.5 , 1.0 ] )
The arguments to Colours are the names of the colours with values that are a list of four floats. The first three items in the list are the proportion of red, green and blue components in the colour in the range 0.0 to 1.0. The forth value is an 'alpha' value which should be set to 1.0 (or can be excluded). It is possible, but possibly anti-social, to redefine the standard colours is similar format:
Colours ( red = [ 0.0, 1.0, 0.0 , 1.0 ],
green = [ 0.0, 0.0, 1.0, 1.0],
blue = [ 1.0, 0.0, 0.0 , 1.0 ] )
View
The View attributes can determine the orientation of the display. The attributes are:
attribute |
data type |
description |
centre_xyz |
list of floats |
The x,y,z coordinate to be placed at the centre of the screen |
centre_MolData |
string |
The name of a MolData object to be placed in the centre of the screen |
centre_selection |
string |
A cid (coordinate id) for a set of atoms to be placed in the centre of the screen (centre_MolData must also be used to specify model that cid applies to) |
radius |
float |
Controls the 'zoom' |
Notes on some common attributes
Filenames
The format for the file name is a list (Python list syntax) with three items:
- CCP4i project directory name (or the word 'FULLPATH' if the file is not in a project directory)
- file name (without the directory component)
- full pathname of the file
When loading the file CCP4mg first looks in the project directory (unless it is 'FULLPATH') for a file with the 'file name'; if this fails then it will try the full pathname.
Fonts
Several types of object have a font attribute. It is a dictionary and all the items have values which are strings. CCP4mg supports some built-in fonts that are have names beginning Fast .. and those font families that are available on the computer system on which it is run. Beware that available fonts are very dependent on operating system. For the built-in fonts the size, slant and weight attributes are ignored. The dictionary keys are
key |
description |
family |
Font family name |
size |
A string containing integer number (range 8-60 usually available in CCP4mg) |
slant |
'i' (italic) or 'r' |
weight |
'medium' or 'bold' |