-
Notifications
You must be signed in to change notification settings - Fork 0
Running Iroki With Docker
If you don't have Docker, follow the instructions to install it here: Mac, Linux, Windows.
Note: If you have Windows, running Iroki with Docker may be your only option. Iroki has not been tested on Windows.
Check to make sure everything is working by typing
$ docker info
Note: Don't type the $. It just signals that the above was a command entered into the terminal.
If you get the following error
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Try the following (replace mooreryan with your user name):
sudo usermod -aG docker mooreryan
If you are not sure whether to chose the stable or the beta version, choose the stable version.
If you were previously using Docker Toolbox, then you might need to follow the instructions here: Docker for Mac vs. Docker Toolbox.
Note: I don't recommend this anymore. You should probably be using Docker for Mac instead.
If you get this error
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Run the following command
$ eval "$(docker-machine env default)"
You might want to put this line in your profile or its equivalent.
Get the iroki_docker script
Download this perl script, and change the permissions to executable.
$ \curl "https://raw.githubusercontent.com/mooreryan/iroki/master/bin/iroki_docker" > ~/Downloads/iroki_docker
$ chmod 755 ~/Downloads/iroki_docker
If you want to, move iroki_docker to somewhere on your path (you may or may not need sudo).
$ sudo mv ~/Downloads/iroki_docker /usr/local/bin
Note: If you type sudo and you are prompted for your password, type the same password you use to log in to your Mac user account.
Try it out!
$ which iroki_docker
should spit out
/usr/local/bin/iroki_docker
and (if you moved iroki_docker on your path)
$ iroki_docker -h
will display something like this....
RUNNING COMMAND: docker pull mooreryan/iroki
Using default tag: latest
latest: Pulling from mooreryan/iroki
Digest: sha256:422cd24f7efb733373ab0153e471020415c65612ff441c503ff9c391ba22fcde
Status: Image is up to date for mooreryan/iroki:latest
RUNNING COMMAND: docker run -v "$HOME:$HOME" mooreryan/iroki -h
# Version: 0.0.27
# Copyright 2015 - 2016 Ryan Moore
# Contact: moorer@udel.edu
# Website: https://github.com/mooreryan/iroki
# License: GPLv3
Iroki command line program.
Options:
-b, --color-branches Color branches?
-t, --color-taxa-names Color label names?
-e, --exact Exact pattern matching
-c, --color-map=<s> File with color mappings
-i, --biom=<s> Biom file to make color gradient
-s, --single-color=<s> Use single color gradient for single
group biom files
-n, --name-map=<s> File with name mappings
-a, --auto-color=<s> Specify color scheme for auto coloring
-d, --display-auto-color-options Display options for auto coloring
-f, --infile=<s> Name of input newick file
-o, --outfile=<s> Name of outfile
-v, --version Print version and exit
-h, --help Show this message
If you did not move the iroki_docker script to someplace on your path, then you will have to provide the whole path when running the command. E.g.,
$ ~/Downloads/iroki_docker -h
If you get the nice help banner, then you have a working installation of Docker and Iroki to use.
And here is an example of running a command. First download the test files.
\curl https://raw.githubusercontent.com/mooreryan/iroki/master/spec/test_files/basic.tre > ~/Downloads/basic.tre
\curl https://raw.githubusercontent.com/mooreryan/iroki/master/spec/test_files/basic_color_map_with_tags.txt > ~/Downloads/basic_color_map_with_tags.txt
$ iroki_docker --infile ~/Downloads/basic.tre --color-map ~/Downloads/basic_color_map_with_tags.txt --color-branches --color-taxa-names --exact --outfile ~/Desktop/hehe.nex --auto-color kelly
RUNNING COMMAND: docker pull mooreryan/iroki
Using default tag: latest
latest: Pulling from mooreryan/iroki
6a5a5368e0c2: Already exists
7b9457ec39de: Already exists
ff18e19c2db4: Already exists
6a3d69edbe90: Already exists
eaf982eec5d9: Already exists
9626c13fb27a: Already exists
33cca82b34cd: Already exists
b5b1afc1156a: Already exists
5351a1307758: Pull complete
Digest: sha256:f65a96f61f87f6c6d480955bde26931c87827f1866027a5d5fb7380cdde610f1
Status: Downloaded newer image for mooreryan/iroki:latest
RUNNING COMMAND: docker run -v "$HOME:$HOME" mooreryan/iroki --infile /Users/moorer/Downloads/basic.tre --color-map /Users/moorer/Downloads/basic_color_map_with_tags.txt --color-branches --color-taxa-names --exact --outfile /Users/moorer/Desktop/hehe.nex --auto-color kelly
I, [2016-09-27T21:30:41.451702 #1] INFO -- : Args color_branches = true, color_taxa_names = true, exact = true, remove_bootstraps_below = nil, color_map_f = "/Users/moorer/Downloads/basic_color_map_with_tags.txt", biom_f = nil, single_color = nil, name_map_f = nil, auto_color = "kelly", display_auto_color_options = false, newick_f = "/Users/moorer/Downloads/basic.tre", out_f = "/Users/moorer/Desktop/hehe.nex"
Node: 13 of 13
A couple cool things here are that using the iroki_docker script always checks for the latest version of Iroki automatically before running! Also, you don't have to worry about specifying full paths to the Docker image. You can just submit relative paths as if you were running Iroki on the host machine.