DNAnexus Documentation
APIDownloadsIndex of dx CommandsLegal
  • Overview
  • Getting Started
    • DNAnexus Essentials
    • Key Concepts
      • Projects
      • Organizations
      • Apps and Workflows
    • User Interface Quickstart
    • Command Line Quickstart
    • Developer Quickstart
    • Developer Tutorials
      • Bash
        • Bash Helpers
        • Distributed by Chr (sh)
        • Distributed by Region (sh)
        • SAMtools count
        • TensorBoard Example Web App
        • Git Dependency
        • Mkfifo and dx cat
        • Parallel by Region (sh)
        • Parallel xargs by Chr
        • Precompiled Binary
        • R Shiny Example Web App
      • Python
        • Dash Example Web App
        • Distributed by Region (py)
        • Parallel by Chr (py)
        • Parallel by Region (py)
        • Pysam
      • Web App(let) Tutorials
        • Dash Example Web App
        • TensorBoard Example Web App
      • Concurrent Computing Tutorials
        • Distributed
          • Distributed by Region (sh)
          • Distributed by Chr (sh)
          • Distributed by Region (py)
        • Parallel
          • Parallel by Chr (py)
          • Parallel by Region (py)
          • Parallel by Region (sh)
          • Parallel xargs by Chr
  • User
    • Login and Logout
    • Projects
      • Project Navigation
      • Path Resolution
    • Running Apps and Workflows
      • Running Apps and Applets
      • Running Workflows
      • Running Nextflow Pipelines
      • Running Batch Jobs
      • Monitoring Executions
      • Job Notifications
      • Job Lifecycle
      • Executions and Time Limits
      • Executions and Cost and Spending Limits
      • Smart Reuse (Job Reuse)
      • Apps and Workflows Glossary
      • Tools List
    • Cohort Browser
      • Chart Types
        • Row Chart
        • Histogram
        • Box Plot
        • List View
        • Grouped Box Plot
        • Stacked Row Chart
        • Scatter Plot
        • Kaplan-Meier Survival Curve
      • Locus Details Page
    • Using DXJupyterLab
      • DXJupyterLab Quickstart
      • Running DXJupyterLab
        • FreeSurfer in DXJupyterLab
      • Spark Cluster-Enabled DXJupyterLab
        • Exploring and Querying Datasets
      • Stata in DXJupyterLab
      • Running Older Versions of DXJupyterLab
      • DXJupyterLab Reference
    • Using Spark
      • Apollo Apps
      • Connect to Thrift
      • Example Applications
        • CSV Loader
        • SQL Runner
        • VCF Loader
      • VCF Preprocessing
    • Environment Variables
    • Objects
      • Describing Data Objects
      • Searching Data Objects
      • Visualizing Data
      • Filtering Objects and Jobs
      • Archiving Files
      • Relational Database Clusters
      • Symlinks
      • Uploading and Downloading Files
        • Small File Sets
          • dx upload
          • dx download
        • Batch
          • Upload Agent
          • Download Agent
    • Platform IDs
    • Organization Member Guide
    • Index of dx commands
  • Developer
    • Developing Portable Pipelines
      • dxCompiler
    • Cloud Workstation
    • Apps
      • Introduction to Building Apps
      • App Build Process
      • Advanced Applet Tutorial
      • Bash Apps
      • Python Apps
      • Spark Apps
        • Table Exporter
        • DX Spark Submit Utility
      • HTTPS Apps
        • Isolated Browsing for HTTPS Apps
      • Transitioning from Applets to Apps
      • Third Party and Community Apps
        • Community App Guidelines
        • Third Party App Style Guide
        • Third Party App Publishing Checklist
      • App Metadata
      • App Permissions
      • App Execution Environment
        • Connecting to Jobs
      • Dependency Management
        • Asset Build Process
        • Docker Images
        • Python package installation in Ubuntu 24.04 AEE
      • Job Identity Tokens for Access to Clouds and Third-Party Services
      • Enabling Web Application Users to Log In with DNAnexus Credentials
      • Types of Errors
    • Workflows
      • Importing Workflows
      • Introduction to Building Workflows
      • Building and Running Workflows
      • Workflow Build Process
      • Versioning and Publishing Global Workflows
      • Workflow Metadata
    • Ingesting Data
      • Molecular Expression Assay Loader
        • Common Errors
        • Example Usage
        • Example Input
      • Data Model Loader
        • Data Ingestion Key Steps
        • Ingestion Data Types
        • Data Files Used by the Data Model Loader
        • Troubleshooting
      • Dataset Extender
        • Using Dataset Extender
    • Dataset Management
      • Rebase Cohorts and Dashboards
      • Assay Dataset Merger
      • Clinical Dataset Merger
    • Apollo Datasets
      • Dataset Versions
      • Cohorts
    • Creating Custom Viewers
    • Client Libraries
      • Support for Python 3
    • Walkthroughs
      • Creating a Mixed Phenotypic Assay Dataset
      • Guide for Ingesting a Simple Four Table Dataset
    • DNAnexus API
      • Entity IDs
      • Protocols
      • Authentication
      • Regions
      • Nonces
      • Users
      • Organizations
      • OIDC Clients
      • Data Containers
        • Folders and Deletion
        • Cloning
        • Project API Methods
        • Project Permissions and Sharing
      • Data Object Lifecycle
        • Types
        • Object Details
        • Visibility
      • Data Object Metadata
        • Name
        • Properties
        • Tags
      • Data Object Classes
        • Records
        • Files
        • Databases
        • Drives
        • DBClusters
      • Running Analyses
        • I/O and Run Specifications
        • Instance Types
        • Job Input and Output
        • Applets and Entry Points
        • Apps
        • Workflows and Analyses
        • Global Workflows
        • Containers for Execution
      • Search
      • System Methods
      • Directory of API Methods
      • DNAnexus Service Limits
  • Administrator
    • Billing
    • Org Management
    • Single Sign-On
    • Audit Trail
    • Integrating with External Services
    • Portal Setup
    • GxP
      • Controlled Tool Access (allowed executables)
  • Science Corner
    • Scientific Guides
      • Somatic Small Variant and CNV Discovery Workflow Walkthrough
      • SAIGE GWAS Walkthrough
      • LocusZoom DNAnexus App
      • Human Reference Genomes
    • Using Hail to Analyze Genomic Data
    • Open-Source Tools by DNAnexus Scientists
    • Using IGV Locally with DNAnexus
  • Downloads
  • FAQs
    • EOL Documentation
      • Python 3 Support and Python 2 End of Life (EOL)
    • Automating Analysis Workflow
    • Backups of Customer Data
    • Developing Apps and Applets
    • Importing Data
    • Platform Uptime
    • Legal and Compliance
    • Sharing and Collaboration
    • Product Version Numbering
  • Release Notes
  • Technical Support
  • Legal
Powered by GitBook

Copyright 2025 DNAnexus

On this page
  • App Directory Structure
  • The dxapp.json App Metadata File
  • Readme Files
  • The Resources/ Subdirectory
  • Building an Applet
  • The Resources/ Directory and Its Use
  • Next Steps

Was this helpful?

Export as PDF
  1. Developer
  2. Apps

App Build Process

Learn the basic app infrastructure you need to know to build your own DNAnexus app.

Last updated 2 months ago

Was this helpful?

This tutorial will walk you through the following features of the DNAnexus app build infrastructure:

  • The dxapp.json file, a central point for information about your app

  • The /resources directory, where you can include files to be loaded onto the workers which will execute your app

  • The option to build your app remotely, needed when building from a system not compatible with Ubuntu 24.04 or 20.04

For more information about the worker environment where your app will run, and on how to specify runtime dependencies for your app, see the .

App Directory Structure

DNAnexus applets and apps are usually compiled using the dx build and dx build --create-app utilities in the , which take code on your local workstation and upload it into an object on the platform. The SDK expects each program to reside in a directory with a specific structure, which looks like this:

MyApp
├── dxapp.json
├── Readme.md
├── Readme.developer.md
├── resources
│   └── ...
├── src
│   └── ...
└── test
    └── ...

The dxapp.json App Metadata File

Readme Files

The Readme.md file, if present, is inlined into the description field of the app or applet.

The Readme.developer.md file, if present, is inlined into the developerNotes

The Resources/ Subdirectory

See the section "Building apps from source" below, which describes the relationship between the resources subdirectory of your project directory and the resulting app or applet.

Building an Applet

You can use the following command to load your application into the DNAnexus Platform as an applet:

dx build MyApp

Assuming your applet's source code appears in a directory MyApp underneath the current directory.

Before uploading your program to DNAnexus, dx build performs the following build steps.

  • ./configure (if a configure script exists)

  • make (if a Makefile is present)

You can put arbitrary steps in your Makefile to prepare any resources that might be needed by your app at runtime. For example, one module of your app might be written in C++ and therefore would need to be compiled to a library or executable.

The Resources/ Directory and Its Use

Anything that is present in the resources/ subdirectory of your app directory will be archived after the build step and then unarchived into the root of your execution environment's filesystem at runtime. You can either check files directly into your source repository in the resources/ subdirectory, or have your build step generate files there, or a combination of the two.

By default, the PATH in the environment is the following (it is inherited from Ubuntu's defaults):

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

As an example, if your Makefile produces a binary and puts it in resources/usr/bin/bwa in your source tree, that file is available to your app as /usr/bin/bwa at runtime (and you can therefore easily call it as a subprocess from your entry point method).

While the resources/ subdirectory is unpacked into the root of the virtual filesystem, your app starts in in /home/dnanexus as its current working directory. You may therefore wish to put files or data in resources/home/dnanexus in order to have them available in the current working directory when your applet starts.

Next Steps

  • If you would like to see more example code, you can use the dx get command to reconstruct and download the source directory of open-source apps (e.g. dx get app-cloud_workstation). You can find open-source apps with the command below

$ dx api system findApps '{"describe":{"fields":{"openSource": true, "name": true}}}'| \
  jq '.results|.[]|select(.describe.openSource)|.describe.name'

The file dxapp.json is a DNAnexus application metadata file. Its presence in a directory tells DNAnexus tools that it contains DNAnexus app source code (i.e., it's a project directory). See for a complete description of the app metadata format.

See the page for language-specific tutorials in a variety of programming languages. These will walk you through writing more complex apps in the language of your choice.

Execution Environment Reference
DNAnexus SDK
dxapp.json
Developer Tutorials