Introduction

Building Applets

DNAnexus apps and applets are ways to package executable code. The biggest difference between apps and applets is their visibility. Apps such as you find in the Tool Library are globally available and maintained by DNAnexus and partners like Nvidia and Sentieon. Applets are private to an organization and exist as data objects in a project. They can be shared across projects and promoted to generally available apps. Native DNAnexus applets are built using dx build to create an executable for bash or Python code, which in turn may execute any program installed on the instance.

Later, we will discuss how to build a workflow, which is a combination of two or more apps/applets. We will build native workflows using the GUI and languages like WDL (Workflow Description Language) and Nextflow combine with Docker images.

Development Cycle

As shown in following figure, the development cycle is to write code locally, use dx build to create a native applet on the platform, and then dx run to run the applet. You can view the execution logs with dx watch, then make changes to your code to build and run again.

Installing Required Software

To install the Python modules required for this tutorial, run the following command:

You may be prompted to expand PATH with installation directory such as ~/.local/bin:

Next, ensure you have a recent version of Java. For this tutorial, I'm using the following:

If you want to use Cromwell to execute WDL locally, you should download the Cromwell Jar file. This tutorial assumes you will place this file in your home directory using the following commands.

I suggest you use the link command (ln) to create a symlink to the filename cromwell.jar so that upgrading in the future will not break your commands:

WOMtool (Workflow Object Model) is also quite useful, and I suggest you similarly download it and link it to womtool.jar:

You will use the DNAnexus dxCompiler to build WDL applications on the platform. Find a link to the latest Jar file under the releases of the Git repository. For example, the following commands will download dxCompiler-2.10.4.jar to your home directory and symlink it to dxCompiler.jar:

Some tools may attempt to use the shellcheck tool to validate any shell code in your WDL. To install on Ubuntu, run the following:

On macOS, you can use Homebrew to install the program:

The dx CLI

If the dxpy module installed properly, you should able to run dx on the command line. For instance, run dx all to see a list of valid commands:

To get started, do the following:

  • Run dx login to identify yourself to the DNAnexus platform. Enter your username and password. You can also set up a token to log in. Information on setting up tokens can be found in the Using Tokens section of our Documentation.

  • You may also be prompted to select a project. If not, you should use dx select to select a project that will contain your work.

  • If you do not see a project you wish to use for your work, run dx new project to create one from the command line, or click "New Project" in the web interface.

  • Finally, run dx ssh_config to set up SSH keys for connecting to cloud instances.

Note that each subcommand will respond to the flags -h|--help to display the usage documentation. For instance, dx new can create several object types, which you can discover by reading the documentation:

You should now be prepared to develop DNAnexus apps and workflows.

Resources

Full Documentation

Please email [email protected] to create a support ticket if there are technical issues.

Last updated

Was this helpful?