Tuesday, October 25, 2011

Installing CCP4, Coot, Pymol and Phenix on Ubuntu 11.10

CCP4, Coot, pymol and Phenix will give you 95% of the programs you need for crystallography.  What is important here is that they all like to look at each other and they all have obscure dependencies and whatnot, so to make your life easier its best to install them all in a marathon session in the exact order I'm describing.  

My setup:
Ubuntu 11.10 64 bit

Currently I have the Nvidia 3d setup described in the previous post up and working.  I tested it in both Coot and pymol after I installed them and they both worked.

NOTE: the order that these are installed is (maybe) important!  Also, this is probably not the only way to get this done, it is however one way to get it done.

Download:

Select linux and either the 32 or 64 bit depending on your system and then "typical installation"
Agree to the license and then download the package.  Its about 1.6 Gb so it'll take a minute.


I downloaded binary-Linux-x86_64-rhel-4-python-gtk2 for my system.


Request a download password and check your email, then download the installer.

Pymol: Go to the Ubuntu Software Center, search for pymol and install it.  Done.

Install CCP4:

Every version of Ubuntu is a little bit different and google can tell you most specifics.  For Ubuntu 11.10 you have to install the following dependencies using the Ubuntu Software Center:

bison
curl
flex
gfortran
libncurses5-dev
libxaw7-dev
libx11-dev
xfonts-75dpi
libjpeg62-dev

Once those are installed you should unpack the tar.gz ccp4 file with archive manager.  I like to install ccp4 in /opt so I made a directory

cd /opt
sudo mkdir ccp4
sudo chmod a+w ccp4

Go to the directory you unpacked ccp4 in and type

sudo ./install.sh

It will prompt you to install in the unpacked directory, type "N" then "/opt/ccp4" for the install directory.  Press enter for the remaining choices.  NOTE: be careful with the license!  If you skip through it too quick it will auto-select "no" and you have to start over!

Once the installation is finished you have to source the file (basically this means you know where all the executables are).

source /opt/ccp4/setup-scripts/sh/ccp4.setup

Test out your installation by opening a terminal and typing:

ccp4i

Install Coot

The current coot that ccp4 installs never works for me, however its easy to fix since we downloaded the latest coot.  Basically we delete the coot files and put in new ones.  It seems sketchy, but it works.

First install one dependency using the Ubuntu Software Center:

python-gnome2

Unpack the coot tar file that you downloaded into some temporary directory.   Now make it so you can delete the coot in ccp4

cd /opt/ccp4
sudo chmod a+w -R Coot-0.6.2

Its easiest to then open a folder browser and navigate over to /opt/ccp4/Coot-0.6.2.  Delete everything inside this folder (if you want to be careful, just move it to some other folder for safe keeping).

Now copy all of the new coot files from your temp directory to Coot-0.6.2.  

Open a terminal and type "coot" to test.  It should already be sourced by ccp4.

Install Phenix

Again we will install this to /opt so

cd /opt
sudo mkdir phenix
sudo chmod a+w phenix

Unpack the archive into a temporary directory and go to this directory.  To install simply open a terminal and type:

sudo ./install --prefix=/opt/phenix

Once the install is complete, we again need to source the code:

source /opt/phenix/phenix(yourversion)/phenix_env.sh

Test the install by opening a terminal and typing:

phenix

It is helpful to try out one of the tutorials and test out that phenix is properly linked to both Coot and Pymol.

Further programs

Clearly this is not an exhaustive list of crystallography programs, however it should get you started.  The next time I have to install one of those others, I will make a similar post.

Installing nVidia 3d Vision on Ubuntu 11.10

We are using the nVidia 3d Vision to visualize crystal structures, etc. in Coot and Pymol and it turns out to be NOT TRIVIAL to get this set up. I'm putting this together as a reference however the particulars will clearly depend on Ubuntu version and your specific graphics card model.

A later post will describe installing all of the crystallography programs soup-to-nuts on Ubuntu.

My setup:
Ubuntu 64 bit 11.10 
nVidia Quadro FX 3800
nVidia 3d Vision Kit (emitter, glasses, HD monitor)
Homemade cable 3-pin mini DIN cable (see http://www.zib.de/durmaz/3dVision.html)

Using additional drivers, use the recommended current nvidia driver (for me 280.13).  If you had a clean install and you allowed third party drivers, it should already be installed and functioning.

3d hardware stereo requires disabling composite, which happens to be essential for running the Unity desktop.  We will install the gnome fallback shell:

sudo apt-get install gnome-session-fallback

We also want to install a simple test that hardware stereo is functioning:

sudo apt-get install mesa-utils

Restart your computer and at the login select GNOME-classic (No Effects) as your login shell (click on the gear icon next to your user name).

The final step is to edit your xorg.conf file to enable stereo.  If you've never adjusted anything with the nvidia-settings or nvidia-xconfig it is first easiest to make sure nvidia has written the xorg.conf.  By default Ubuntu always installs a pretty paltry xorg.conf on my computer.

If you need to generate an xorg.conf, type in a terminal:

nvidia-settings



Click on "X Server Display Configuration" and then in the lower right, "Save to X Configuration File".  You now have a nvidia generated xorg.conf.

Close and back in the terminal we will enable stereo by typing:

sudo nvidia-xconfig -stereo=10

It should say that it needed to disable composite.  If there is any error in writing to either /etc/X11 or xorg.conf you can try to manually make them writable using:

sudo chmod a+w /etc/X11/xorg.conf

For reference my final xorg.conf file now looks like this:

(pending!)

Restart your computer.  If everything went well the IR emitter should be steady faintly green.  If it is faint blinking red, the video card driver isn't working properly.

Assuming the IR emitter is faint green, open a terminal and type:

glxgears -stereo

The IR emitter should be BRIGHT green and you should see quad buffered stereo on the screen, put on the glasses and enjoy.