Coot

Revision as of 09:54, 27 February 2008 by Emsley (talk | contribs)
Coot-with-ATP-vector.png

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 (at least in Debian, so I assume this is the case for other package management systems as well).

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
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

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
make
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/coot_wrap_python.cc and src/coot_wrap_guile.cc files

/bin/rm -f **/coot_wrap_**.cc
cd src
touch c-interface-database.hh
make coot_wrap_guile.cc
make coot_wrap_python.cc
cp coot_wrap_guile_pre.cc coot_wrap_guile.cc
cd ..

Now compile it:

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

Now add the reference structures:

cd share/coot
wget http://www.ysbl.york.ac.uk/~emsley/software/coot-reference-structures.tar.gz
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 http://www.ysbl.york.ac.uk/refmac/data/refmac5.4_dictionary.tar.gz
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):

 export COOT_REFMAC_LIB_DIR=$COOT_PREFIX/lib

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/.
 end

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

Scripts

Coot can be scripted in scheme (guile) or python. Best supported currently is the scheme scripting. PE most encourages scheme scripting.

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

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

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

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.

Example Scheme Script 3

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 (will be) part of Coot as of version 0.1.2.


Example Scheme Script 4: loading 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.

save-partial.scm

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.

powermate-coot.scm

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 "cs.tab" 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 cs.tab the file of values per residue.

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

 --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


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:

http://art.gnome.org/download/themes/gtk2/571/GTK2-Glossy_P.tar.gz

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

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