From CCP4 wiki
Revision as of 12:55, 4 July 2008 by Kevin Cowtan (talk | contribs)
Jump to navigationJump to search

Installing Coot

Installing Coot on OS X

Please refer to the Installing Coot on OS X page

Installing Coot on Linux

Installing coot on linux is rather more straightforward than on OS X, because most linux systems are based on gnome and/or kde, and tend to have many of the required components already installed. Most of the other dependencies are also readily available.

Installation from a binary package

This is the recommended way for those who do not want to delve into the mysteries of compiling and linking a great but complex piece of software. Read the (somewhat outdated, it seems) Coot FAQ to find "Additional Notes" for your operating system.

In short, just go to and pick a suitable binary, e.g. coot-0.5-pre-1-revision-1003-binary-Linux-i386-fedora-5.tar.gz for a Red Hat Enterprise Linux 5 or CentOS-5 system (Fedora 6 corresponds to RHEL5, thus Fedora 5 binaries are OK). If you prefer a "stable" binary, these are at

Then un-tar it under /usr/local/src (or in your $HOME), and establish a symlink (ln -s) between /usr/local/bin/coot and the bin/coot of the freshly unpacked distribution.

If you then run coot, and the loader complains that a certain library is missing, just ask

yum whatprovides <thatlibrary>

and install the library, again using yum (assuming yum is available in your distribution, otherwise use apt or whatever is there for this purpose).

Installation from source code

Installation of coot and all of its dependencies are handled automatically through the autobuild scripts. There are two versions:

  • GTK1 - the old user interface. This script builds coot and all its dependencies.
  • GTK2 - the new user interface. This script builds coot and most of the dependencies, excluding GTK2.

There are also instructions for Custom building Coot from source code. This should not be attempted except by experts.

First, Install CCP4 on Linux.

I let ccp4 build its own fftw. Be sure to build the clipper libraries. After you complete the default installation, go back to $CLIB/clipper/clipper/mmdbold and build some more libraries, i.e.,

cd  $CLIB/clipper/clipper/mmdbold
make install

to get the additional mmdbold libraries installed in their canonical location. This should take care of the ccp4-type dependencies, as well as ensuring that you have fftw libs that play well with the clipper libraries.

Second, install a newer version of Clipper

Get the latest clipper from


I installed the latest clipper into /usr/local/xtal It was a PITA to compile:

CPPFLAGS="-I$CLIB/src/mmdb" ./configure --prefix=/usr/local/xtal --with-fftw=$CCP4 \
--with-ccp4=$CCP4 --with-mmdb=$CLIB --enable-cns --enable-ccp4 --enable-mmdb \
--enable-mmdbold --enable-cif --enable-minimol

Third, make sure the other needed dependencies are installed

These include at least the following dependencies:

Ubuntu packages

A list of coot dependencies that is probably only a subset

Others that you have to make yourself:

goosh (I had to compile this myself)

guile-gui (I had to compile this myself)

guile-gtk-2.0 (I had to compile this myself)

net-htttp (I had to compile this myself)

To do so, I used

configure --prefix=/usr
sudo make install

Fourth, configure and build coot like this:

Use sudo zsh (or whatever shell) to open a root shell, and issue the commands

CPPFLAGS="-I$CLIB/src -I$CLIB/src/mmdb" ./configure --with-mmdb-prefix=$CCP4 --with-clipper-prefix=/usr/local/xtal \
--with-fftw=$CCP4 --with-glut-prefix=/usr --with-gl-prefix=/usr/X11R6 --with-gtk2 --with-gnomecanvas-prefix=/usr \
--with-ssmlib-prefix=$CCP4 --with-imlib-prefix=/usr --with-gtkgl-prefix=/usr --with-glib-prefix=/usr --with-guile-gtk \
--with-guile-gtk-prefix=/usr   --with-gsl-prefix=/usr --with-guile --with-python --prefix=$PWD

Remake the src/ and src/ files

/bin/rm -f **/coot_wrap_**.cc
cd src
touch c-interface-database.hh
cd ..

Now compile it:

make -i install
cp src/ python/.
cp src/ share/coot/python/.

Now add the reference structures:

cd share/coot
tar xvfz coot-reference-structures.tar.gz ; rm coot-reference-structures.tar.gz

Now add the refmac dictionaries (eg using coot-0.4.1 and refmac 5.4; change as required):

cd /tmp
wget  wget
tar xvfz refmac5.4_dictionary.tar.gz
mkdir -p  /usr/local/xtal/coot-0.4.1/lib/data
cp -r dic /usr/local/xtal/coot-0.4.1/lib/data/monomers

Export the COOT_REFMAC_LIB_DIR variable (you can edit bin/coot):


The configure command is all one line; I've escaped the return. Using --prefix=$PWD simply keeps everything self-contained. You can use any install prefix you want to (it defaults to /usr/local; another sensible choice is /usr/local/xtal. Avoid /usr as a prefix, as it can mess with your system).

The make -i install is needed if you choose --prefix=$PWD because it tries to install some files where they are presently situated.

If you want to make it portable

You don't need to do this to run coot; this is only handy if you need to redistribute it (or make say a debian package).

You can see what dynamic libraries coot needs to load by issuing the command

ldd coot-real 

or, if you just want to see the full path to the libraries, issue

ldd coot-real | awk '{print $3}' | grep -v fff | sort -u

You can use additional grep filters to select the ccp4 libs, clipper libs, eliminate coot's own libaries (that are already in the lib directory) and so forth.

(The ldd command is equivalent to otool -L on Mac OS X.) Then you can copy these into coot's lib directory. I used the following commands in zsh to copy in the needed directories (this is overkill, but wtf).

 cd /usr/local/xtal/coot-0.1.2/bin
 foreach dylib in $(ldd coot-real | awk '{print $3}' | grep -v fff | grep -v "usr/local/xtal/coot" | sort -u )
      print copying $dylib 
      sudo cp -i $dylib /usr/local/xtal/coot-0.1.2/lib/.

In addition, the guile modules can all be put in one centralized location:

cp -R /usr/share/guile* /usr/local/xtal/coot-0.1.2/share/.

Finally, you can give coot its own copy of the refmac monomers library:

mkdir -p /usr/local/xtal/coot-0.1.2/share/coot/lib/data
cp -R /usr/local/xtal/ccp4-6.0/lib/data/monomers /usr/local/xtal/coot-0.1.0-pre-3/share/coot/lib/data/.

Then edit /usr/local/xtal/coot-0.1.2/bin/coot and un-comment the appropriate environment variable lines (there are 2).

Running Coot

General Topics


External Links

On-line User Manual

Coot's home page

Mailing list archives: (no longer) current

Mailing list archives: 2004-05


Coot can be scripted in scheme (guile) or python - support for each is more or less equal these days.

Several examples of coot extensions to the language can be seen by examining the 0-coot-state.scm file that coot leaves behind when it finishes.


Coops generates a coot script from the output of molprobity, specifically probe, reduce, cluster and clashlist.

For an explanation of the principals underlying reduce and clashlist see the Dots Page. Get Molprobity software here.

Use Coot version 0.1 or higher.

Invoke like this (from the directory in which you run coot):

$ coops myfile.pdb

The use Calculate->Scripting to read in and run coops.scm

Get COOPS here.

Example Scheme Script 1: Move to Molecule Centres

This example can be found in the coot scheme sources (the function name is molecule-centres-gui and is in the xxx/share/coot/scheme/coot-gui.scm file). It is a simple function that creates a button box - a button for each coordinates molecule in Coot. It is annotated. Reproduced as coot-scheme1.

Example Scheme Script 2: Demo a Few of Coot's Features

Reading in a pdb file, an MTZ file and manipulating the model

This is a composite script and demonstrate reading pdb file, an MTZ file, translations, zoom, spin zooms, contour level changing, map masking, real space refinement, water addition and loop fitting.

The data files used in the example can be obtained here and here. Put them in the directory where you start coot. Save the script to your disk, then use Calculate -> Run Script... to activate it.

Example Scheme Script 3: Read CNS data

This CNS data reading script is a Cootenization of the CN2COOT script written by Joel Bard (it is based on his csh script) and can be used to compare and contrast scheme programming and shell script programming (the coot version is longer to some extent because it does extra error checking).

As well as doing the conversion the resulting mtz/maps are loaded into Coot.

It is part of Coot as of version 0.1.2.

Example Scheme Script 4: Load the Latest Data and PDB files Automatically

To load the most recent files, do this:

coot --script latest-files.scm

which enables the scripting function: (load-latest-files)

For extra gui goodness (you will need 0.1.2):

coot --script latest-files.scm --script extensions.scm

Example Scheme Script 5: Saving a Partial model

Here we create a small function to save part of a molecule and add a gui interface, it can be used in the usual way (i.e. with --script on the command line, Calculate->Run Script... or add the script to your ~/.coot file.


Example Scheme Script 6: Creating an interface for the Powermate Dial

The Powermate dial can be used with coot. One could just assign the rotations to +/-y keys and be done with it, but this script gives you a way of having positive and negative rotations in all three cartesian directions. The F1 key is mapped to positive rotation, the F2 key to negative rotation, and the F3 key permits you to toggle through x, y, and z, on successive key presses. I then map F1 and F2 into the ordinary rotations on the powermate (using send key equivalents) and then I map F3 into the single click on the dial, making it easy to toggle through x, y and z. The press-and-rotate options remain available; I map these into scroll up and down, and put them on the slowest response setting, which makes contouring density easier to control than it is from my mouse scroll wheel.


Example Scheme Script 7: Applying arbitrary value to "B" factor column

Imagine you have a file of some property (Chemical Shifts, for example) of a residue that you wish to apply to the atoms of a particular model from a pdb file as pseudo B factors. Here's how to do that in Coot:

We have a file "" like this, the residue number then the chemical shift value (one for each residue in a particular chain):

1 1.53159

2 4.35884

3 4.07123

4 4.16932

5 6.69103

6 7.12071

7 10.7419

8 9.57176

Use apply-cs.scm to apply these values as pseudo temperature factors. Typical usage, where "A" is the chain id, and the file of values per residue.

(apply-cs (read-pdb "test.pdb") "A" "")

 --script apply-cs.scm

Example Script 8: Partial Occupancy Dialog

Imagine that you have a structure that has residues with partial occupancy. After refinement, it would be convenient to quickly navigate to all such residues. How can that be done?

Start coot with command line arguments:

 --script partial-occupancy-navigation.scm

This will provide an extra menu item called "Extras", clicking on "Residues with low occupancy..." therein will lead you through the process. Note that this will often work with SHELXL molecules, because they have atoms with negative (e.g -31) occupancies.

Note also that you will need a recent version of Coot to use this, as it stands. This will not work on stock Coot version 0.4.x. You can enable this for use with 0.4.x if you update/replace your xxx/share/coot/scheme/coot-gui.scm file from here.

Example Script 9: A GUI for Chopping Back Sidechains from a Residue Range

This is a simple interface to the delete-sidechain-range function, it illustrates how arguments can be transfered from the GUI to the scripting function. It was written in response to a question from Byron DeLaBarre.

Unfortunately (prior to 0.5) there was an error in the standard delete-sidechain-range function, which is why we over-ride it.

 --script chop-side-chains-gui.scm

Example 10: How do I bind a key to Toggle the display of NCS ghosts?

With this script: toggle-ncs-ghosts-script

Example 11: Paul Emsley's Key Bindings

Just so you get an idea of the customization by key bindings here are what Paul uses currently (add to your .coot file).


Optional Wrappers and (External) Shell Script Enhancements

I (wgscott) wrote a coot wrapper shell script that lets you convert xplor/cns maps on the fly (you need to install mapman first) and has a few other enhancements.

I also made a Coot OS X applet that allows you to drag and drop a cns/xplor or ccp4 mapfile or any other coot-compatable file (mtz or pdb file, for example). Using the File > Get Info dialog, you can program this applet to open all .map and all .mtz files, if you want to, making these files double-clickable.

Download the Applet (requires a separate working coot installation)

Enhanced Menu Appearance

As of 0.4, coot works with gtk+2

This permits use of themes for a more OSX-like experience, among other things.

Click on the thumbnail image below to see a full-size screenshot of Coot with a gtk+2 Aqua-like theme.


To get this effect, you need the Glossy_P gtk+2 theme:

Edit a file called ~/.gtkrc-2.0 and put into it the following line:

include "/usr/share/themes/Glossy_P/gtk-2.0/gtkrc"