(testdrive:trs)=
# Tool registration
After the reference and sample files are registered, the next step is to register a predefined workflow as a tool on the SeqsLab platform. 

## Objective
This tutorial will help you register a tool based on a
[GATK-Germline-Snps-Indels](https://dockstore.org/workflows/github.com/atgenomix/seqslab-workflows/WGS-Germline-Snps-Indels:v4.3?tab=info) workflow from Dockstore.

## Prerequisites
Before you begin, you will need the following:

- SeqsLab managed application on Azure. For details, see [](testdrive:overview).
- A running instance of the SeqsLab CLI tool. For details, see [](cli:tutorial-getting-started).
- A command line interface (CLI) tool such as the Windows Command Prompt or the Mac Terminal

## 1. Get the published workflow from Dockstore
Use the following command to get the workflow from Dockstore:
```
# get workflow.zip from dockstore
    mkdir working_dir && \
    wget https://dockstore.org/api/workflows/18394/zip/158152 \
    -O working_dir/workflow.zip
cd working_dir && unzip workflow.zip
```

The downloaded ZIP includes all the WDL files for the published tool.
```
tree
.
├── GATK-Germline-Snps-Indels
│   ├── execs
│   │   └── gatk.parallel.hg19.0713.execs.json
│   ├── inputs
│   │   └── GATK-Germline-Snps-Indels-inputs.json
│   └── wdl
│       ├── GATK-Germline-Snps-Indels-main.wdl
│       └── subworkflows
│           ├── haplotypecaller-gvcf-gatk4.wdl
│           ├── processing-for-variant-discovery-gatk4.wdl
│           └── tasks.wdl
└── workflow.zip
```

## 2. Register the tool
Use the ***tools tool*** command to register the workflow as a new tool.

```
export TOOL_ID="wgs_germline_gatk4_snp_indel_`date '+%Y%m%d%H%M%S'`"
seqslab tools tool \
    --id "${TOOL_ID}" \
    --name "testdrive-${TOOL_ID}" \
    --description "test drive workflow"
```

Use the ***tools version*** command to register a new tool version.

```
seqslab tools version \
    --descriptor-type WDL  \
    --tool-id "${TOOL_ID}" \
    --id "1.0" \
    --workspace "${WORKSPACE}" \
    --images '[{"image_type": "docker", "image_name": "atgenomix/seqslab_runtime-1.5_ubuntu-20.04_preprocessgatk4-4.2.0.0:2022-10-05-02-36", "registry_host": "tmuhwus24434bacr.azurecr.io", "size": 3349109245, "checksum": "sha256:020be4ed428c7dfec67d6c640aaec07d239406c1222295b22a8da6be2ec38ad1"}]'
```

Use the ***tools file*** command to upload tool files to the newly created tool version.
```
seqslab tools file \
    --descriptor-type WDL \
    --tool-id "${TOOL_ID}" \
    --version-id "1.0" \
    --working-dir `pwd`/GATK-Germline-Snps-Indels/ \
    --file-info execs/gatk.parallel.hg19.0713.execs.json
```