From ba4b970aa8ea6b673a6cf69ecfe61b4ebfac3f5d Mon Sep 17 00:00:00 2001 From: Andrew Duncan Date: Tue, 20 Aug 2019 11:51:05 -0400 Subject: [PATCH 1/3] first pass at dockerfile and readme --- docker/Dockerfile | 35 +++++++++++++++++++++++ docker/README.md | 60 +++++++++++++++++++++++++++++++++++++++ docker/docker-compose.yml | 10 +++++++ 3 files changed, 105 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b7fe49b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,35 @@ +FROM node:latest + +LABEL maintainer="andrew.duncan@oicr.on.ca" + +ENV JBROWSE_VERSION 1.16.3 + +# Install dependencies +RUN apt-get -qq update --fix-missing +RUN apt-get --no-install-recommends -y install git build-essential zlib1g-dev libxml2-dev libexpat-dev postgresql-client libpq-dev ca-certificates curl + +# Download JBrowse +RUN mkdir -p /jbrowse/ && \ + git clone --recursive https://github.com/gmod/jbrowse /jbrowse/ && \ + cd /jbrowse/ && \ + git checkout ${JBROWSE_VERSION}-release + +WORKDIR /jbrowse/ + +# Download ICGC Viewer +RUN git clone https://github.com/agduncan94/icgc-viewer /icgc-viewer/ && \ + cd /icgc-viewer/ && \ + git checkout develop && \ + cp -r icgc-viewer /jbrowse/plugins/icgc-viewer && \ + cat ./data/jbrowse.conf > /jbrowse/jbrowse.conf + +# Setup JBrowse +RUN ./setup.sh && \ + ./bin/cpanm --force JSON Hash::Merge PerlIO::gzip Devel::Size \ + Heap::Simple Heap::Simple::XS List::MoreUtils Exception::Class Test::Warn Bio::Perl \ + Bio::DB::SeqFeature::Store File::Next Bio::DB::Das::Chado && \ + rm -rf /root/.cpan/ + + +# Expose port 3000 +EXPOSE 3000 \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..d7c8d19 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,60 @@ +# Running JBrowse with ICGC Plugin in Docker +This will get JBrowse with the ICGC Viewer Plugin running with Express on port 3000. + +Based on [enuggetry/docker-jbrowse](https://github.com/enuggetry/docker-jbrowse) + +## Build and Run from Dockerfile +### Setup data +*Important*: Place your track data in `./data`. This maps to `/jbrowse/data` in the container, which is where JBrowse stores reference data and track information. + +### Build the docker image +`docker build . -t jbrowse-with-icgc` + +### Run the docker image +`docker run -p 3000:3000 -v {pwd}/data:/jbrowse/data jbrowse-with-icgc utils/jb_run.js -p 3000` + +Note: You can run in the background using the detach mode (-d) + +`docker run -d -p 3000:3000 -v {pwd}/data:/jbrowse/data jbrowse-with-icgc utils/jb_run.js -p 3000` + +## Build and Run from Docker Compose +You can also use Docker Compose to build the image. Ensure you are working in the same directory as the `docker-compose.yml`. + +### Build docker-compose +`docker-compose build` + +### Run the docker-compose +`docker-compose up` + +Note: You can run in the background using the detach mode (-d) + +`docker-compose up -d` + +## Load refseq and tracks +If you already have your tracks.conf and seq/, etc., you can simply put these files into your `./data` directory. + +As an example, we will load Chr1 (GRCh37) as a reference sequence. Unfortunately you need JBrowse to prepare refseq, so you can either go into the docker container and run the following or clone JBrowse on your host system, run `./setup.sh` and then run the following on the host. + +Note that GRCh37 is used for ICGC. + +``` +# Download a FASTA file +wget http://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/dna/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz + +# Prepare refseqs +jbrowse/bin/prepare-refseqs.pl --fasta ./data/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz +``` + +Now go to `localhost:3000` and you should see JBrowse with your refdata and tracks! + +### Enter the Docker Container + +You can enter the container by doing the following: + +``` +# Get container ID +docker ps + +# Enter container +docker exec -it /bin/bash +``` \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..66ad339 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + jbrowse: + build: . + command: utils/jb_run.js -p 3000 + ports: + - "3000:3000" + volumes: + - ./data:/jbrowse/data + \ No newline at end of file From 1adb5abe888bcef33e76a2e9efdeafa72e68ef24 Mon Sep 17 00:00:00 2001 From: Andrew Duncan Date: Wed, 21 Aug 2019 15:42:25 -0400 Subject: [PATCH 2/3] simplify refseq process --- .gitignore | 1 + docker/README.md | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 646ac51..ce1cb57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store node_modules/ +docker/data/ diff --git a/docker/README.md b/docker/README.md index d7c8d19..ae879cc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -33,16 +33,13 @@ Note: You can run in the background using the detach mode (-d) ## Load refseq and tracks If you already have your tracks.conf and seq/, etc., you can simply put these files into your `./data` directory. -As an example, we will load Chr1 (GRCh37) as a reference sequence. Unfortunately you need JBrowse to prepare refseq, so you can either go into the docker container and run the following or clone JBrowse on your host system, run `./setup.sh` and then run the following on the host. - -Note that GRCh37 is used for ICGC. +You will have to put the RefSeq data into the `./data` directory. Download the GRCH37 `.fa` and `.fa.fai` files from online (ex. http://bioinfo.hpc.cam.ac.uk/downloads/datasets/fasta/grch37/). Then put the following in `./data/tracks.conf` (note files may be named something else). ``` -# Download a FASTA file -wget http://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/dna/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz - -# Prepare refseqs -jbrowse/bin/prepare-refseqs.pl --fasta ./data/Homo_sapiens.GRCh37.75.dna.chromosome.1.fa.gz +refSeqs=GRCh37.genome.fa.fai + +[tracks.refseqs] +urlTemplate=GRCh37.genome.fa ``` Now go to `localhost:3000` and you should see JBrowse with your refdata and tracks! From dd7831eed6800294711b1743ba33d85d649f3642 Mon Sep 17 00:00:00 2001 From: Andrew Duncan Date: Wed, 21 Aug 2019 15:56:41 -0400 Subject: [PATCH 3/3] point dockerfile to next release --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b7fe49b..6960b54 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /jbrowse/ # Download ICGC Viewer RUN git clone https://github.com/agduncan94/icgc-viewer /icgc-viewer/ && \ cd /icgc-viewer/ && \ - git checkout develop && \ + git checkout 0.1.5 && \ cp -r icgc-viewer /jbrowse/plugins/icgc-viewer && \ cat ./data/jbrowse.conf > /jbrowse/jbrowse.conf