How to work with the NCS Commands (080218)
These commands are used to improve electron densities by non-crystallographic averaging as follows:
To carry out averaging, one requires an electron density that has been calculated on a suitably fine grid, a set of operators that move the reference molecule to each NCS-related molecule in turn, and a mask defining the NCS-reference molecule. The grid spacing of the electron density must be at least a third of the resolution, or finer. The mask must be on the same grid as the electron density. The mask can be made outside O, using Gerard Kleywget’s programs, for example. There are also 2 commands that can be used from within O to make masks. One command, NCS_mask_mak , takes a density in the FastMap system, smears it, and constricts within a box (see below). The other command, NCS_mask_sph , takes an atomic objects, and then creates a mask by placing spheres of a particular radius at each atom in the object. The object can be from a molecule or a skeleton. NCS_mask_sph is the more useful command. The masks generated from either command will need editing with the NCS_mask_lay and or NCS_mask_edi commands.
When we have a structure with strict NCS, the user may have a PDB file containing just one chain and a set of NCS-operators or a series of identical but separate chains. The crystallographic refinement program REFMAC5 is unable to handle strict NCS and users are forced to refine with tight NCS-restraints. In this situation the separate chains will be similar but not identical. A series of separate chains can be converted into a single chain plus operators by first using the Lsq_chain_op command to generate the operators, then PDB_write to create the file (the user needs to specify that O wishes to use the chain operator, see the desciptions of the commands for details). This file will contain a single chain plus a set of MTRIX records. Once read back into O (PDB_read), the NCS-related chains can be viewed or generated with the NCS_instance or NCS_sphere commands.If the density is calculated from atomic models (i.e. as a result of molecular replacement), it is vital that there is no mistake in the calculation of the operators. In O v12, I introduced the concept of the chain operator where the group of ODB entries associated with a single chain are grouped together in one ODB entry. This is described in more detail in the Lsq_chain_op command. The user is still able to work with separate operators that relate the reference molecule to the other NCS-realted molecules, however. If the molecule contains 4 chains, A, B, C and D , and if chain A is the reference molecule then the four operators are:
• the unit operator that moves molecule A onto itself
• the operator that moves A to B, determined using lsq_explicit where the non-moving molecule is B, and the rotated molecule is A
• the operator that moves A to C, determined using lsq_explicit where the non-moving molecule is C, and the rotated molecule is A
• the operator that moves A to D, determined using lsq_explicit where the non-moving molecule is D, and the rotated molecule is A
If the map to be averaged is based on experimental phases, the operators have to be determined by other means. If a set of heavy atom coordinates are available where equivalent heavy atoms have been identified in each chain, then the same LSQ commands can be used in O to get the first estimate of the operators. However, there have to be at least 3 matching pairs of heavy atoms for the calculation of each NCS-operator.
If there are not sufficient heavy atoms, the operators can be determined directly in O. First make a skeleton of the whole asymmetric unit or cell. In the following, I shall use the experimental map from P2 myelin protein ( ano1.map ).
O > skel
Qm> What map? [MIR]:
Qm> All map [Y]/N?
Qm> Base level [1.25]: 1.5
Qm> Skeleton name [SKL]: mir
Make an object of the whole thing:
O > bon_set
Bone> Skeleton molecule name [MIR ]:
Bone> Object name [ALL ]:
Bone> Sphere radius [ 1000.0 ]:
Bone> What bone levels? [ 3 ]:
O > bo_draw
Now evaluate where you see one molecule that will be used as our reference molecule, and make a main-chain object centred on it with a radius that covers it. I have chosen skeleton 5553 and a radius of 20 Å.

I have coloured the object magenta to make it clearer when superimposing it. This reference molecule will be referred to as the A molecule.
Now centre in the ALL object where you think the centre of the first NCS-related molecule, the B molecule

I have centred on 7438. Now I start this command to get the operator that moves A to B:
O > ncs_op
New> What map? [MIR]:
New> Object name [QQ]: mcmir
New> Step search width [3]:
New> Number of atoms in object 507
New> Belongs to molecule MIR
New> Pivot coordinates in object [ 51.33 65.71 33.17]:
New> This takes some time ...
New> Starting 1 of 3
New> Starting 2 of 3
New> Starting 3 of 3
New> Best score: 1.924
A translational grid search is carried out around this identified atom, and the atoms in the skeleton object are pivoted in a full 3-D search. The default search width is +/3 steps, each 1 Å wide around the ID’d atom. The score is the average density at each point in the rotated skeleton for the best fitting translation/orientation. The value here will depend on the map and on how well the command has been able to find th e correct operator. The standard deviation in the MIR map was listed when it was read in:
Fm> Min, max, sigma ...... 0.00000 8.35000 0.95545
The command has generated a new entry in the O DB with the operator to take you from the A to the B molecule:
> dir .lsq_*rt*
Heap> .LSQ_RT_IDENT R W 12
Heap> .LSQ_RT_BEST R W 12
The first operator is the identity operation, taking A to itself. Now we can see how good the A molecule fits on the B molecule using the Lsq_obj command. This command takes a rotation-translation operator and applies it to an atomic object. The coordinates in the object are not affected by this command.
> lsq
Heap> LSQ is not a unique keyword.
Heap> Lsq_explicit is a possibility.
Heap> Lsq_improve is a possibility.
Heap> Lsq_object is a possibility.
Heap> Lsq_molecule is a possibility.
Heap> Lsq_Paired_a is a possibility.
Heap> LSQ is not a visible command.
> lsq_obj
Lsq > Apply a transformation to an existing object.
Lsq > There are these transformations in the database
Lsq > IDENT BEST
Lsq > Which alignment [<CR>=restore a transformed object] ? BEST
Lsq > There is an object called MCMIR
Lsq > There is an object called ALL
Lsq > Which object ? mcmir
Here is how it looks

You can see that I did not judge the centres very well, but it worked. This is a first approximation to the A->B operator and will be improved later. If we are happy with the result, we want to give it a name that makes some sense
cop .LSQ_RT_b .LSQ_RT_BEST
Now lets find the operator to move A onto the C molecule. This is harder because the density for this molecule is not so well defined.

O > ncs_op
New> What map? [MIR]:
New> Object name [MCMIR]:
New> Step search width [3]:
New> Number of atoms in object 507
New> Belongs to molecule MIR
New> Pivot coordinates in object [ 51.33 65.71 33.17]:
New> This takes some time ...
New> Starting 1 of 3
New> Starting 2 of 3
New> Starting 3 of 3
New> Best score: 0.910
O > cop .LSQ_RT_c .LSQ_RT_BEST
O > lsq_obj c mcmir
The result is not impressive, so we try again with a bigger search grid
O > ncs_op
New> What map? [MIR]:
New> Object name [MCMIR]:
New> Step search width [3]: 5
New> Number of atoms in object 507
New> Belongs to molecule MIR
New> Pivot coordinates in object [ 51.33 65.71 33.17]:
New> This takes some time ...
New> Starting 1 of 5
New> Starting 2 of 5
New> Starting 3 of 5
New> Starting 4 of 5
New> Starting 5 of 5
New> Best score: 1.535
O > cop .LSQ_RT_c .LSQ_RT_BEST
O > lsq_obj c mcmir
This is a better score and the fit of the objects is much better. It took longer to do the calculation though.

We now have rough values for both operators, but they might not be good enough for averaging. Instead of wasting our time finding out, it is best to improve them before starting the averaging. O does not have a command to do this so we’ll use one of the RAVE programs written by Gerard Kleywegt and Alwyn Jones. This program needs a starting operator and a mask. At this stage the mask does not have to be particularly fancy, and we’ll just make a simple spherical one that is centred at the middle of our reference molecule.
First make an object centred on the reference molecule with only a few skeleton atoms in it.
O > bon_set
Bone> Skeleton molecule name [MIR ]:
Bone> Object name [MCMIR]: 1
Bone> Sphere radius [ 20.0 ]: 2.
Bone> What bone levels? [ 3 ]:
O > bon_dr
Now convert this object into a mask using the NCS_mask_sph command, and save it in the file system.
O > ncs_mask_sph
New> What map (for cell, grid units only)? [MIR]:
New> Object name [1]:
New> Atomic radii [3.0]: 22.
New> Mask name [MASK]: sphere
New> Number of atoms in object 2
New> Belongs to molecule MIR
O > ncs_mask_wri
Mask> What map? [MIR]: sphere
Mask> Mask file name? [sphere.mask]:
The mask is actually a map in the F(ast)M(ap) viewing system but contains just 0’s and 1’s. It can be inspected using the usual map slider system:

Now we are ready to run the imp program using the O JOB system. Here is the A-> B operator
O > jo_su
New> Define the template file: ncs_imp
New> Old symbol to expand <NCS-operator > to <b >
New> Old symbol to expand <Mask > to <sphere >
New> Old symbol to expand <CCP4 map file > to </Users/alwyn/o/work_o/NCS/ano1.E
New> Old symbol to expand <ODAT > to </Users/alwyn/o/data/ >
New> Old symbol to expand <O Symmetry Operator > to <p212121 >
New> Script started
STOP ... Toodle pip ... statement executed
I now use the Jobs pull-down to activate the macro.
As2> Done file made /Users/alwyn/o/temp/ncs_imp_4.done
As2> Predicted Correlation Coefficient = 0.568816
As2> Predicted Correlation Coefficient = 0.568741
As2> Predicted Correlation Coefficient = 0.568751
As2> Predicted Correlation Coefficient = 0.568744
Heap> Database compressed.
As4> ----------------------------------------------------
As4> The operator has been improved.
As4> Try it
As4> ----------------------------------------------------
This script shows how the correlation coefficient improves . The final value is 0.569.
Now the A->C operator
O > jo_su
New> Define the template file: ncs_imp
New> Old symbol to expand <NCS-operator > to <b >c
New> Old symbol to expand <Mask > to <sphere >
New> Old symbol to expand <CCP4 map file > to </Users/alwyn/o/work_o/NCS/ano1.E
New> Old symbol to expand <ODAT > to </Users/alwyn/o/data/ >
New> Old symbol to expand <O Symmetry Operator > to <p212121 >
New> Script started
STOP ... Toodle pip ... statement executed
I now use the Jobs pull-down to activate the macro.
As2> Done file made /Users/alwyn/o/temp/ncs_imp_5.done
As2> Predicted Correlation Coefficient = 0.469587
As2> Predicted Correlation Coefficient = 0.471927
As2> Predicted Correlation Coefficient = 0.472368
As2> Predicted Correlation Coefficient = 0.472538
As2> Predicted Correlation Coefficient = 0.472600
As2> Predicted Correlation Coefficient = 0.472633
As2> Predicted Correlation Coefficient = 0.472632
Heap> Database compressed.
As4> ----------------------------------------------------
As4> The operator has been improved.
As4> Try it
As4> ----------------------------------------------------
The correlation coefficient is a bit worse, but still OK.
The jobs have read in the new operators to the database, so now we can average with good operators and a poor mask.
O > ncs_av
New> What map? [SPHERE]: mir
number SPG ops 4
New> What mask? [?]: sphere
New> New averaged map: 1stav
New> Define an NCS operator .lsq_rt_ident
New> Define an NCS operator .lsq_rt_b
New> Define an NCS operator .lsq_rt_c
New> Define an NCS operator .lsq_rt_
New> Average.
130410 26894 0 0
New> Min, max, sigma ...... -0.29636 5.71056 0.38887
This has created a new F(ast)M(ap) call 1stav that can now be viewed or used for other O commands. Notice that the sigma in the map is only 0.38887 while the original MIR map has a sigma of .988. This map is already rather nice, so you might want to save it.
O > ncs_map_wr
New> What map to write out ? [1STAV]:
New> Whatfile name ? [ave]: 1stav
New> /Users/alwyn/o/work_o/NCS/1stav.ezd
and we can skeletonize it:
O > skel
Qm> What map? [1STAV]:
Qm> All map [Y]/N?
Qm> Base level [1.25]: 4.5
Qm> Skeleton name [SKL]: 1stav
Note the high level for the base level - this is in multiples of sigma.

There are a few skeleton connections on the left still, and these need to be removed with the Bond_break command and a new skeleton drawn:

This can now be used to make a new, more complex mask where we associated a radius around each atom of 3 Å.
O > NCS_mask_sph
New> What map (for cell, grid units only)? []: mir
New> Object name [MC1STA]:
New> Atomic radii [3.0]:
New> Mask name [MASK]: 2nd
New> Number of atoms in object 341
New> Belongs to molecule 1STAV
This mask will have holes and clefts in it that have to be smoothed out:

O > NCS_mask_lay
New> What mask ? [MIR]: 2nd
New> Expand layer (+), or peel it (-)? [+]: +
In the above, adding the first extra layer improved things, but it was still not perfect

There are still a few buried holes, so I added another layer to fill them in, and then removed it (to keep it slim).
O > NCS_mask_lay 2nd +
O > NCS_mask_lay 2nd -

This mask is now good enough for cyclic averaging, so save it.
O > NCS_mask_wri
Mask> What map? [2ND]:
Mask> Mask file name? [2ND.mask]: 2nd.mask
O > NCS_add_maps
New> First map: []: ring1
New> Second map [?]: ring2
New> New map: both
New> Min, max, RMS ...... -59.48718 71.28205 15.16168
The maps must have the same grid and extent.
O > NCS_add_maps
New> First map: [f21]:
New> Second map [?]: mir
New> New map: both
New> Sorry, maps have different grids, abort.
This command allows a user to make an instance of a molecular object that makes use of NCS symmetry. The molecule concerned must have a chain operator defining the NCS-operators. Note that the instance of the object contains just a set of lines and atoms cannot be identified (use NCS_sphere instead).
This example is from Satellite Tobacco Necrosis Virus (PDB entry 2BUK) which was the first virus to be refined, and contains 60 chains related by icosahedral symmetry.
O > NCS_instance
Sym> Molecular objects name? [A]: 2bukca
Sym> NCS object name? [ncs]:
Sym> Sphere radius [10.0]: 1000
Sym> Molecule c.g. = 46.50 48.97 -7.00
Sym> Radius = 37.77
Sym> Number of NCS operators = 60

This command allows a user to generate molecules from a reference molecule containing NCS symmetry. The reference molecule must have a chain operator defining the NCS-operators. Note that the newly generated molecules are real molecules as far as O is concerned so that atoms can be identified (use NCS_instance instead if you just want to see the NCS).
This example is from Satellite Tobacco Necrosis Virus (PDB entry 2BUK) which was the first virus to be refined, and contains 60 chains related by icosahedral symmetry.
O > NCS_sph
Sym> Molecule name? [GS]: 2buk
Sym> NCS molecule name? [ncs]:
Sym> Sphere radius [10.0]: 1000
Sym> Molecule c.g. = 46.50 48.97 -7.00
Sym> Radius = 37.77
Sym> Number of NCS operators = 60
Sym> NCS chain 2
Sym> NCS chain 3
Sym> NCS chain 4
Sym> NCS chain 5
Sym> NCS chain 6
Sym> NCS chain 7.....
Sym> NCS chain 58
Sym> NCS chain 59
Sym> NCS chain 60
Full atomic objects are generated for each chain.

We can average the electron density once we have good operators and a mask. For non-cyclic averaging, the mask can be a simple sphere that is big enough to cover completely the reference molecule. For cyclic averaging, the mask should be as good as you can make it.
O > ncs_av
New> What map? [SPHERE]: mir
number SPG ops 4
New> What mask? [?]: sphere
New> New averaged map: 1stav
New> Define an NCS operator .lsq_rt_ident
New> Define an NCS operator .lsq_rt_b
New> Define an NCS operator .lsq_rt_c
New> Define an NCS operator .lsq_rt_
New> Average.
New> Min, max, sigma ...... -0.29636 5.71056 0.38887
New> Expand into a complete cell? [Y]: n
This has created a new F(ast)M(ap) call 1stav that can now be viewed or used for other O commands. Notice that the sigma in the map is only 0.38887 while the original MIR map has a sigma of .988. It will, therefore, have to be viewed with a much larger level (around 4 sigma) than the original MIR map.
In the final prompt, n was entered, so the NCS-averaged asymmetric unit has not been expanded to fill the complete unit cell. If this were part of a cyclic averaging procedure, an expansion would have been required and a complete unit cell would have been generated.
New> Expand into a complete cell? [Y]:
New> Min, max, sigma ...... -1.14902 5.71055 1.08863
Note that the sigma value is now quite different!
An averaged mask may look so good that you want to keep it. This command writes a F(ast)M(ap) system map as an EZD formatted file into the computer’s file-system.
O > NCS_map_writ
New> What map to write out ? [AV]:
New> Whatfile name ? [ave]: 1st_av
New> /Users/alwyn/o/work_o/NCS/1st_av.ezd
map_write_ezd
The map can be read into O again at a later stage using the Fm_file command.
This command allows a user to edit a mask stored in the O FastMap system. The user needs to define a radius that controls which pixels are reset around identified atoms. The mask is expanded around the identified atom if Yes is set, and constricted if No is set.
O > NCS_mask_edi
Mask> What mask? []: 2nd
Mask> Radius [3.]:
In the following example, the mask is too close to an abutting molecule, represented in part by a few skeleton atoms:

With Yes set, the result is as follows:

This has made the matter worse, by expanding the mask into the wrong volume. Setting No , and identifying a few of the skeleton atoms produced a slightly shaved mask in this region:

The first mask that you make is not likely to be perfect. This mask will, almost certainly, have holes and clefts in it that have to be smoothed out:

O > NCS_mask_lay
New> What mask ? [MIR]: 2nd
New> Expand layer (+), or peel it (-)? [+]: +
In the above, an extra outer layer has been added to the mask. Although adding this first extra layer has improved things, but it was still not perfect

There are still a few buried holes, so I would add another layer to fill them in, and then remove the outer layer (to keep it slim).
O > NCS_mask_lay 2nd +
O > NCS_mask_lay 2nd -
Note that adding/removing layers tends to smoothen the outer layer of the mask.
This command makes a mask out of a density in the FastMap system. The user needs to specify a volume within which the input map is smeared. The FastMap slider for the mask is then used to control a level and radius until the user sets Yes or No. If Yes is set, the current volume being display (i.e. at the current level and radius) is used as the mask. The smeared density is converted to 0 and 1 below and above the contouring level in the slider. The slider setting is then reset to this new range of values. The mask is padded by 10 pixels in each direction.
O > ncs_mas_ma
Mask> What map? [AV]: mir
Mask> All map [Y]/N? n
Mask> Radius around active_centre [50.]: 22
Mask> Radius to average [3.]: 6
Mask> Mask name [MASK]:
Mask> This takes some time ...
Mask> Done 10 levels of 38
Mask> Done 20 levels of 38
Mask> Done 30 levels of 38
Mask> Done
The following snapshot shows a smeared P2 myelin MIR map, prior to accepting the level and radius:

After setting Yes, the mask is quite similar but is now defined as 0/1’s

and no longer has any symmetry associated with it.
Clearly this is a very rough mask and will need lots of editing.
This is a very convenient way to make a mask in O’s NCS-system. You just have to make an atomic object, and then you create a mask by placing a sphere at each atom in the object. In a molecular replacement solution, one of the chains can be used to make a very nice mask. If one uses a sphere of say 3 Å around each atom, there will be holes and cavities in the mask, but these are easy to remove with the NCA_mask_lay command. A mask can also be made out of a skeleton object.
Remember that an averaged map has no density outside the mask. Therefore, in cyclic averaging it is a good idea to keep the last un-averaged map from the last cycle of phase refinement.
O > ncs_mask_sph
New> What map (for cell, grid units only)? [MIR]:
New> Object name [1]:
New> Atomic radii [3.0]: 22.
New> Mask name [MASK]: sphere
New> Number of atoms in object 2
New> Belongs to molecule MIR
The mask becomes part of the F(ast)M(ap) system and can be viewed with the map slider interface. S i nce the mask contains just 0’s and 1’ s , there is nothing to view above a level of 1.0
An averaged mask may look so good that you want to keep it. This command writes a F(ast)M(ap) system map as an EZD formatted file into the computer’s file-system.
O > NCS_map_writ
New> What map to write out ? [AV]:
New> Whatfile name ? [ave]: 1st_av
New> /Users/alwyn/o/work_o/NCS/1st_av.ezd
map_write_ezd
The map can be read into O again at a later stage using the Fm_file command.
If the map to be averaged is based on molecular replacement solution, determining the NCS-operators is very easy using lsq_explicit . However, if the map is produced from experimental phases, the operators have to be determined by other means. If a set of heavy atom coordinates are available where equivalent heavy atoms have been identified in each chain, then the same LSQ commands can be used in O to get the first estimate of the operators. However, there have to be at least 3 matching pairs of heavy atoms for the calculation of each NCS-operator.
If there are not sufficient heavy atoms, the operators can be determined directly in O. First make a skeleton of the whole asymmetric unit or cell. Then make another object which corresponds to the reference molecule. The NCS_oper command allows you to find the operator that place this object on other NCS-related molecules in the skeleton. The user is prompted to identify an atom that is roughly in the middle of an NCS-related molecule.
O > ncs_op
New> What map? [MIR]:
New> Object name [QQ]: mcmir
New> Step search width [3]:
New> Number of atoms in object 507
New> Belongs to molecule MIR
The user is prompted to ID an atom roughly in the middle of the NCS-related molecule
New> Pivot coordinates in object [ 51.33 65.71 33.17]:
New> This takes some time ...
New> Starting 1 of 3
New> Starting 2 of 3
New> Starting 3 of 3
New> Best score: 1.924
A translational grid search is carried out around this identified atom, and the atoms in the skeleton object are pivoted in a full 3-D search. The default search width is +/3 steps, each 1 Å wide around the ID’d atom. The score is the average density at each point in the rotated skeleton for the best fitting translation/orientation. The value here will depend on the map and on how well the command has been able to find th e correct operator. The standard deviation in the MIR map was listed when it was read in:
Fm> Min, max, sigma ...... 0.00000 8.35000 0.95545
The command has generated a new entry in the O DB with the operator to take you from the reference molecule to an NCS-related molecule:
> dir .lsq_*rt*
Heap> .LSQ_RT_IDENT R W 12
Heap> .LSQ_RT_BEST R W 12
The first operator is the identity operation, taking the refernce molecule to itself. One can see how good theoperator is by using the Lsq_obj command. This command takes a rotation-translation operator and applies it to an atomic object. The coordinates in the object are not affected by this command.
If the user has just a single heavy atom per NCS-subunit, it may be worth making the reference object centred on a heavy atom site. In this case, ID the heavy atom in the NCS-molecule to define roughly the NCS-centre.
begin_object text_red
colour red
text 55 72 30 AAAAAA
end_object
begin_object text_yellow
colour yellow
text 55 72 35 BBBBBB
end_object
begin_object text
instance text_red
instance text_yellow
end_object
When drawn in O, the object that you see is called ‘text’ and appears to be red A’s and yellow B’s
end_object - end the current object
colour <value> - define the colour to be used with the drawing instruction that follow. The <value> can be text (e.g. ‘red’) or a packed integer (e.g. 16711680 is red, 65280 is green)
line_type <type> - specify how to draw lines, and can have the following values solid, dashed, dotted, dash_dot.
move <x y z> - specify the start coordinates of a line.
line <x y z> - specify the coordinates for drawing a line from the current point in space to the new position.
dot <x y z> - draw a dot at the specified coordinates
move_atom <mol res atom> - specify the start of a line by the coordinates of an atom in the O database.
line_atom <mol res atom> - specify the coordinates for drawing a line from the current point in space to the new position by the coordinates of an atom in the O database.
text <x y z string> - place the text contained in the string at the desired coordinates
text_colour <value> - define the text colour to be used with the drawing instruction that follow. The <value> can be text (e.g. ‘red’) or a packed integer (e.g. 16711680 is red, 65280 is green)
poly <number of vertices> <xyz vertex> - draw a polygon with current colour. Each coordinates can be on a new line.
poly_colour <value> - define the text colour to be used with the drawing instruction that follow. The <value> can be text (e.g. ‘red’) or a packed integer (e.g. 16711680 is red, 65280 is green)
instance <object> <ODB entry> - object to be instanced with optional RT operator. This is useful if you want to apply operators to an atomic object to build a virus particle, for example. E.g.
begin_object icos
instance aca .lsq_rt_sym1
instance aca .lsq_rt_sym2
instance aca .lsq_rt_sym3
......
end_object
Here is a more complicated example (5 different chains) from Jorge Navaza’s group:

where the multiple copies of the separately coloured CA objects are instances of the originals.
sphere_atom <mol res atom radius colour> - draw a sphere at the coords of an atom
sphere_xyz <x, y, z, radius> - draw a sphere at the specified point
stick <mol res atom> <mol res atom> <radius> - draw a stick between a pair of atoms
stick_xyz <x1, y1, z1> <x2, y2, z2> <radius> - draw a stick between 2 points
mode <solid/line> - set drawing mode
cell <cell params.> - set cell for following 3 commands
fmove <x, y, z> - moveto in fractional coords.
fline <x, y, z> - lineto in fractional coords.
ftext <x,y,z, string> - place text , coords. in fractional units
bubbles <mol1 res1 atom1 mol2 res2 atom2 radius1 radius2> draw small spheres (AKA bubbles) between a pair of atoms. The bubbles are of radius value <radius2> and roughly <radius1> apart. Here is an example from the distributed P2 myelin structure:
begin_object bubbles
mode solid
colour cyan
bubbles a a132 o1 a a106 nh1 .4 .15
colour red
bubbles a a132 o1 a a106 nh2 .9 .15
colour green
bub a a132 o2 a a126 nh1 .2 .3
end_object
and the resulting figure:

In the next example, the molecule has been refined with strict NCS and contains 12 sets of MTRIX records that together describe the NCS. Note that the PDB file does not contain the space group information, which forces an extra prompt.
O > pdb_read
Util> PDB file : gs_a.pdb
Util> This mols DB entries that already exist will be deleted!
Util> O associated molecule name: a1
Util> Remove hydrogens ? [y]/n :
Util> Save CNS/XPLOR SEGIDs ? [y]/n : n
Util> Database compressed.
Util> Space for 9536776 atoms
Util> Space for 100000 residues
Util> Element information at end of line
Util> Chain name >A<
Util> Molecule A1 contained 476 residues and 3790 atoms
Util> File containing datablock of space group symmetry [symm/p1]: symm/p212121.sym
Util> O-style symm-ops for spacegroup P212121
Util> Database compressed.
Util> 12 NCS operators are stored.
Util> Skipped Hs 0
Util> SEGID :
Util> @on_stereo_chem will be activated
Mol> Created connectivity Db for A1
O > dir *rt*a1*
Heap> .LSQ_RT_A1_1 R W 12
Heap> .LSQ_RT_A1_2 R W 12
Heap> .LSQ_RT_A1_3 R W 12
Heap> .LSQ_RT_A1_4 R W 12
Heap> .LSQ_RT_A1_5 R W 12
Heap> .LSQ_RT_A1_6 R W 12
Heap> .LSQ_RT_A1_7 R W 12
Heap> .LSQ_RT_A1_8 R W 12
Heap> .LSQ_RT_A1_9 R W 12
Heap> .LSQ_RT_A1_10 R W 12
Heap> .LSQ_RT_A1_11 R W 12
Heap> .LSQ_RT_A1_12 R W 12
Heap> .LSQ_NCS_RT_A1 T W 252
O > writ .LSQ_NCS_RT_A1 ;;
.LSQ_NCS_RT_A1 T 12 20
.lsq_rt_A1_1
.lsq_rt_A1_2
.lsq_rt_A1_3
.lsq_rt_A1_4
.lsq_rt_A1_5
.lsq_rt_A1_6
.lsq_rt_A1_7
.lsq_rt_A1_8
.lsq_rt_A1_9
.lsq_rt_A1_10
.lsq_rt_A1_11
.lsq_rt_A1_12
A chain operator is created for the molecule, as well as operators describing each NCS-relationship. The operators can be used by many commands in O (see NCS*, LSQ* etc for more details). Note, however, that the Lsq_explicit and Lsq_improve commands generate 4 entries in the ODB for each operator. These other entries describe the molecules and matching sets of atoms.
The next example is todemonstrate how to load in a molecule with so many chains that one has to use long residue names.
O > pd_read
Util> PDB file : 70S_RF1_final.pdb
Util> This mols DB entries that already exist will be deleted!
Util> O associated molecule name: rf1
Util> Remove hydrogens ? [y]/n :
Util> Save CNS/XPLOR SEGIDs ? [y]/n :
Util> Combine SEGID & residue name ? y/[n] : y
Util> Database compressed.
Util> Space for 9598271 atoms
Util> Space for 100000 residues
Util> Element information at end of line
Util> Molecule RF1 contained 24071 residues and 300255 atoms
Util> O-style symm-ops for spacegroup P212121
Util> Skipped Hs 0
Util> SEGID : AL02
Util> SEGID : AL03
Util> SEGID : AL04 ....
Util> Number of different SEGIDs 115
Util> SEGIDs are part of the residue name
Util> They are not stored as a residue property
Util> Checking for name duplications. ...
Util> There are no duplicate residue names in this molecule
Util> @on_stereo_chem will be activated
Util> Screen centre set to centre-of-gravity of molecule....
Residue names in this molecule are now 12 characters wide and are formed by concatenating the segment ID with the usual PDB residue name. The following is a clipping from the above file, showing where we pass the 99999 atom limit in the original PDB definition.
If we identify the atom equivalent to the one on line A0005, we now see it corresponds to O2’ of residue A16S_157
The whole molecule slows down my state-of-the-art (101013) iMac and makes my Macbook Air shudder when I try to rotate it.
My special thanks to Martin Laurberg for making his RF1 70S ribosome crystal structure available to me ahead of publication.
In the following example, the molecule has been refined and rebuilt in O with strict NCS and contains 12 sets of NCS-related chains. The presence of chain operator is detected and O reacts accordingly.
O > pdb_wr
Util> PDB file name: a2.pdb
Util> What molecule [A1 ]:
Util> Residue range [all molecule]:
Util> Define cell constants [ 134.74 203.24 229.42 90.00 90.00 90.00]:
Util> Write out only selected atoms? [No]:
Util> SEGIDs not present
Util> Alternates not present
Util> Anis Us not present
Util> Use the B-factor? [Yes]:
Util> Use the occupancy? [Yes]:
Util> This molecule has strict NCS.
Util> Keep the strict NCS in one chain ([Y],N)?
Util> RT-operator A1_1
Util> RT-operator A1_2
Util> RT-operator A1_3
Util> RT-operator A1_4
Util> RT-operator A1_5
Util> RT-operator A1_6
Util> RT-operator A1_7
Util> RT-operator A1_8
Util> RT-operator A1_9
Util> RT-operator A1_10
Util> RT-operator A1_11
Util> RT-operator A1_12
Util> 3790 atoms written out.
The new PDB file, a2.pdb, contains 12 sets of MTRIX records describing the NCS. If the user had elected to relax the strict NCS, the following output would have been generated:
Util> Keep the strict NCS in one chain ([Y],N)? nIf the molecule has 12 character, long residue names, they are split into CNS-style segment information and the usual PDB residue name:
O > pd_wrQDS includes its own menu system, part of the new so-called Master-menu system (see below).
To use QDS, you will also need to load the latest menu.odb file as well as the specific qds.odb database entry into O. To use the Master-menu system, you will need all menu_*.odb files in your ODAT directory, and to load menu_master.odb into your running O database.
QDS is the first O feature to have an explicit undo capability. I don’t apologize for not having an undo capability in other commands, since almost all of the commands available within O work by accepting or not the results of a user’s input. QDS does not, it does what you tell it, and then you have a chance to undo the action. There are 5 levels of undo. Perhaps there should be more. I implement the undo feature by writing out all ODB entries associated with the molecule to an O binary database file. The molecule name is part of the file name, as is an integer in the range 1-5. For example, if the ligand is called LIG, the undo feature will generate up to 5 files with names like backup_lig_<value>.o where <value> is 1, 2, 3, 4 or 5. The files are stored in the OTMP directory.
Here are the current set of QDS commands
O > qds
Mnp> QDS is not a unique keyword.
Mnp> QDS_setup is a possibility.
Mnp> QDS_extend is a possibility.
Mnp> QDS_atom is a possibility.
Mnp> QDS_ring is a possibility.
Mnp> QDS_write is a possibility.
Mnp> QDS_undo is a possibility.
Mnp> QDS is not a visible command.
![]() |
Here is the QDS user menu in the Master-menu system. At any moment, QDS is working with a defined atom type. This type can be set or changed with the QDS_atom command. Every recognized atom type has entries in qds.odb for relevant bond lengths, angles, branching torsion angles, fixed and flexible torsion angles. The user must first generate the relevant ODB entries associated with the ligand and the QDS system by using the QDS_setup command. The QDS menu has a macro to activate this command, which also defines a symbol for the molecule name used by the other menu commands. The small molecule is actually generated with repeated calls to the QDS_extend command. The first QDS_extend places a single atom of the desired type at the current screen centre, the second time it’s used results in a bonded pair of atoms, and the third time makes 3 linked atoms at a defined angle. Subsequently, the user must identify the atom to which the new atom is bonded. Sometimes, QDS will be unable to this without getting more information from the user; for example, chiral centres may be introduced or the new bond between the two atom types could be of different lengths. QDS_ring allows one to create rings, and the user simply identifies the 2 atoms that need to be connected for ring closure. The stereo-chemical information needed for O’s regularization system are generated in real time, while the information needed to define torsion angles for Tor_residue are made as part of QDS_write. Click on 'Undo action' if you make a mistake. There are 5 levels of undo. |
![]() |
Here is the system in operation: O > QDS_setup |
![]() |
Clicking on 'Extend from ID' now draws a bond, of length 1.40 Å which is appropriate for a bond between a pair of C_aromatic atoms (the current atom type, at the time & listed on the Prompt line in the 3D window) |
![]() |
Another QDS_extend produces this with an angle of 120º which is also appropriate (and defined in qds.odb). |
![]() |
The next QDS_extend, forces one to identify where QDS should extend the molecule by an atom, and I’ve done it 3 times: |
![]() |
This makes 6 atoms that I now want to form a ring, so now I use QDS_ring (or the menu item) and identify C1 and C6: Note that C1 is no longer at the screen centre. In fact, this structure has been regularized, and fixed torsion angle restraints have been defined to force the flat ring (outliers are listed on the terminal, as usual). |
![]() |
Now I want to add a hydroxyl group at C3, so I change the atom type to O_single in the menu, then QDS_extend, then ID C3:. |
![]() |
Next, I want to make another ring branch, a tetrahedral carbon (C_single) from C5 and then attach 3 fluorine atoms to this carbon. |
Adding the C_single and the first F_single are trivial uses of QDS_extend, but QDS_extend will ask for help on adding the 2nd and 3rd fluorine atoms:
New> More than one branch is possible
New> Option 1C_SING F_SING 120.000
New> Option 2C_SING F_SING -120.000
New> Which one [1] :
New> This action can be undone.
New> C_SING angle needed
New> More than one branch is possible
New> Option 1C_SING F_SING 120.000
New> Option 2C_SING F_SING -120.000
New> Which one [1] : 2
To generate the necessary ODB entries requires QDS_write (also available from the menu). This actually generates a new ODB entry as well as a file in the computer file-system:
O > qds_write
New> Write out the restaints associated with NEW
New> File name [qds_stereo_chem.odb]:
New> Stereo-chem dictionary created in ODB for residue type: QDS
O > dir qds*
Heap> QDS_BONDS_ANGLES T W 3650
You might use the file to update your stereo_chem.odb entry to include your new ligand, remember to upgrade the line count indicator in the header line. However, you don't have to since the Refi_gener command will search in your ODB for an entry < restyp > _bonds_angles if the residue is not described in the stereo_chem.odb file and .bonds_angles ODB.
At this stage, the new ligand has the following entries associated with it:
O > dir new*
Heap> NEW_RESIDUE_NAME C W 1
Heap> NEW_RESIDUE_TYPE C W 1
Heap> NEW_ATOM_NAME C W 200
Heap> NEW_ATOM_XYZ R W 600
Heap> NEW_ATOM_B R W 200
Heap> NEW_ATOM_WT R W 200
Heap> NEW_ATOM_Z I W 200
Heap> NEW_ATOM_TYPE C W 200
Heap> NEW_ATOM_SELECT I W 200
Heap> NEW_ATOM_VISIBLE I W 200
Heap> NEW_ATOM_BUILT I W 200
Heap> NEW_RESIDUE_POINTERS I W 2
Heap> NEW_RESIDUE_CG I W 4
Heap> NEW_MOLECULE_TYPE C W 2
Heap> NEW_MOLECULE_CA C W 1
Heap> NEW_MOLECULE_CA_MXDST R W 1
Heap> NEW_ATOM_COLOUR I W 200
Heap> NEW_TORSION_FLEXIBLE I W 6
Heap> NEW_CONNECTIVITY I W 21
Heap> NEW_BOND_DISTANCE I W 44
Heap> NEW_BOND_ANGLE I W 80
Heap> NEW_TORSION_FIXED I W 54
Note that the atom names contain the element and a counter. There is a maximum of 200 atoms in the residue, and only one residue in the molecule.
![]() |
The Tor_residue command in O requires the definition of each torsion angle, and a list of the atoms that are affected by changes in the angle. How should one do this for the case of a general ligand? QDS assigns a torsion angle to be fixed or flexible, and only allows you to change flexible angles. One is not allowed to change torsion angles in closed rings. QDS decides which atoms are affected by counting the number of atoms that change in either of the 2 possible directions, and selecting the angle that changes the lower number. This prevents the tail from wagging the dog. |
In the above ligand, for example, there are 4 flexible torsion angles. The angle between C2 and C3 could be defined so that only 2 atoms move, or 9, so QDS chooses to change only 2 by defining TOR_1 to be C4-C3-C2-C1. Rotations around the C3-C4 bond could change 4 or 7 atoms, so TOR_2 is defined by C5-C4-C3-C2. Changing TOR_4, however, rotates the ring because only 5 atoms are affected while 6 would be affected in the other direction.
This command redefines the default atom type for the QDS system. This will be the atom type of the next atom added with qds_extend. The user will be prompted for allowed atom types.
O > qds_atom
New> Here are the possible atom types
C_SING C_DOUB C_TRIP C_AROM N_SING N_DOUB
O_SING O_DOUB S_SING S_DOUB P_SING F_SING
CL_SIN BR_SIN I_SING
New> Atom type [C_single]: o_double
This command extend the ligand by one atom. The new atom will be of the current default type. After 3 atoms have been built, the user must identify where the atom is to branch from. If QDS thinks there are alternate branch pints, the user will be prompted to decide.
O > qds_atom c_single
O > QDS_extend
New> This action can be undone.
New> C_SING angle needed
New> More than one branch is possible
New> Option 1C_SING C_SING 120.000
New> Option 2C_SING C_SING -120.000
New> Which one [1] : 2
This command forces a ring closure between the two identified atoms
This command begins the creation of a new ligand. An existing molecule of the same name will be overwritten. QDS will create space for 200 atoms and all of the usual ODB entries associated with a molecule in O. QDS also creates a special atom property <mol>_atom_built which indicates the atoms that have been built by QDS (value 1 means built, 0 not built).
O > qds_atom c_double
O > qds_setup
New> This WILL initialise certain datablocks.
New> Molecule name ([] to exit): fa
New> Residue type [FA ]: fa
New> This action can be undone.
New> Database compressed.
This command reads in the last undo backup file for a particular molecule, and recreates the object of the ligand.
O > QDS_undo
New> Molecule name [FA ] :
New> A binary file
New> Database compressed.
New> Database compressed.
....
New> There were 22 ODBs in the file.
This command generates a file suitable for creating a residue entry in the stereo_chem.odb file. The file is NOT an ODB, since it lacks a header.
O > qds_write
New> Write out the restaints associated with FA
New> File name [qds_stereo_chem.odb]:
New> Stereo-chem dictionary created in ODB for residue type: FA
O > $ cat qds_stereo_chem.odb
residue FA
centre C1
atom C1 C2 C3 C4 O5 \
O6 C7
torsion tor_1 C1 C2 C3 C4 \
C3 C4 C7
torsion tor_2 C3 C2 C1 O5 \
C1 O5 O6
connect_all C1 C2
connect_all C1 C2
connect_all C2 C3
connect_all C3 C4
connect_all C1 O5
connect_all C1 O6
connect_all C3 C7
bond_distance C1 C2 1.220 0.02
bond_distance C1 C2 1.500 0.02
bond_distance C2 C3 1.540 0.02
bond_distance C3 C4 1.540 0.02
bond_distance C1 O5 1.420 0.02
bond_distance C1 O6 1.220 0.02
bond_distance C3 C7 1.540 0.02
bond_angle C1 C2 C3 110.0 1.0
bond_angle C4 C3 C2 110.0 1.0
bond_angle O5 C1 C2 120.0 1.0
bond_angle O6 C1 C2 120.0 1.0
bond_angle O6 C1 O5 120.0 1.0
bond_angle C7 C3 C2 110.0 1.0
bond_angle C7 C3 C4 110.0 1.0
torsion_flexible C4 C3 C2 C1 180.0 20.0
torsion_flexible O5 C1 C2 C3 180.0 20.0
torsion_fixed O6 C1 C2 O5 180.0 2.0
torsion_fixed C7 C3 C2 C4 -120.0 2.0