Dnanexus Integration

Build genomics pipelines on DNAnexus cloud platform with ease

✨ The solution you've been looking for

Verified
Tested and verified by our team
16036 Stars

DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.

genomics bioinformatics cloud-computing dnanexus pipeline fastq bam vcf
Repository

See It In Action

Interactive preview & real-world examples

Live Demo
Skill Demo Animation

AI Conversation Simulator

See how users interact with this skill

User Prompt

I need to upload my FASTQ files to DNAnexus and run a quality control analysis. Can you help me write the code?

Skill Processing

Analyzing request...

Agent Response

Complete Python code using dxpy to upload files, launch analysis jobs, and download results

Quick Start (3 Steps)

Get up and running in minutes

1

Install

claude-code skill install dnanexus-integration

claude-code skill install dnanexus-integration
2

Config

3

First Trigger

@dnanexus-integration help

Commands

CommandDescriptionRequired Args
@dnanexus-integration upload-and-process-genomics-dataUpload sequencing data and run analysis pipelines on DNAnexus platformNone
@dnanexus-integration build-custom-analysis-appCreate a new bioinformatics app or applet for the DNAnexus platformNone
@dnanexus-integration multi-step-pipeline-orchestrationChain multiple analysis steps together in a genomics workflowNone

Typical Use Cases

Upload and Process Genomics Data

Upload sequencing data and run analysis pipelines on DNAnexus platform

Build Custom Analysis App

Create a new bioinformatics app or applet for the DNAnexus platform

Multi-Step Pipeline Orchestration

Chain multiple analysis steps together in a genomics workflow

Overview

DNAnexus Integration

Overview

DNAnexus is a cloud platform for biomedical data analysis and genomics. Build and deploy apps/applets, manage data objects, run workflows, and use the dxpy Python SDK for genomics pipeline development and execution.

When to Use This Skill

This skill should be used when:

  • Creating, building, or modifying DNAnexus apps/applets
  • Uploading, downloading, searching, or organizing files and records
  • Running analyses, monitoring jobs, creating workflows
  • Writing scripts using dxpy to interact with the platform
  • Setting up dxapp.json, managing dependencies, using Docker
  • Processing FASTQ, BAM, VCF, or other bioinformatics files
  • Managing projects, permissions, or platform resources

Core Capabilities

The skill is organized into five main areas, each with detailed reference documentation:

1. App Development

Purpose: Create executable programs (apps/applets) that run on the DNAnexus platform.

Key Operations:

  • Generate app skeleton with dx-app-wizard
  • Write Python or Bash apps with proper entry points
  • Handle input/output data objects
  • Deploy with dx build or dx build --app
  • Test apps on the platform

Common Use Cases:

  • Bioinformatics pipelines (alignment, variant calling)
  • Data processing workflows
  • Quality control and filtering
  • Format conversion tools

Reference: See references/app-development.md for:

  • Complete app structure and patterns
  • Python entry point decorators
  • Input/output handling with dxpy
  • Development best practices
  • Common issues and solutions

2. Data Operations

Purpose: Manage files, records, and other data objects on the platform.

Key Operations:

  • Upload/download files with dxpy.upload_local_file() and dxpy.download_dxfile()
  • Create and manage records with metadata
  • Search for data objects by name, properties, or type
  • Clone data between projects
  • Manage project folders and permissions

Common Use Cases:

  • Uploading sequencing data (FASTQ files)
  • Organizing analysis results
  • Searching for specific samples or experiments
  • Backing up data across projects
  • Managing reference genomes and annotations

Reference: See references/data-operations.md for:

  • Complete file and record operations
  • Data object lifecycle (open/closed states)
  • Search and discovery patterns
  • Project management
  • Batch operations

3. Job Execution

Purpose: Run analyses, monitor execution, and orchestrate workflows.

Key Operations:

  • Launch jobs with applet.run() or app.run()
  • Monitor job status and logs
  • Create subjobs for parallel processing
  • Build and run multi-step workflows
  • Chain jobs with output references

Common Use Cases:

  • Running genomics analyses on sequencing data
  • Parallel processing of multiple samples
  • Multi-step analysis pipelines
  • Monitoring long-running computations
  • Debugging failed jobs

Reference: See references/job-execution.md for:

  • Complete job lifecycle and states
  • Workflow creation and orchestration
  • Parallel execution patterns
  • Job monitoring and debugging
  • Resource management

4. Python SDK (dxpy)

Purpose: Programmatic access to DNAnexus platform through Python.

Key Operations:

  • Work with data object handlers (DXFile, DXRecord, DXApplet, etc.)
  • Use high-level functions for common tasks
  • Make direct API calls for advanced operations
  • Create links and references between objects
  • Search and discover platform resources

Common Use Cases:

  • Automation scripts for data management
  • Custom analysis pipelines
  • Batch processing workflows
  • Integration with external tools
  • Data migration and organization

Reference: See references/python-sdk.md for:

  • Complete dxpy class reference
  • High-level utility functions
  • API method documentation
  • Error handling patterns
  • Common code patterns

5. Configuration and Dependencies

Purpose: Configure app metadata and manage dependencies.

Key Operations:

  • Write dxapp.json with inputs, outputs, and run specs
  • Install system packages (execDepends)
  • Bundle custom tools and resources
  • Use assets for shared dependencies
  • Integrate Docker containers
  • Configure instance types and timeouts

Common Use Cases:

  • Defining app input/output specifications
  • Installing bioinformatics tools (samtools, bwa, etc.)
  • Managing Python package dependencies
  • Using Docker images for complex environments
  • Selecting computational resources

Reference: See references/configuration.md for:

  • Complete dxapp.json specification
  • Dependency management strategies
  • Docker integration patterns
  • Regional and resource configuration
  • Example configurations

Quick Start Examples

Upload and Analyze Data

 1import dxpy
 2
 3# Upload input file
 4input_file = dxpy.upload_local_file("sample.fastq", project="project-xxxx")
 5
 6# Run analysis
 7job = dxpy.DXApplet("applet-xxxx").run({
 8    "reads": dxpy.dxlink(input_file.get_id())
 9})
10
11# Wait for completion
12job.wait_on_done()
13
14# Download results
15output_id = job.describe()["output"]["aligned_reads"]["$dnanexus_link"]
16dxpy.download_dxfile(output_id, "aligned.bam")

Search and Download Files

 1import dxpy
 2
 3# Find BAM files from a specific experiment
 4files = dxpy.find_data_objects(
 5    classname="file",
 6    name="*.bam",
 7    properties={"experiment": "exp001"},
 8    project="project-xxxx"
 9)
10
11# Download each file
12for file_result in files:
13    file_obj = dxpy.DXFile(file_result["id"])
14    filename = file_obj.describe()["name"]
15    dxpy.download_dxfile(file_result["id"], filename)

Create Simple App

 1# src/my-app.py
 2import dxpy
 3import subprocess
 4
 5@dxpy.entry_point('main')
 6def main(input_file, quality_threshold=30):
 7    # Download input
 8    dxpy.download_dxfile(input_file["$dnanexus_link"], "input.fastq")
 9
10    # Process
11    subprocess.check_call([
12        "quality_filter",
13        "--input", "input.fastq",
14        "--output", "filtered.fastq",
15        "--threshold", str(quality_threshold)
16    ])
17
18    # Upload output
19    output_file = dxpy.upload_local_file("filtered.fastq")
20
21    return {
22        "filtered_reads": dxpy.dxlink(output_file)
23    }
24
25dxpy.run()

Workflow Decision Tree

When working with DNAnexus, follow this decision tree:

  1. Need to create a new executable?

    • Yes → Use App Development (references/app-development.md)
    • No → Continue to step 2
  2. Need to manage files or data?

    • Yes → Use Data Operations (references/data-operations.md)
    • No → Continue to step 3
  3. Need to run an analysis or workflow?

    • Yes → Use Job Execution (references/job-execution.md)
    • No → Continue to step 4
  4. Writing Python scripts for automation?

    • Yes → Use Python SDK (references/python-sdk.md)
    • No → Continue to step 5
  5. Configuring app settings or dependencies?

    • Yes → Use Configuration (references/configuration.md)

Often you’ll need multiple capabilities together (e.g., app development + configuration, or data operations + job execution).

Installation and Authentication

Install dxpy

1uv pip install dxpy

Login to DNAnexus

1dx login

This authenticates your session and sets up access to projects and data.

Verify Installation

1dx --version
2dx whoami

Common Patterns

Pattern 1: Batch Processing

Process multiple files with the same analysis:

 1# Find all FASTQ files
 2files = dxpy.find_data_objects(
 3    classname="file",
 4    name="*.fastq",
 5    project="project-xxxx"
 6)
 7
 8# Launch parallel jobs
 9jobs = []
10for file_result in files:
11    job = dxpy.DXApplet("applet-xxxx").run({
12        "input": dxpy.dxlink(file_result["id"])
13    })
14    jobs.append(job)
15
16# Wait for all completions
17for job in jobs:
18    job.wait_on_done()

Pattern 2: Multi-Step Pipeline

Chain multiple analyses together:

 1# Step 1: Quality control
 2qc_job = qc_applet.run({"reads": input_file})
 3
 4# Step 2: Alignment (uses QC output)
 5align_job = align_applet.run({
 6    "reads": qc_job.get_output_ref("filtered_reads")
 7})
 8
 9# Step 3: Variant calling (uses alignment output)
10variant_job = variant_applet.run({
11    "bam": align_job.get_output_ref("aligned_bam")
12})

Pattern 3: Data Organization

Organize analysis results systematically:

 1# Create organized folder structure
 2dxpy.api.project_new_folder(
 3    "project-xxxx",
 4    {"folder": "/experiments/exp001/results", "parents": True}
 5)
 6
 7# Upload with metadata
 8result_file = dxpy.upload_local_file(
 9    "results.txt",
10    project="project-xxxx",
11    folder="/experiments/exp001/results",
12    properties={
13        "experiment": "exp001",
14        "sample": "sample1",
15        "analysis_date": "2025-10-20"
16    },
17    tags=["validated", "published"]
18)

Best Practices

  1. Error Handling: Always wrap API calls in try-except blocks
  2. Resource Management: Choose appropriate instance types for workloads
  3. Data Organization: Use consistent folder structures and metadata
  4. Cost Optimization: Archive old data, use appropriate storage classes
  5. Documentation: Include clear descriptions in dxapp.json
  6. Testing: Test apps with various input types before production use
  7. Version Control: Use semantic versioning for apps
  8. Security: Never hardcode credentials in source code
  9. Logging: Include informative log messages for debugging
  10. Cleanup: Remove temporary files and failed jobs

Resources

This skill includes detailed reference documentation:

references/

  • app-development.md - Complete guide to building and deploying apps/applets
  • data-operations.md - File management, records, search, and project operations
  • job-execution.md - Running jobs, workflows, monitoring, and parallel processing
  • python-sdk.md - Comprehensive dxpy library reference with all classes and functions
  • configuration.md - dxapp.json specification and dependency management

Load these references when you need detailed information about specific operations or when working on complex tasks.

Getting Help

What Users Are Saying

Real feedback from the community

Environment Matrix

Dependencies

Python 3.6+
dxpy library (pip install dxpy)

Framework Support

DNAnexus Platform ✓ (required) Docker containers ✓ Bash scripting ✓ Python SDK (dxpy) ✓ (recommended)

Context Window

Token Usage ~3K-8K tokens for typical pipeline configurations

Security & Privacy

Information

Author
davila7
Updated
2026-01-30
Category
productivity-tools