Harvard:Biophysics 101/2007/Notebook:Denizkural/2007-2-2: Difference between revisions
Denizkural (talk | contribs) |
Denizkural (talk | contribs) |
||
Line 49: | Line 49: | ||
python example.py | python example.py | ||
==The | ==The Assignment== | ||
Now we have biopython ready, I got the following output after running the script as it is initially given: | Now we have biopython ready, I got the following output after running the script as it is initially given: | ||
Revision as of 03:12, 14 February 2007
I would like to share my experiences on installing python and biopython on Ubuntu-Edgy Eft - it was relatively straightforward but not entirely obvious. If you have naively installed the python-biopython package with the correct dependencies like I did and received errors from GenBank, read the following to avoid wasting time:
Installing/maintaining packages on Ubuntu
First of all, this is not meant to replace the extensive online documentation Ubuntu has. Before doing anything, go to System->Administration->Software Sources and make sure you select all the sources you will need. You can either use Synaptic Package Manager or use the command-line. Synaptic is fairly self-obvious. You usually need some kind of root access to manage packages. I recommend doing your updates/upgrades regularly - this will make sure you maintain an up-to-date list of available package, and upgrade packages when they get updated:
sudo aptitude update sudo aptitude upgrade
To install/upgrade a package:
sudo aptitude install [package] sudo aptitude upgrade [package] to give an example: sudo aptitude install gcc
Installing Biopython
Note that the following ara package names and you can just plug those names to the above. Most Ubuntu installations already come with the following but make sure you have them:
- python (2.3 or higher)
- gcc (or any other
Make sure you install or update the following packages:
- python-dev
- python-egenix-mxtexttools
- libc6-dev
- python-numeric
- python-numeric-ext
And then install biopython:
- python-biopython
In theory we should be all set, but the problem is that this package is not made from the latest version of biopython we want to install it nonetheless to get the dependencies right. Download the latest stable release from the biopython website, currently residing at http://biopython.org/DIST/biopython-1.42.tar.gz and untar this file into a directory:
tar xzvf biopython-1.42.tar.gz cd biopython-1.42
You can alternatively do this just using the GUI, clicking etc. Now, from that directory, run the following commands:
sudo python setup.py build sudo python setup.py install
Note that on the README it asks you to run test as well. I did and it seems to not progress after the 3rd test, and for now I haven't seen any harm in skipping the tests. I will report on this more later. You're all set, save any script to a file (usually with a .py extention but this is not strictly necessary) and run it using the following:
python example.py
The Assignment
Now we have biopython ready, I got the following output after running the script as it is initially given:
GenBank id: BC126209.1 total sequence length: 5148 method 1 A 1669 AA 427 AAA 150 AAAA 48 AAAAA 16 AAAAAA 8 AAAAAAA 4 AAAAAAAA 1 AAAAAAAAA 0 method 2 A 1669 AA 589 AAA 218 AAAA 76 AAAAA 29 AAAAAA 13 AAAAAAA 5 AAAAAAAA 1 AAAAAAAAA 0
tbc...