Skip to content

4. Running with Dockstore CLI

Gregory Leeman edited this page Nov 3, 2021 · 3 revisions

dockstore-cgpmap can be run with the Dockstore CLI locally for testing purposes.

Requirements

  • Docker
  • Java 11
  • Dockstore CLI
  • cwltool

For full installation instructions, see here. Alternatively follow the abbreviated instructions below.

Java 11

sudo add-apt-repository ppa:openjdk-r/ppa && sudo apt-get update -q && sudo apt install -y openjdk-11-jdk

Dockstore CLI

mkdir ~/bin
wget -O ~/bin/dockstore "https://github.com/dockstore/dockstore/releases/download/1.11.8/dockstore"
chmod +x ~/bin/dockstore
export PATH=${PATH}:${HOME}/bin

cwltool

First install Python 3 and pip3, then:

curl -o requirements.txt "https://dockstore.org/api/metadata/runner_dependencies?client_version=1.11.8&python_version=3"
pip3 install -r requirements.txt

Choosing a Dockstore tool

There are three CWL Tools registered on Dockstore.

These tools are defined as CWL Tool Definition files (.cwl) in this directory.

Generating a Parameter File

To run Dockstore, you need a JSON file describing the inputs, outputs and optional parameters.

You can generate a template parameter file for one of the above tools by running dockstore tool convert entry2json eg.

dockstore tool convert entry2json --entry quay.io/wtsicgp/dockstore-cgpmap/cgpmap-bamOut > example.json

Alternatively it may be easier to start with one of the test files found here, eg.:

{
  "reference": {
    "path": "ftp://ftp.sanger.ac.uk/pub/cancer/dockstore/human/core_ref_GRCh37d5.tar.gz",
    "class": "File"
  },
  "bwa_idx": {
    "path": "ftp://ftp.sanger.ac.uk/pub/cancer/dockstore/human/bwa_idx_GRCh37d5.tar.gz",
    "class": "File"
  },
  "seq_in": [
    {"class": "File",
      "path": "ftp://ngs.sanger.ac.uk/production/cancer/dockstore/cgpmap/insilico_21.bam"}
  ],
  "sample": "test",
  "mmqc": false,
  "mmqcfrag": 0.05,
  "threads": 0,
  "bwamem2": false,
  "bwakit": false,
  "nomarkdup": false,
  "dupmode": "t",
  "legacy": false,
  "out_bam": {
    "path": "/tmp/bam_in.bam",
    "class": "File"
  }
}

Example Dockstore command

dockstore tool launch --entry quay.io/wtsicgp/dockstore-cgpmap/cgpmap-bamOut:3.1.4 --json config.json

Testing Dockstore before release

It's possible to test a release with Dockstore before manually updating the tools on quay.io and Dockstore.org. Do this by building the image locally, then replacing the line dockerPull: quay.io/wtsicgp/dockstore-cgpmap:x.x.x in cwl/mixins/requirements.yml with dockerImageId: <local/docker/image:tag> eg.:

cd dockstore-cgpmap;
docker build . -t dockstore-cgpmap:test;

Change contents of cwls/mixins/requirements.yml:

class: DockerRequirement
dockerImageId: "dockstore-cgpmap:test"

You can then test the Dockstore tools:

dockstore tool launch --local-entry ./cwls/cgpmap-bamBaiOut.cwl --json ./examples/cgpmap/bamBaiOut/bam_in.json
dockstore tool launch --local-entry ./cwls/cgpmap-bamBaiOut.cwl --json ./examples/cgpmap/bamBaiOut/cram_in.json
dockstore tool launch --local-entry ./cwls/cgpmap-bamBaiOut.cwl --json ./examples/cgpmap/bamBaiOut/fq_gz_in.json
dockstore tool launch --local-entry ./cwls/cgpmap-bamBaiOut.cwl --json ./examples/cgpmap/bamBaiOut/fq_gz_in_qcreads.json
dockstore tool launch --local-entry ./cwls/cgpmap-bamCsiOut.cwl --json ./examples/cgpmap/bamCsiOut/fq_gz_in.json
dockstore tool launch --local-entry ./cwls/cgpmap-cramOut.cwl --json ./examples/cgpmap/cramOut/fq_gz_in.json