This section will walk you through basic Unix usage and installing Infernal, the Vienna RNA suite, and RALEE mode for emacs. It assumes you are working on a fairly standard modern Unix/Linux derivative or OS X. These instructions may work under Windows with e.g. Cygwin, but I have not tested this.
Basic Unix Commands
Most Unix commands make use of simple mnemonics in their naming.
cd: change directory, used to move up and down in the file system hierarchy. ".." refers to the directory above the current one. ~ refers to your "home" directory, your personal directory where you can install and work on things.
pwd: print working directory, tells you which directory you are in and its place in the file system with respect to the "root" directory.
mkdir: make directory, create a directory with the given name.
ls: list directory, lists the contents of the current (or named) directory. Lots of command options here to get different types of file information, -Flah will tell you most you'll ever need to know.
cp: copy, create a copy of a file. Syntax "cp file1 file2" will make a copy of file1 called file2.
mv: move, move a file. Syntax "mv file1 file2" will move file1 to file2 - like copy but the original is deleted.
rm: remove, deletes a file. Note that you generally can not undo this, so be very careful. "rm -r" will remove directories and everything under them. "rm -rf" will get rid of confirmation messages, again - BE VERY CAREFUL.
tar: tape archive, a program and file format that archives a large number of individual files for back-up or transferal. Name is a holdover from days of magnetic tape backups. Now commonly used for bundling source code. Will often by compressed using gzip or bzip2 (e.g. filename.tar.gz or filename.tar.bz2). "tar -xzvf package.tar.gz" will extract and unzip package.tar.gz, while giving you lots of information.
>: used to redirect output, usually to a file. For instance "ls > test.txt" will put the output of ls in to a text file called test.txt.
The Unix command line is extremely powerful, and there is much more you can do with it than I could hope to cover here - this page has a more thorough introduction for the absolute beginner.
Installing packages
Now that you've (hopefully) got a handle on navigating the Unix directory structure, we'll install the packages we'll need to build our covariance models.
First, download:
When prompted make sure you save the file, rather than automatically opening it with whatever your browser recommends. You'll need to figure out where your browser saves downloaded content, ~/Downloads is a popular location. Move them to your home directory using the following:
mv /path/to/infernal-1.0.2.tar.gz ~
mv /path/to/ViennaRNA-1.8.5.tar.gz ~
mv /path/to/ralee-mode.tar.gz ~
First we'll extract and compile Infernal. Make sure you're in your home directory (cd ~) and run the following:
tar -xzvf infernal-1.0.2.tar.gz # Decompress and unarchive
cd infernal-1.0.2 # Change in to infernal directory
Unix packages often have installation instructions in a file called INSTALL, README, or something similar. You should ALWAYS read these files before installing, as they will often give information on common problems or alternative installation options. Nonetheless, the Infernal installation is fairly standard:
./configure # Configure the package for compiling and installation
make # "make" the package - that is run everything to compile the infernal executables.
If everything's gone well, you should now have a number of executables in the ~/infernal-1.0.2/src directory -- we will go over using these later in the tutorial. For now, just test that they're working by typing:
./src/cmbuild
You should get the following response:
Incorrect number of command line arguments.
Usage: cmbuild [-options] <cmfile output> <alignment file>
where basic options are:
-h : show brief help on version and usage
-n <s> : name the CM(s) <s>, (only if single aln in file)
-A : append this CM to <cmfile>
-F : force; allow overwriting of <cmfile>
-v : be verbose with output
--iins : allow informative insert emissions, do not zero them
--Wbeta <x> : set tail loss prob for calc'ing W (max size of a hit) to <x>
--devhelp : show list of undocumented developer options
To see more help on other available options, do ./src/cmbuild -h
This means everything is (probably) working as it should. If you're doing this on your own computer you could then use "make install" to put these executables in /usr/bin, but for now we'll just leave them where they are. You should be able to compile the ViennaRNA packages using this same recipe. Compiled executables will be in Go ahead and try!
Installing RALEE
RALEE isn't really it's own independent program, but rather is a mode for the emacs text editor specifically for manipulating RNA alignments. As such it's installation is somewhat different. We won't be covering the specifics of emacs use, so make sure your emacs supports a GUI interface... or learn emacs navigation?
First, make a directory where your emacs extensions can live:
cd ~
mkdir site-lisp
Now copy the RALEE lisp extensions there:
tar -xzvf ralee-mode.tar.gz
cp ralee-0.7/eslisp/* ~/site-lisp/.
And add the RALEE perl scripts to your path:
export PATH=$PATH:~/ralee-0.7/perl
You can make this change your your path permanent by adding this line to your .bashrc (or equivalent.)
Next you'll need to tell emacs where to find all this stuff! Open (or create) the file ~/.emacs and add the following:
;-------
(add-to-list 'load-path "~/site-lisp")
;-------
;-------
;; ralee mode is good for RNA alignment editing
(autoload 'ralee-mode "ralee-mode" "Yay! RNA things" t)
(setq auto-mode-alist (cons '("\\.sto$" . ralee-mode) auto-mode-alist))
;-------
;-------
;; Show current line and column number
(column-number-mode t)
(line-number-mode t)
;; Show parenthesis pairs - screws up XEmacs
(show-paren-mode t)
;; Always end a file with a newline
(setq require-final-newline t)
;-------
;-------
;; Let emacs know where Vienna lives
(add-to-list 'exec-path "~/ViennaRNA-1.8.5/Progs")
;-------
You should now be able to open RNA stockholm alignments in emacs and see them with conservation and secondary structure marked up! Try this one from Rfam!