Introduction¶
GenomeSpy is a toolkit for interactive visualization of genomic and other data. It provides a declarative grammar for mapping data to visual channels, such as position and color, and for composing complex visualizations from primitive graphical marks, such as points and rectangles. The grammar is heavily inspired by Vega-Lite, with partial compatibility and extensions for genome visualization.
Visualizations are rendered with a carefully crafted WebGL-based engine, which enables fluid interaction and smooth animation for datasets with several million data points. This performance comes from using GPU shader programs for all scale transformations and mark rendering, but shaders are an implementation detail hidden from end users.
The toolkit comprises two JavaScript packages:
- The core library implements the visualization grammar and rendering engine and can be embedded in web pages or applications.
- The app builds on the core library for interactive analysis of large sample collections, such as cancer cohorts. It repeats a visualization across samples and adds tools for filtering, sorting, grouping, and exploring metadata.
Check the Getting Started page to get started with GenomeSpy and make your own tailored visualizations.
Genomic examples¶
GenomeSpy includes practical examples for common genomic visualization tasks:
- Chromosome Ideogram from Cytobands shows a compact ideogram built from UCSC cytoband intervals.
- RefSeq Gene Annotations with Scored Labels shows transcript structure, exon intervals, and dynamically fitted gene labels.
- ClinVar Small-Variant Classifications shows ClinVar VCF variants colored by germline classification.
- ASCAT Copy-Number Segmentation combines copy-number, LogR, BAF, ideogram, and gene annotation tracks.
- Sashimi Plot from Splice Junctions combines BigWig coverage with splice-junction arcs.
See Genomic Data Examples for the full list.
Minimal interactive example¶
The example below introduces basic grammar concepts such as data transforms, encodings, marks, and interactive zooming. You can zoom in using the mouse wheel.
{
"description": "Interactive point plot with a zoomable x-scale and zoom-dependent point size.",
"data": {
"sequence": { "start": 0, "stop": 200000, "as": "x" }
},
"transform": [
{ "type": "formula", "expr": "random() * 0.682", "as": "u" },
{
"type": "formula",
"expr": "((datum.u % 1e-8 > 5e-9 ? 1 : -1) * (sqrt(-log(max(1e-9, datum.u))) - 0.618)) * 1.618 + sin(datum.x / 10000)",
"as": "y"
}
],
"mark": {
"type": "point",
"size": { "expr": "min(0.5 * pow(zoomLevel, 1.5), 200)" }
},
"encoding": {
"x": {
"field": "x",
"type": "quantitative",
"scale": { "zoom": true }
},
"y": { "field": "y", "type": "quantitative" },
"opacity": { "value": 0.6 }
}
}
About¶
GenomeSpy is developed by Kari Lavikka in The Systems Biology of Drug Resistance in Cancer group at the University of Helsinki.
This project has received funding from the European Union's Horizon 2020 Research and Innovation Programme under Grant agreement No. 667403 (HERCULES) and No. 965193 (DECIDER)