Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Running Trinity CTAT Galaxy Docker

Carrie edited this page Nov 21, 2018 · 4 revisions

Running CTAT Docker

First steps - set up your Host environment.

We'll talk about two different environments during this tutorial - the Host and the Docker environment. If you are familiar with Docker and already have it running, skip ahead.

VMs and Containers

When you run a container of any kind, you are placed into a whole new logical computer, with its own operating system and notions about file systems. To make matters even more complicated, cloud computing is usually deployed as virtual machines, which themselves are abstracted computers running on some large mastermind hardware and software system. This allows a cloud company to dole out computing power as needed by 'spinning up' a VM with some dedicated slice of the computing power available to the physical machine underneath. When you run Docker, it doesn't necessarily get a dedicated amount of hardware, but it does its best to isolate itself from the VMs operating system and environment in order to give you consistent behavior no matter where the Docker container is running.

All that said - you will need to prepare your host to run Docker, and then once inside your docker environment, you will need to make final preparations before Galaxy is fully operational.

Host setup of Docker and Git

Ideally, you would start your tinkering with a fresh VM. I tested these instructions using Ubuntu 18 VMs on both Jetstream and Google Cloud. If you are using CentOS/Red Hat, you can use rpm or yum instead of apt-get, but you may need to tweak the package names a little.

See Docker docs for more details.

# Always start with an update. You wouldn't believe how many systems come broken right out of the box.
sudo apt-get update

# Show love for the poor emacs users
sudo apt-get install -y emacs

# Git git in case its not there
sudo apt-get install git

#Install Docker the right way
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install -y     apt-transport-https     ca-certificates     curl     software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
(lsb_release -cs) \
stable"

sudo apt-get update
sudo apt-get install -y docker-ce
sudo docker run hello-world

If all goes well, you should see something like "Hello World" followed by some text from docker.

Getting Trinity CTAT Galaxy Docker

There are two options for getting ahold of the CTAT Galaxy code - building from source, or pulling from DockerHub.

DockerHub

When using Dockerhub, all you really need to know is the name of the repository and the location of the resources on the Host (see the section below on Setting up resources for details).

sudo docker run -i -t -p 80:80 -v /path/to/resource/libs/on/Host:/export/resources cganote/testing_ctat_docker:test

If you so wish, you could first perform a docker pull of the repository name to download the code to a cache location on your local machine before you deploy it. This can be good if you want to make sure you have the latest version when you are deploying it; docker run will only fetch a copy if you don't already have one cached locally, by default.

From Source

#Clone this github repo
git clone https://github.com/NCIP/docker-ctat-galaxy.git
cd docker-ctat-galaxy

Here you should see a collection of files for supporting Docker. The Dockerfile is the main document for building the Docker image from scratch.

Preflight.sh is there to help you set up your resource libraries. Let's do that now!

Setting up resources

Preparing the Host

The Trinity CTAT tools make heavy use of reference genome data, annotations, and other support files. In order for all tools to function correctly, it is recommended to set up the reference data, or "Resource Library" before deploying the Docker Galaxy in production.

Start out by creating or designating a folder on the Host side that will hold the reference data so that you can easily export them into the Docker container when you run it. You need at least ~70GB of space on the file system this folder is in. If you are using Google Cloud, a VM with sufficient space on disk is recommended. If you are running on Jetstream, make sure to attach a large enough volume to your instance and make sure it is appropriately mounted. Docker allows folders to be exported from the Host and mounted inside the running Docker container, allowing data to persist even after the container has been shut down. This is the recommended approach; for more information about file systems and Docker, see the Development page.

Once a directory has been selected, there are several ways to make it available to Docker. In examples below, replace /path/to/resource/libs with your chosen directory's path.

  1. Make the folder world read-write-executable.
chmod -R a+rwx /path/to/resource/libs
  1. Create a user with id galaxy and uid 1450. This user MUST have this name and id. Then, change ownership of the resources folder and its contents to that user.
sudo chown -R galaxy /path/to/resource/libs
  1. Run the preflight.sh script that is packaged with the Docker image - you will have to clone from github or pull from dockerhub first. This script pretty much does step #2 for you. You MUST set an environment variable before running this if you want it to chown files. Here is how to do this with bash:
export RESOURCE_LIB=/path/to/resource/libs
sudo bash preflight.sh

Once your Resource Library directory has been prepared and has sufficient permission, you may proceed to populate it with resource data. You should choose whether you want to build the human reference version Hg19 or Grch38. These are two incompatible genome assemblies that have their own annotations, coordinates, etc. Grch38 is a more recent build and is recommended unless your circumstances require otherwise.

To start, you must download and provide your own copy of the Cosmic files.

Cosmic files

Cosmic is a database of cancer variants and is used in the Mutation pipeline. If you wish to support this feature, you will need to acquire the data from Cosmic - either the the Cosmic downloads for GRCH38 page or the the Cosmic downloads for Hg19 page. The licensing of these files requires you to provide login information before you may use them. You need two files:

  • COSMIC Mutation Data (CosmicMutantExport.tsv.gz)
  • VCF Files, coding only (CosmicCodingMuts.vcf.gz)

For more information on installing Mutation tools, see the Trinity CTAT wiki page.

Once you have downloaded your Cosmic files, copy them onto your Host, but do not uncompress them yet. We recommend creating a folder named "cosmic" inside your Resource Library to place these files in.

Recommended location:

ls $RESOURCE_LIB/cosmic/
CosmicCodingMuts.vcf.gz  CosmicMutantExport.tsv.gz

The rest of the downloads are VERY LARGE - about ~30GB for the full plug-n-play versions, and less for the others. Plan on having your Host online for 8 hours or more. There are three ways to set up the rest of the resource library for running Trinity CTAT Galaxy:

  1. From the Host side, manual downloads
  2. Mixture of Host and Docker, using scripts
  3. Mixture of Host and Docker, using Galaxy GUI

Manual Downloads

You can get the resource libs downloaded using wget or curl from the command line. If you have a GUI client for pulling data from web URLs, you could use that too, but I haven't tested it. The resource libs are located on the Broad's FTP page here. Make sure that the human reference that you download matches the version you chose for Cosmic.

You may download the plug-n-play for the most complete version of the resources, or the source if you wish for a smaller download but more manual work indexing the reference genomes. For instructions on building from source, see the Fusion-Filter page.

Note that you will still need to build the GMAP indices even if you downloaded the plug-n-play version. You may run the prep_genome_lib.pl script on the Host, if you wish, to do the final GMAP indexing. Alternatively, you can wrap up the final steps from inside the container, through the Galaxy interface using the Data Manager tools (see below).

⚠️ Make sure your versions of software are compatible. GMAP-Fusion requires GMAP >=2017.11.15; if you build with an older GMAP on the Host, the GMAP-Fusion inside the container may fail.

Once you have downloaded the files successfully and built them (or will build them later inside Docker), you will need to make sure that the those resources will be accessible (and writable) from inside the Docker container. This can be accomplished in a few ways:

Host and Docker, using scripts

Host and Docker, using GUI-based