🚀 Jumpstart 2027: Custom, Secure AI Workflows to Adopt Now. Reserve your spot →

Chris Parmer

Chris Parmer

November 30, 2026

GWAS results browser app for every association in the GWAS Catalog

A data app example built with Dash and an AI coding agent in 70 minutes

TL;DR

  • Building data apps with AI coding agents in Python and managing them on Dash Enterprise or Plotly Cloud is the modern alternative to BI. At Plotly, many of our customers are migrating away from point-and-click tools like Spotfire, Tableau, and Power BI toward code-backed tools powered by AI. This example showcases the types of apps that you can create.
  • This app puts every genome-wide association study (GWAS) result in the NHGRI-EBI GWAS Catalog that has a genome position on one Manhattan plot, with a QQ plot and a list of loci for every trait. A coding agent built it from one prompt in about 70 minutes.
  • Every trait and every variant has its own page, so you can click from the genome-wide view to type 2 diabetes, then to a single variant, and send the link to a colleague.
  • Zooming into the Manhattan plot runs a new DuckDB query for the window, so you can go from the whole genome to one gene without the app dropping any associations.
  • The full prompt is below, so you can build the same kind of app on your own data and run it on Dash Enterprise behind your firewall or have it hosted for you on Plotly Cloud.

Walkthrough

Human genetics and target discovery teams check what's already known about a gene, a variant, or a disease before they commit to a target. The GWAS Catalog is where that evidence is collected, and this app puts it in one place you can browse, with a page for each trait and each variant.

It starts with every association in the catalog on one plot and lets you drill into a region, a trait, or a single variant.

Zoom from the whole genome to a single gene

The overview page of the GWAS Catalog browser: headline numbers for associations, variants, traits and papers, a Manhattan plot of every association in the catalog on a log scale with controls for the axis and the chromosome, associations by publication year, and the most-studied traits

The overview draws every association with a genome position on one Manhattan plot, on a log scale so the weakest and the strongest results fit together. Odd and even chromosomes alternate in color, and a dotted line marks genome-wide significance.

Hovering shows the variant, its gene, the trait, and the p-value, and clicking a point opens that variant's page.

The overview's Manhattan plot zoomed into chromosome 19 between 44 and 46 million base pairs, around the APOE gene, showing every association in the window with a note of how many there are and how long the DuckDB query took

Drag across a region and the app queries DuckDB for that window. Wide windows show the strongest result in each spot, and narrow ones show every association, so you can go from the whole genome to the APOE region in two drags.

Open a trait and see its loci

The trait page for LDL cholesterol: headline numbers for associations, loci, genome-wide significant share and strongest p-value, a Manhattan plot with the strongest loci labeled by gene, a QQ plot, a table of loci, associations by publication year, and the studies behind the trait

Each trait has its own page with its Manhattan plot, the strongest loci labeled with their mapped genes, and a table of every locus with its lead variant. For LDL cholesterol, PCSK9 and HMGCR, the targets of two classes of cholesterol drugs, show up near the top.

A QQ plot shows how far the trait's results sit above what chance would give, and the studies table links each result to its paper.

See every trait a variant is associated with

The variant page for rs429358 in APOE: headline numbers for traits, studies, strongest p-value and genome-wide significant traits, a PheWAS plot of every associated trait grouped by category, a regional plot of every association within 500 kilobases, and a table of the variant's associations

A variant's page plots every trait it's associated with, grouped by category, which is a phenome-wide association study (PheWAS) view. A target team uses it to see what else a gene's variants affect before betting on it.

The neighborhood plot shows every association within 500 kilobases, so you can tell whether the variant is the strongest signal in its region.

Search every trait in the catalog

The traits page: a bar chart of associations by trait category, and a searchable table of every trait with its associations, loci, studies, papers, strongest p-value, and ontology ID

The traits page lists every trait with its associations, loci, studies, and strongest result, and a search box filters it as you type. Clicking a row opens the trait's page.

Ask the app from an AI agent

The AI tools page, listing the app's eight MCP tools with their type signatures and descriptions: catalog summary, search traits, trait summary, trait loci, variant associations, region associations, gene traits, and a read-only SQL query tool

The app is also an MCP server. Eight of its Python functions are marked with @mcp_enabled, so any AI tool like Claude, ChatGPT, Copilot, or Plotly Studio Embedded can ask it which loci a trait has, what else a gene's variants are associated with, or what sits in a region, and get the numbers the pages show.

The tools are catalog_summary, search_traits, trait_summary, trait_loci, variant_associations, region_associations, gene_traits, and query_data, a read-only SQL tool that runs on a DuckDB database with file and network access switched off. Each tool's type hints become its schema, and its docstring becomes the instructions the agent reads:

from dash.mcp import mcp_enabled
@mcp_enabled(expose_docstring=True)
def gene_traits(gene: str) -> list[dict]:
"""Traits with associations mapped to a gene symbol (the catalog's MAPPED_GENE, e.g. 'PCSK9', 'APOE'), with
associations, the strongest -log10(p) and its variant. Use this to see what else a drug target's
variants are associated with."""
return _records(gwas.gene_traits(gene))

Ask it inside the app with Plotly Studio Embedded

Plotly Studio Embedded open beside the catalog's Manhattan plot, with a bar chart of the top 20 genes shared by LDL cholesterol and coronary artery disease, ranked by the weaker of each gene's two strongest -log10(p) values, with LPA, CETP, IL6R, and APOB highlighted in red as known drug targets, and an answer naming ABO, ABCG8, and LPA as the top three

On Plotly Cloud you can switch on Plotly Studio Embedded, a chat panel that sits on top of the app and calls the same tools. We asked it which genes have genome-wide significant associations with both LDL cholesterol and coronary artery disease, and which of them are known drug targets, then asked for the top 20 in a chart ranked by the weaker of each gene's two p-values. It ran the app's search_traits and trait_loci tools and built the chart from what they returned.

It found 121 genes mapped to a genome-wide significant locus in both traits, led by ABO, ABCG8, and LPA, with PCSK9 just outside the chart in 24th place. It highlighted LPA, CETP, IL6R, and APOB as known drug targets and said those labels came from its own knowledge, because the GWAS Catalog has no drug-target data, so that part of the answer is worth checking against a drug database.

Studio Embedded is available on Plotly Cloud now and comes to Dash Enterprise in Q4 2026. Every answer has a Methodology link that shows the tool calls and code behind it.

See how every number is defined

The How we calculate page: eight metric definitions, each with the question it answers, a plain-words definition, the formula, the current value, and the DuckDB function that computes it, covering associations, p-values, genome-wide significance, traits, loci, the QQ plot, sample size, and the Manhattan plot window

Counts like these depend on choices: which associations have a usable position, how an association mapped to two traits is counted, what makes two hits the same locus, and what a QQ plot should compare against when the catalog only lists p-values below 1e-5. The How we calculate page writes down these data definitions and methodology in the app, with the formula and the function that computes each number.

Data is often messy and ambiguous, and writing things down is a way for your app's viewers to know how you came to certain numbers.

Those functions are the app's semantic layer. The charts, the tables, and the AI tools all call the same ones, so a number means the same thing wherever it shows up.

What else could you add?

The prompt is a starting point. These are the kinds of things teams usually ask for next, and each one is a sentence or two more in the prompt:

  • Your own GWAS summary statistics next to the catalog, with a real QQ plot and genomic inflation for each study
  • Linkage disequilibrium clumping with a reference panel instead of the distance rule
  • Fine-mapping and colocalization results from Open Targets for each locus
  • A target page that pulls in expression, drug, and clinical trial data for a gene
  • Notes on a locus or a target, saved to a database and shared with the team

How is this different from Spotfire and other BI tools?

If you're comparing Spotfire alternatives or other BI tools, the main differences come down to five things:

  1. With AI, apps like this can be built quickly and cheaply by anyone, including the statistical geneticists and target discovery scientists who know the data best.
  2. The apps are backed by code, which you can version control, manage, and update more easily than a fleet of point-and-click dashboards, especially when AI is making the changes.
  3. The apps can go much further than a traditional BI tool, with multiple pages, write-back to databases, custom simulations, AI chart building inside the app, MCP endpoints, and more.
  4. You have full control over the app: the look and feel, the controls, filters, and buttons, and every computation. You aren't fighting a tool to get what you want.
  5. The apps can connect to several data sources at once, and to the other systems your team already uses.

How long did it take to build?

About 70 minutes of agent time, from the first download to the app on Plotly Cloud. Claude Code (with Claude Opus 5.5) downloaded the catalog release, checked it, built the app, ran it, took screenshots, and fixed what looked wrong in them, all from one prompt.

Before building on the data, it compared its count of associations and publications with the totals the GWAS Catalog publishes for the same release, and both matched exactly.

The prompt

Paste this into Claude Code, Codex, Copilot, Cursor, or another coding agent, in an empty folder. Swap in your own data source and the features you need.

Build a Dash app for browsing every association in the NHGRI-EBI GWAS Catalog, using DuckDB for every query.

Data

  • Download the latest release's associations file and trait mapping file from the catalog's FTP site, and the catalog's published statistics from its API.
  • With DuckDB, keep the associations that have one GRCh38 position, and write Parquet tables for associations, traits, studies, papers, and genes. Say how many you left out and why.
  • Before you build anything, check your association and publication counts against the catalog's published totals, and tell me how close they are.

Pages (each with its own URL, and the back button must work)

  • Overview: KPI cards for associations, variants, traits, and papers, with sparklines. One Manhattan plot of every association on a log scale, where zooming runs a new DuckDB query for the window and wide windows show the strongest result in each spot. Associations by publication year and the most-studied traits.
  • /traits: a bar chart by trait category and a searchable table of every trait, where clicking a row opens /trait/<id>.
  • /trait/<id>: KPI cards, a Manhattan plot with the strongest loci labeled by gene, a QQ plot against a null truncated at the catalog's 1e-5 threshold, a table of loci clumped by 500 kb distance, associations by year, and the studies.
  • /variant/<rsid>: a PheWAS plot of every trait the variant is associated with, the associations within 500 kb, and its associations table.
  • A How we calculate page with every metric's question, definition, formula, current value, and the function that computes it.
  • An AI tools page listing the metric functions exposed with `@mcp_enabled`, including a read-only SQL tool with file access switched off.

Design

  • A gray page with an inset sidebar. Each card is a light surface with its title above a white inset panel for the chart or table. Dense AG Grid tables. Inter everywhere. No chart toolbars.

Run it, screenshot every page at 1600x1000, and fix anything that overflows, looks empty, or doesn't match the numbers before you stop.

How do I run it on Dash Enterprise or Plotly Cloud?

Dash Enterprise runs Dash apps inside your own infrastructure, behind your firewall and even air-gapped, with single sign-on and access control for each app.

This app needs nothing special. It's a Dash app with a requirements.txt, and your coding agent can deploy it through the Dash Enterprise or Plotly Cloud command line.

The app downloads the catalog release and builds its Parquet files the first time it starts. Keep them on a persistent filesystem so it doesn't download the release again after a restart: point the app at it with an environment variable such as DATA_DIR=/data, and refresh it when the catalog publishes a new release.

If you'd rather not run any infrastructure, Plotly Cloud hosts the same app for you. We tested this one there.

Tips and tricks

These are things we like doing when we build apps like this one.

  • Ask for a page per thing. A page for each trait and variant, with its own URL, makes the app feel like a website rather than a report, and lets people share exactly what they're looking at.
  • Make the agent check the data first. Ask it to compare its counts with the totals the source itself publishes. That check is what lets you trust everything built on top of it.
  • Query on zoom instead of drawing everything. A browser can't draw a million points quickly, but DuckDB can summarize a million rows for any window in a fraction of a second. Ask for a query per zoom, with every point shown once the window is small enough.
  • Write down your data definitions and methodology. Which associations count, how a trait is defined, what a locus is, and what the QQ plot compares against are all choices. Put them on a page in the app so viewers can see how you came to each number.
  • Let plain Python functions be your semantic layer. The Manhattan window, the loci, the QQ points, and the trait counts are short DuckDB functions, and you can read them, test them, and change them, and so can the agent. Plain Python functions like these can become your semantic layer, one definition that every page, test, and agent uses.
  • Wrap your Python functions in @mcp_enabled. Turn on enable_mcp=True in the Dash(...) call and mark the functions with @mcp_enabled, and chat agents like Claude, ChatGPT, or Copilot can call them over MCP and get the same numbers the app's pages show.
  • Lock down the SQL tool. If you give agents a SQL tool, load the data into memory and switch off DuckDB's file and network access first, so a query can only read the app's own tables.
  • Switch on Plotly Studio Embedded. The same tools power Plotly Studio Embedded, an AI chat inside the app that answers questions with charts and tables built from your functions. It's available now on Plotly Cloud (in beta) and is planned for Dash Enterprise in Q4 2026.

FAQ

See what Dash Enterprise and Plotly Cloud can do for your team

Our customers in energy, pharma, finance, and manufacturing are building apps like this one with coding agents and running them on Dash Enterprise behind their firewall or on Plotly Cloud. Request a demo and we'll show you how it works for your team.

bluesly
x
instagram
youtube
medium
fcaebook

Product

© 2026
Plotly. All rights reserved.
Cookie Preferences
aicpa/soc2