For this course we will use a version of the Python programming language that was enhanced to provide more utility to scientists. It is called the Enthought-Python distribution. Among other features it includes libraries for fast numerical computation as well as plotting and visualization capabilities.
Note
All the libraries that are included in the Enthought-Python distribution are free, open source libraries that can be individually installed. The primary reason for choosing the Enthought-Python distribution is the convenience of having a large number of libraries installed at once. The Enthought-Python distribution is not an absolute requirement. You may skip the installation step if you already have or know how to install Python, Matplotlib, numpy and scipy onto your computer.
Your first task is to visit the Enthought-Python web site and obtain the software that matches your operating system. Select the option called Educational Use, download the program then install it. Follow the steps below that correspond to your operating system.
We will often make use of the application called Terminal, find it (use Spotlight) and place it in your Dock. Start a terminal then type:
python --version
It should print:

Create a folder named course and within that a new folder for each week (starting with week1).

We will make use of the Command Prompt utility. It can be found in the Program Files ‣ Accessories ‣ Command Prompt location. In Windows Vista you may search for the word Command. Create a shortcut to it on your Desktop (for example right click, Send To ‣ Desktop (create shortcut) Now start a Command Prompt and type:
python --version
It should print:

Create a home folder on your hard drive. Within this directory create a folder named course and within that a new folder for each week (starting with week1).

We will use the Komodo-Editor on all operating systems. Visit the web page and install it. Once installed store it in your Dock/Desktop as well. We will now enable Komodo Edit to run python. In the menu bar navigate to Toolbox ‣ Add ‣ New Command and add the name Python with the command:
python -t %F 2>&1

The purpose of the first symbol -t is to configure python to print warnings when encountering inconsistently formatted programs. The second parameter %F is a place holder for the name of the file that is being edited. The last symbols 2>&1 are needed to redirect the standard error stream into the standard output (this is specific to this editor, otherwise not relevant). The last step is to set the Start in field to %D in the Advance Options tab (see above).
Now click the Key Binding tab on the window shown above. Click inside the New Key Sequence field, hold the Ctrl key and press 1 then click the Add button.

We are done with the setup. Let’s test that it works as intended. Create a new python program with Komodo Edit. Select the menu item File ‣ New File then select the Python template and specify a file name. Remove the content that may already be there, then write:
print "Hello World!"
Now save the file (shortcut Command+S on a Mac or Ctrl+S on Windows ) then press key bindings that we’ve set up before Ctrl+1. If the installation is correct you should see the words Hello World! appear in the lower panel (as seen below).

For Windows download and install from the BioPython webpage. Use the file named biopython-1.52.win32-py2.5.exe
For Mac OSX Leopard you may download a custom build that I created for this lecture series. biopython-mac.zip:
Write this code to test that the installation has been correct:
from Bio import Entrez, SeqIO
ids = [ "AB028471", "AY249138", "AY249989" ]
for id in ids:
handle = Entrez.efetch(db="nucleotide", id=id,rettype="gb")
record = SeqIO.read(handle, "genbank")
handle.close()
print id, len(record.seq), record.seq[:15]
This code will connect to genbank and retrieve the nucleotide sequence (prints the first 15 bases) for each of the identifiers stored in the ids array.
Note
In general, during this course, we recommend that you do not get discouraged if you encounter difficulties when installing/using software. You’ll soon see that most problems have a simple, although often non intuitive solution. Think of them as a puzzle.
Spend some time on understanding the problem. Try to formulate (read aloud) your own expectations then compare them to what you experience instead. Diagnose the symptoms, evaluate the scope of the issues involved.
This does not mean we’re not here to help! Please feel free to contact the lecturer if you are having problems.