Hi @Mehrbod_Estaki, apologies that the docker
instructions aren't fully written yet. It actually sounds like you have a fully functional install of docker
, and also have the qiime2
image pulled down! The reason you don't have qiime
available in your PATH
is because docker
runs all commands and environments in a sandboxed execution container (so, this is actually by design). Right now there are two strategies for executing qiime
commands in the docker
container: ad hoc, or in an interactive shell session. The command example you provided above falls into the "ad hoc" category, you craft a docker
command (docker run -t -i -v $(pwd):/data qiime2/core:2017.6
), then append your qiime
command to the end (qiime
, or qiime info
, for example).
Strategy One (ad hoc)
So, now for an example of how this works. If you wanted to run the following qiime
commands (these are just example commands that might be run as part of an analysis):
$ qiime demux emp-single \
--i-seqs emp-single-end-sequences.qza \
--m-barcodes-file sample-metadata.tsv \
--m-barcodes-category BarcodeSequence \
--o-per-sample-sequences demux.qza
$ qiime demux summarize \
--i-data demux.qza \
--o-visualization demux.qzv
To run those commands in docker
, you would modify those commands to look like this:
$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 \
qiime demux emp-single \
--i-seqs emp-single-end-sequences.qza \
--m-barcodes-file sample-metadata.tsv \
--m-barcodes-category BarcodeSequence \
--o-per-sample-sequences demux.qza
$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 \
qiime demux summarize \
--i-data demux.qza \
--o-visualization demux.qzv
A quick note on the docker run -t -i -v $(pwd):/data qiime2/core:2017.6
business. The first bit (docker run
) instructs docker
to run
a container. The next two flags (-i -t
) tell docker
to run the container interactively, and with a psuedo-TTY allocated. Next, this bit instructs docker
to mount your current working directory to the container's data directory as a volume (-v $(pwd):/data
). Finally, the command ends with some info for docker run
to know just what image we want to run - the 2017.6 tag of the qiime2/core image (qiime2/core:2017.6).
This strategy creates a new docker
container for each qiime
command you run, so you probably want to experiment with some of the docker run
flags specific to container cleanup and housekeeping.
Strategy Two (interactive shell)
The other option is to launch a docker
container, and then execute your qiime
commands once you are working inside the container.
Again, starting with some example commands that you might want to run in qiime2
:
$ qiime feature-table summarize \
--i-table table.qza \
--o-visualization table.qzv \
--m-sample-metadata-file sample-metadata.tsv
$ qiime feature-table tabulate-seqs \
--i-data rep-seqs.qza \
--o-visualization rep-seqs.qzv
Crafting those to work in an interactive shell session in docker
:
# First run the container, but ask `docker` to execute `/bin/bash`,
# instead of `qiime`
$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 /bin/bash
# Now the container is launched, and your shell prompt should
# actually be sitting inside of the running container
root@9c2a23e09aeb:/data $ qiime feature-table summarize \
--i-table table.qza \
--o-visualization table.qzv \
--m-sample-metadata-file sample-metadata.tsv
root@9c2a23e09aeb:/data $ qiime feature-table tabulate-seqs \
--i-data rep-seqs.qza \
--o-visualization rep-seqs.qzv
Once you are done, type exit
to quit out of the bash
session, which will in turn halt the running docker
container.
Wrap up
You mentioned not being able to see q2-types
in the list of commands when you ran the qiime
command, this is because q2-types
doesn't define any new commands, only type
s (that get used in other plugins that define their own commands). To see a full list of the installed and registered qiime2
plugins, please run qiime info
!
I hope that helps! If you get stuck anywhere along the way please just let us know and we are more than happy to help!