# DNAnexus

[DNAnexus](https://www.dnanexus.com/) supports WDL workflows through their `dx-toolkit` and `dxCompiler` tools. This guide demonstrates running the `02_download_collection_files.wdl` workflow, which typically takes 5-10 minutes to complete.

## Prerequisites

Before beginning, ensure you have the following:

* [A DNAnexus platform account (including free tier)](https://platform.dnanexus.com/register)
* Java 8 or higher
* Python 3.5 or higher
* Optional: cURL, [git](https://git-scm.com/downloads)

## Getting Started

The following software and workflows are required and will be installed and used as part of this tutorial:

* [02\_download\_collection\_files.wdl](https://raw.githubusercontent.com/DNAstack/dnastack-client-library-worked-examples/master/examples/wdl/02_download_collection_files.wdl)
* [dx-toolkit](https://docs.viral.ai/analysis/integrations/dnanexus/)
* [dxCompiler](https://github.com/dnanexus/dxCompiler)

## Getting the Example Workflow

**Clone with Git:**

```shell
git clone https://github.com/DNAstack/dnastack-client-library-worked-examples.git
```

**Or** [**Download**](https://github.com/DNAstack/dnastack-client-library-worked-examples/archive/refs/heads/master.zip) **and Unzip**

It is assumed that all commands will be run from the root directory of this repository on your local machine. From the directory where you’ve downloaded the examples repository:

```shell
git clone https://github.com/DNAstack/dnastack-client-library-worked-examples.git
```

#### Installing Required Tools

**Download dxCompiler:**

Download the latest version of `dxCompiler` by one of the following methods. This allows direct conversion and uploading of WDL workflows to DNAnexus.

#### Using cURL

```shell
curl -o dxCompiler.jar -L https://github.com/dnanexus/dxCompiler/releases/download/2.4.6/dxCompiler-2.4.6.jar
```

Or download from the releases page to the current directory and rename the file to `dxCompiler.jar`.

#### Install and initialize dx-toolkit

Download and initialize `dx-toolkit`. You will be prompted to log into your DNAnexus account.

```shell
pip3 install dxpy
dxlogin
```

## Running a Workflow

* Create a project on DNAnexus where the workflow and associated files will be stored.
* Once your project has been setup, import the WDL workflow `02_download_collection_files.wdl` to the DNAnexus platform using dxCompiler.

```shell
java -jar ./dxCompiler.jar compile ./examples/wdl/02_download_collection_files.wdl n -project dnastack-client-library-worked-examples n -folder /download_collection_files
```

To run the newly created workflow on the DNAnexus platform, select the project folder and Workflow item, and click "Run" as Analysis.

* To view the progress of the workflow at any time, select the "Monitor" tab.
* Inputs or parameters of the workflow can be modified. For example, to download from a different collection.
* The output files can be found in and downloaded from the folder specified in the Run dialog. In this case, the root of the DNAnexus project.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omics.ai/products/analysis/integrations/dnanexus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
