Run metano as a docker image

n is available as a Docker image since December 2016. Currently, it provides all functions of n, except AMEBA.

Instructions for the Usage of n via Docker are available for Linux and Windows.

Docker Instructions for Linux

Install Docker

Go to the Docker site and follow the installation instructions for your Linux distribution.

Start the Docker deamon

Example given for openSUSE linux. For other distributions see this site.

> systemctl start docker

Download and run the n docker image

Download the image from our Docker Hub repository:

> docker pull jhelmecke/metano

Create a docker container and run the shell. Therefore you can provide the following options:

  • The -v option mount a host volume (fill in the path to your working directory which contains your model) to the Docker container. This folder is shared between your host system and the docker container.
    A default model is provided if the -v option is omitted. Be aware that you cannot export the simulated data, if you don't mount a volume to the Docker container.
  • The -it flag creates an interactive container, where you can run a shell such as /bin/bash.
  • If you want to run the container only once, you can simply add the --rm flag. Docker will automatically clean up the container and remove the file system when the container exits.

> docker run -v "/home/pathtomymodel:/home/model" -t -i jhelmecke/metano /bin/bash

Docker Instructions for Windows

Install Docker

Go to the Docker site and follow the installation instructions.

Note: If you have a Windows version that is older than Windows 10, you have to use the Docker Toolbox instead.

Start the Docker engine for the first time

Start Docker for Windows. Go to settings (right click on taskbar button) and enable the “Shared Drives” option.
Run all Docker commands in Windows PowerShell (Windows 10) or with Docker Toolbox (older Windows).

Download and run the n docker image

Download the image from our Docker Hub repository:

> docker pull jhelmecke/metano

Create a docker container and run the shell. Therefore you can provide the following options:

  • The -v option mount a host volume (fill in the path to your working directory which contains your model) to the Docker container. This folder is shared between your host system and the docker container.
    A default model is provided if the -v option is omitted. Be aware that you cannot export the simulated data, if you don't mount a volume to the Docker container.
  • The -it flag creates an interactive container, where you can run a shell such as /bin/bash.
  • If you want to run the container only once, you can simply add the --rm flag. Docker will automatically clean up the container and remove the file system when the container exits.

> docker run -v "C:\Users\me\pathtomymodel:/home/model" -it jhelmecke/metano /bin/bash

Example with default model

As described above, a metabolic model is provided as default, unless no own volume is mounted to the /home/model directory. To check if your docker container works correctly, you can run a FBA with the default model:
> docker run -it jhelmecke/metano /bin/bash
bash-4.3# cd home/model
bash-4.3# fba.py -r rea.txt -p sce.txt -o fba.txt

Info: The metabolic network has 856 reactions and 744 metabolites.
Info: The reduced network has 622 reactions and 490 metabolites.
Value of objective function at solution: 0.0867012096732
Total absolute flux: 507.374561404

Further docker commands

Exit the docker container when done:

 bash-4.3# exit 

Show all current docker images and remove them if they are not needed anymore:

> docker images
> docker rmi jhelmecke/metano

Running the AMEBA extension in a Docker container

Note: Currently, the AMEBA extension works only on containers with a Linux Distribution as Host OS. It was tested with Debian 8.6 and openSUSE Leap 42.2.
You can run the docker container from your bash by typing:
 docker run -it --net=host --env="DISPLAY" -v "$HOME/.Xauthority:/root/.Xauthority:rw" -v "/home/pathtomymodel:/home/model" --name ameba jhelmecke/metano-ameba /bin/bash
  • The -v "$HOME/.Xauthority:/root/.Xauthority:rw" option mounts your X11 socket to the container. This is a possible way to show the visual output of the docker container on your screen.
  • The --net=host --env="DISPLAY options share the network and display environment between Host OS and Docker container.
  • The -v "/home/pathtomymodel:/home/model" option mount a host volume (fill in the path to your working directory which contains your model) to the Docker container. This folder is shared between your host system and the docker container.
    A default model is provided if the -v option is omitted. Be aware that you cannot export the simulated data, if you don't mount a volume to the Docker container.
  • The -it flag creates an interactive container, where you can run a shell such as /bin/bash.
  • If you want to run the container only once, you can simply add the --rm flag instead of naming it with --name ameba. Docker will automatically clean up the container and remove the file system when the container exits.

Testing AMEBA

You can test AMEBA with the default model by typing:

> docker run -it --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --rm jhelmecke/metano-ameba /bin/bash
# cd /home/model
# ameba -r rea.txt -s fba.txt -c bpa.ini -n chorismate[C_c]
You should see the visual graph in a new window, if AMEBA works properly.