Difference between revisions of "Coot"

From CCP4 wiki
(Second, install a newer version of Clipper)
(Installing Coot on Linux)
Line 10: Line 10:
 
==Installing Coot on Linux==
 
==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).
+
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.
  
===First, [[Install CCP4 on Linux]].===
+
=== 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) [http://www.ysbl.york.ac.uk/%7Eemsley/coot/coot-faq.html Coot FAQ] to find "Additional Notes" for your operating system.
 +
In short, just go to http://www.ysbl.york.ac.uk/~emsley/software/binaries/nightlies/pre-release/  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).
 +
 
 +
Then un-tar it under /usr/local/src, 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 ===
 +
 
 +
====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.,
 
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.,
Line 22: Line 36:
 
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.
 
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===
+
====Second, install a newer version of Clipper====
 
Get the latest clipper from
 
Get the latest clipper from
  
Line 33: Line 47:
 
  --enable-mmdbold --enable-cif --enable-minimol
 
  --enable-mmdbold --enable-cif --enable-minimol
  
===Third, make sure the other needed dependencies are installed===
+
====Third, make sure the other needed dependencies are installed====
  
 
These include at least the following dependencies:
 
These include at least the following dependencies:
  
====Ubuntu packages====
+
=====Ubuntu packages=====
  
 
A [[list of coot dependencies]] that is probably only a subset
 
A [[list of coot dependencies]] that is probably only a subset
  
====Others that you have to make yourself: ====
+
=====Others that you have to make yourself: =====
  
 
[http://arglist.com/guile/goosh-1.3/ goosh] (I had to compile this myself)
 
[http://arglist.com/guile/goosh-1.3/ goosh] (I had to compile this myself)
Line 61: Line 75:
  
 
   
 
   
===Fourth, configure and build coot like this:===
+
====Fourth, configure and build coot like this:====
  
 
Use sudo zsh (or whatever shell) to open a root shell, and issue the commands
 
Use sudo zsh (or whatever shell) to open a root shell, and issue the commands
Line 107: Line 121:
 
----
 
----
  
===If you want to make it portable===
+
====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 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).

Revision as of 10:15, 30 April 2008

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.

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 http://www.ysbl.york.ac.uk/~emsley/software/binaries/nightlies/pre-release/ 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).

Then un-tar it under /usr/local/src, 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

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

Get the latest clipper from

wget http://www.ysbl.york.ac.uk/~cowtan/clipper/clipper.latest.tar.gz

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

Coot-screenshot-small.png


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

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

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

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.

Thumb-coot-gtk2.png

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"