biopython

Meeting the BioPython

The Biopython Project is an amazing initiative that helps scientists use Python for bioinformatics – and it’s exceptionally easy to learn!

You can access online services, parse (read) different file types, analyze, and do a bunch of fun stuff with your data with Biopython. The people behind the project have put in a lot of effort to ensure that using the package is easy and effortless to use.

Python is one of the easiest programming languages to learn – which adds to the simplicity of using Biopython. So there’s no reason to shy away from that blinking screen. Get on your text editor and start coding!

Getting a Cozy Habitat for your (Bio)Python

The first step to installing Biopython is setting up Python on your computer. Biopython works best on Python 2.7, but they also have a new release that supports Python 3.x (if that’s what you prefer).

If you’re new to this, just install Python 2.7.

For Windows

Simply go download Python-2.7.5.msi. Run it and you’re sorted!

For Mac OS X

Your computer comes pre-installed with Python. To check the version, simply type:

python —version

in your Terminal.

Some people prefer to install python in a separate directory to use for their own development projects (to avoid any problems that may occur if you accidentally delete something – although this is extremely rare). If you want to do this, simply install Homebrew (it’ll take care of everything and more). Then, you can install Python.

Side note: I cannot recommend pip enough. It’s a python package manager. It’s really handy for installing all the different python packages you may need in the future. To install it, simply type

sudo easy_install pip

in your Terminal window.

Bringing the BioPython home

So we’ve set the stage and you’re already getting comfortable with the Terminal – you’ll be writing your first Python program soon!
Now that you have Python, it’s time to install the dependencies for Biopython. Dependencies save programmers time so that they don’t have to rewrite code.

Biopython relies on the NumPy package (among others; but this is the only one you need to install right now).

For Windows

Simply download and execute the package.

For Mac OS X

Go to your terminal window and type:

sudo pip install numpy

And you’re all set!

And now, finally! We install Biopython.

For Windows

Simply download the latest .exe file that is compatible with your version of Python. And huzzah!

For Mac OS X

Go to your terminal window and type:

sudo pip install biopython

(Told you pip is amazing!)

And you’re done!

If you run in to any problems with installation, you can check out the official documentation.

Now that everything is installed, you can write your first Python program. I strongly recommend the Atom Text editor, but you can use whichever editor you like.

And to help you get started with writing that code? We’ve got you covered.

Image credit: marissa anderson

1 Comment

  1. TVZ on June 1, 2017 at 12:13 pm

    I would also recommend that users new to Python 1) check out the PyCharm IDE, which has capabilities far beyond a text editor and 2) install the Anaconda distribution, which comes with most of the other useful scientific packages (Numpy, SciPy, etc.) already installed.

Leave a Comment