Skip to content

aperkins19/bayesian_protein_concentration_from_bradford

Repository files navigation

Introduction

This Docker Template will allow you to set up a Docker Image with Jupyter Notebook and any Python Packages that you wish to install.

Note: this is for windows only. If you are using Mac or Linux then you'll have to use Terminal. It's basically the same but you'll have to use different commands. The major difference is in the docker run command (see step 5)

All lines of code and Command Line Commands are flanked by double quotes e.g.

copy this code into the command line.py

If you have any issues, please contact me. Alex Perkins [email protected]

BUILD AND RUN DOCKER CONTAINER.

  1. Check Docker is installed. If you've never installed Docker, use this tutorial. https://www.youtube.com/watch?v=_9AWYlt86B8

Check it's there:

docker --version

  1. Check that the docker Daemon is actually running.

docker ps

If it is, you see a list of your current containers. Might be empty. Either way, you'll this:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

If not: Some sort of error

This youtube vid will help you troubleshoot. https://www.youtube.com/watch?v=YFUhdxI4kcA

  1. Download the repo from git or unzip the zip file.

  2. Open command line and navigate to the unpacked directory

You can get the path by 'Copy address as text' in the URL of your file manager. Be sure to stick the url in it's own quotes as below. This enters it as a string and will allow CMD to read any spaces in the path correctly.

cd "C://mypath/directory/my project/subfolder"

  1. Define the python packages that you wish to use in requirements.txt file. e.g.

matplotlib pandas numpy

  1. Build the docker image

docker build -t jupyter_with_bespoke_python_packages .

  1. Run your container on port 8888 e.g.

docker run -p 8888:8888 -v "%CD%":/src jupyter_with_bespoke_python_packages

If you're on Mac or Linux:

docker run -p 8888:8888 -v "%PWD":/src jupyter_with_bespoke_python_packages

If the image isn't already on your machine, it'll be downloaded.

The way it works is by: a. starting a Docker Container b. Mounting your current directory ("%CD%") to a directory in the container ("/src") so that files can be shared and moved in and out. c. starting a jupyter server.

  1. If it has started correctly, you'll get a url token. Copy the token provided into your brower URL

It should look like this:

"" http://127.0.0.1:8888/?token=3c96d2a50decb4302c3e96b87ba7444d286e335d07c478fe ""

It should open up a Jupyter File explorer in the directory in your browser.

  1. Move your rawdata file (.CSV) into the directory and check it's appeared in the Jupyter directory.

  2. Open bradforddataprocessing.ipynb and execute all cells using the double arrow icon.

  3. It will create an output directory, move the raw data file into it, perform the analysis and put the products into the output directory. You can now move the output directory out and put it where ever you like.

  4. Shutdown Jupyter by CTRL-C and typing 'y' ENTER when prompted.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published