Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Bioinformatics with Python Cookbook

You're reading from   Bioinformatics with Python Cookbook Learn how to use modern Python bioinformatics libraries and applications to do cutting-edge research in computational biology

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781782175117
Length 306 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Python and the Surrounding Software Ecology 2. Next-generation Sequencing FREE CHAPTER 3. Working with Genomes 4. Population Genetics 5. Population Genetics Simulation 6. Phylogenetics 7. Using the Protein Data Bank 8. Other Topics in Bioinformatics 9. Python for Big Genomics Datasets 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.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image