Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Bioinformatics with Python Cookbook
  • Toc
  • feedback
Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

By : Tiago R Antao, Tiago Antao
4.7 (6)
close
Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

4.7 (6)
By: Tiago R Antao, Tiago Antao

Overview of this book

If you have intermediate-level knowledge of Python and are well aware of the main research and vocabulary in your bioinformatics topic of interest, this book will help you develop your knowledge further.
Table of Contents (11 chapters)
close
10
Index

Installing the required software with Docker

Docker is the most widely used framework that implements operating system-level virtualization. This technology allows you to have an independent container: a layer that is lighter than a virtual machine, but still allows you to compartmentalize software. This mostly isolates all processes, making it feel like each container is a virtual machine.

Docker works quite well at both extremes of the development spectrum: it's an expedient way to set up the content of this book for learning purposes and may be your platform to deploy your applications in complex environments. This recipe is an alternative to the previous recipe. However, for long-term development environments, something along the lines of the previous recipe is probably your best route, although it can entail a more laborious initial setup.

Getting ready

If you are on Linux, the first thing you have to do is to install Docker. The safest solution is to get the latest version from https://www.docker.com/. While your Linux distribution may have a Docker package, it may be too old and buggy (remember the "advancing at breakneck speed" thingy?).

If you are on Windows or Mac, do not despair; boot2docker (http://boot2docker.io/) is here to save you. Boot2docker will install VirtualBox and Docker for you, which allows you to run Docker containers in a virtual machine. Note that a fairly recent computer (well, not that recent, as the technology was introduced in 2006) is necessary to run our 64-bit virtual machine. If you have any problems, reboot your machine and make sure that on the BIOS, VT-X or AMD-V is enabled. At the very least, you will need 6 GB of memory, preferably more.

Note that this will require a very large download from the Internet, so be sure that you have a big network pipe. Also, be ready to wait for a long time.

How to do it…

These are the steps to be followed:

  1. Use the following command on the Linux shell or in boot2docker:
    docker build -t bio https://raw.githubusercontent.com/tiagoantao/bioinf-python/master/docker/2/Dockerfile
    
    • If you want the Python 3 version, replace the 2 with 3 versions on the URL. After a fairly long wait, all should be ready.
    • Note that on Linux, you will either require to have root privileges or be added to the Docker Unix group.
  2. Now, you are ready to run the container, as follows:
    docker run -ti -p 9875:9875 -v YOUR_DIRECTORY:/data bio
    
  3. Replace YOUR_DIRECTORY with a directory on your operating system. This will be shared between your host operating system and the Docker container. YOUR_DIRECTORY will be seen in the container on /data and vice versa.
    • The -p 9875:9875 will expose the container TCP port 9875 on the host computer port 9875.
  4. If you are using boot2docker, the final configuration step will be to run the following command in the command line of your operating system, not in boot2docker:
    VBoxManage controlvm boot2docker-vm natpf1 "name,tcp,127.0.0.1,9875,,9875"
    

    Note

    On Windows, this binary will probably be in C:\Program Files\Oracle\VirtualBox.

    On a native Docker installation, you do not need to do anything.

  5. If you now start your browser pointing at http://localhost:9875, you should be able to get the IPython Notebook server running. Just choose the Welcome notebook to start!

See also

  • Docker is the most widely used containerization software and has seen enormous growth in usage in recent times. You can read more about it at https://www.docker.com/.
  • You will find a paper on arXiv, which introduces Docker with a focus on reproducible research at http://arxiv.org/abs/1410.0846.
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete