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
  • How Viewers Work
  • Making a Custom Viewer

Was this helpful?

Export as PDF
  1. Developer

Creating Custom Viewers

Last updated 1 year ago

Was this helpful?

In addition to the public viewers available on the DNAnexus platform, users can create their own custom viewers. In order to create a custom viewer, you will need familiarity with web development and the ability to use the command line. Specifically, you will need access to the from the command line, and you will need to create the viewer yourself as a web application using HTML and JavaScript.

How Viewers Work

A Viewer is an HTML file with embedded JavaScript that has access to some user-specified files. When a Viewer is opened, a dialogue first appears that allows you to choose a set of files in your projects, for which download URLs are then generated. These files' download URLs are then made available to the Viewer through a snippet of JavaScript code. From there, a Viewer can link to another web server, such as the UCSC genome browser, or run some JavaScript within the Viewer itself -- for instance, by using an outside plotting library such as IGV.js.

The only difference between custom and public Viewers is that you can share custom Viewers with collaborators just as you would share any other item in your projects, while public Viewers are available to all users on the platform and can only be created or changed by DNAnexus employees. When a custom Viewer is present in a project you select, it will be listed in the Visualize tab above the DNAnexus Viewers.

Making a Custom Viewer

  1. Make sure you have installed and you can access it from the command line.

  2. Download some Viewers to see how they are written. You can also adapt a pre-existing Viewer if one similar to your required viewer exists.

$ dx select project-BQ7k4pj0FVky4kVkgVf0000F
Selected project project-BQ7k4pj0FVky4kVkgVf0000F
$ dx ls -l
Project: Viewers (project-BQ7k4pj0FVky4kVkgVf0000F)
...
$ dx download file-xxxx
  1. Write the HTML file using an existing FileViewer as a template. The name of the HTML file will be the name listed for this Viewer in the Visualize tab. The file name does not have to have the .html extension, and it can have spaces if you put the name in quotes.

  2. Upload the HTML file into one of your DNAnexus projects using the --type FileViewer and setting --details with a JSON string containing the patterns for files that the Viewer will accept. In the case below, the FileViewer is named "My Bam Viewer", and it will only take files whose names end in .bam or .bai. Be sure to remove spaces from the --details patterns and carefully match the format below, including pairing quotes correctly. For the existing public Viewers, the Viewers' names also contain the file patterns (in parentheses) for informational purposes. It is the --details flag here that directly controls which files can be chosen for the Viewer.

$ dx select "My Project"
$ dx upload --type FileViewer --details='{"patterns":["*.bam","*.bai"]}' "My Bam Viewer"
[===========================================================>] Uploaded 4,043 of 4,043 bytes (100%) My\ Bam\ Viewer
  1. Go to the DNAnexus Platform and select the project where you uploaded the Viewer. Under the Visualize tab, you should see a section entitled Custom Viewers. Your new Viewer should be there, which you can now test and iterate. If you need to change the HTML file, you will need to remove it and re-upload it from the command line:

$ dx select "My Project"
Selected project My Project
$ dx rm "My Bam Viewer"
$ dx upload --type FileViewer --details='{"patterns":["*.bam","*.bai"]}' "My Bam Viewer"
[===========================================================>] Uploaded 4,043 of 4,043 bytes (100%) My\ Bam\ Viewer
DNAnexus SDK (dx-toolkit)
dx-toolkit