How to run my command-line programs 

 
Installing my executable programs
Most of my programs are distributed as stand-alone binaries (executable files). Each program is distributed as one file, the executable. There are self-contained: they do not require configuration files, environment variables, third-party libraries or other external dependencies. They don't have setup scripts or installers because they're not needed. All you need to do is download or copy the executable (binary file) to a directory that is accessible from the computer where you want to run the code.

Compiling from source
Sometimes you need to compile from source, e.g. when I don't provide a binary for your platform. This requires two steps: 1. extracting the source code from the archive, and 2. running make. You should generally create a new directory for this purpose. The sequence of commands will look something like this:

mkdir sometool
cd sometool
# now download source code to sometool directory,
# let's say the archive is called sometool_src.tar.gz
tar -zxvf sometool_src.tar.gz
make

Sometimes, the source code is in a sub-directory with the version name. In this case, you need to change to that subdirectory before running make, e.g.:

tar -zxvf sometool_src.tar.gz
cd sometoolv1.2.3
make

After you've run make, you should find a binary file named sometool in the source directory.

Graphical interfaces
My programs are command-line programs: they do not have a graphical interface. They won't work if you try to start them from a graphical interface like Windows Explorer or the Mac Finder. You must start them from a command window or shell.

Starting a command window or shell
Windows: You can get a command-prompt by navigating Start > All Programs > Accessories > Command Prompt, or similar, depending on which version of Windows you're using. You can also use Start > Run, and type CMD or CMD.EXE when prompted for the name of the program to run.

Windows with Cygwin: If you're familiar with using Unix or Linux shells, you might want to check out the Cygwin environment: it's a really good Unix emulator for Windows. Sometimes I make Cygwin versions. Otherwise, native Windows versions of my programs will run fine under Cygwin, though there can be subtle issues with file names and path names because my code won't understand Cygwin-specific stuff like mount points. As a general rule, you can use Windows paths under Cygwin, including drive letters. You can use forward- or back-slashes in the path name, though you have to be careful with back-slashes because they're significant for the shell; usually it's easier to use forward slashes.

Linux or Unix: There are many different graphical interfaces and configurations for Linux and Unix, too many that I can cover them all. Look for an icon labeled something like ''Shell', Command window' or 'Terminal'. If you don't know how to get a shell prompt, you're probably going to have trouble figuring out how to use my programs -- I recommend getting a colleague to help you who is familiar with using command-line programs.

Mac: Look for the Terminal command under Applications > Utilities. This will give you a shell prompt similar to Unix and Linux. If you're not familiar with using shell commands, you're probably going to have trouble figuring out how to use my programs; I recommend getting a colleague to help you who is familiar with using command-line programs.

Permission denied error
The binary file must have read and execute permissions set. To check, use the ls -l command, e.g.:

  ls -l /usr/bin/muscle
  -rwxr-xr-x 1 robert users 1.1M 2009-03-19 14:56 /usr/bin/muscle

Notice the string of characters "-rwxr-xr-x". You should see three 'r's and three 'x's, these are the read and execute bits. If you don't, you'll need to use the chmod command to update the permission bits. For example,

    chmod a+rx /usr/bin/muscle 

Command not found error
If you get a command not found error or similar, then the executable file isn't in your path. The most common mistake people make is to put the program in the current directory when the current directory isn't in the path. To see the path under a shell, use:

  echo $PATH

If you're using a Windows command prompt, just type the PATH command:

  PATH

The current directory is represented by a period. To run a command from the current directory when there is no period in the path, you can use something like:

  ./muscle -in seqs.fa -out seqs.afa

Notice the dot and slash at the beginning of the line, this says run muscle from the current directory. If you don't know how to update your path, you can always use the full path name starting from the root (/), e.g.:

  /usr/bin/muscle -in seqs.fa -out seqs.afa

Under the Windows command prompt, use back-slashes:

  C:\MyPrograms\Muscle\muscle.exe -in seqs.fa -out seqs.afa