Building Interactive Visualizations of Genomics Data with Gosling
Tutorial VT2, ISMB 2022
Wed, July 6, 9:00 – 13:00 CDT
🦆
Sehi L'Yi
Trevor Manz
Qianwen Wang
Nils Gehlenborg
Biomedical Informatics, Harvard Medical School
1
Sehi L'Yi
Trevor Manz
Qianwen Wang
Nils Gehlenborg
Instructors
Postdoctoral research fellow in Biomedical Informatics at Harvard Medical School. Interested in designing methods and tools for interactive data visualization.
@WangQianwenToo
Postdoctoral research fellow in Biomedical Informatics at Harvard Medical School. Interested in designing, implementing, evaluating interactive data visualization.
@sehi_lyi
PhD candidate in the Bioinformatics and Integrative Genomics Program at Harvard Medical School. Focused on the intersection of data visualization, bioinformatics, and open-source software.
@trevmanz
Associate Professor of Biomedical Informatics at Harvard Medical School. Interested in designing methods and tools for data visualization across the spectrum of biomedical data.
@ngehlenborg
2
If You Have Any Questions During Tutorial
3
Contact
4
Tutorial Overview
5
Tutorial Goal: What You Are Expected To Learn
6
Schedule (09:00–13:00 CDT)
7
During Five Hands-on Sessions…
8
Setup Instructions for Tutorial VT2�"Building Interactive Visualizations of Genomics Data with Gosling"
Introduction (Part 1)
Genomics Data Visualization
Presenter: Nils Gehlenborg
10
11
Tool Catalogs
Presenter: Nils Gehlenborg
12
Awesome Genome Visualization
GenoCAT
486 Tools
107 Tools
Taxonomies for Genomics Data Visualization
13
Taxonomy
14
Nusrat, Harbig & Gehlenborg, 2019
Taxonomy
15
Nusrat, Harbig & Gehlenborg, 2019
Taxonomy
16
Nusrat, Harbig & Gehlenborg, 2019
Coordinate System: defines how genomic coordinates are mapped into the visualization space
Taxonomy
17
Nusrat, Harbig & Gehlenborg, 2019
Tracks: a track roughly corresponds to a dataset that maps categorical, quantitative, etc. data to genomic coordinates
Taxonomy
18
Nusrat, Harbig & Gehlenborg, 2019
View Configurations: a view defines a genomic region that is being visualized and consists of one or more tracks;
multiple views can be linked to each other
Layout
19
Nusrat, Harbig & Gehlenborg, 2019
Layout
20
EpiViz
MizBee
Hilbert Curve
HIC3D Viewer
Layout
21
Linear
Circular
Space-Filling
3D
Arrangement
22
Nusrat, Harbig & Gehlenborg, 2019
Arrangement
23
SyntenyExplorer
Cinteny
HiGlass
Arrangement
24
Serial
Parallel
Orthogonal
Track Alignment
25
Nusrat, Harbig & Gehlenborg, 2019
Track Alignment
26
EpiViz
Track Alignment
27
Track Alignment
28
Track Alignment
29
Views
30
Nusrat, Harbig & Gehlenborg, 2019
Views
31
SyntenyExplorer
MizBee
Views
32
Scales
33
Foci
34
IGV
Foci
35
Taxonomy
36
Nusrat, Harbig & Gehlenborg, 2019
Challenges in Genomics Data Visualization
37
38
Introduction (Part 2)
The Gosling Grammar
Presenter: Sehi L'Yi
39
Gosling
40
Gosling Key Features
41
42
Supported File Formats (as of June 29, 2022)
Plain Datasets (No HiGlass Server)
Pre-aggregated Datasets (HiGlass Server)
43
Details: http://gosling-lang.org/docs/data
Gosling Ecosystem
Gosling.js (JavaScript/TypeScript)
JSON text → Visualization
Web application/React
Online Editor (https://gosling.js.org)
44
🦆
Gosling Ecosystem
Gosling.js (JavaScript/TypeScript)
JSON text → Visualization
Web application/React
Online Editor (https://gosling.js.org)
45
🦆
Today's Tutorial
The Gosling Grammar: Tracks & Views
46
The Gosling Grammar: Tracks & Views
47
The Gosling Grammar: Tracks & Views
48
The Gosling Grammar: Tracks & Views
49
The Gosling Grammar: Tracks & Views
��{"views":[� {tracks:[{ … },{ … }]},� {tracks:[{ … },{ … }]},� {tracks:[{ … },{ … }]},�]}
50
Grammar of Graphics (Wilkinson 1999)
51
Grammar of Graphics in Gosling: Defining Track
52
Example: Point mark + Size channel
53
point mark
+
size channel
domain
range (px)
0
1
2
12
Your Data
Example: Point mark + Size channel
54
point mark
+
size channel
domain
range (px)
0.2
0
1
2
12
Your Data
4px
Example: Point mark + Size channel
55
domain
range (px)
0.2
0
1
2
12
0.9
point mark
+
size channel
Your Data
11px
Example: Point mark + Size channel
56
domain
range (px)
0.2
0
1
2
12
0.9
point mark
+
size channel
Your Data
0.6
8px
Example: Point mark + Size channel
57
domain
range (px)
0.2
0
1
2
12
0.9
point mark
+
size channel
Tabularized�(Abstracted) �Genomics Data
0.6
Data Abstraction
58
BigWig
0.142�0.321�0.951�0.214�0.041�0.000�…
chr | position | peak |
"chr1" | 123,000 | 0.142 |
"chr1" | 124,000 | 0.321 |
"chr1" | 125,000 | 0.951 |
… | | |
Internal Tabular BigWig Data�In Gosling
59
60
61
62
In Gos…
63
→ Through Gos API Functions
→ Rendered on Notebooks
Composition Primitives
64
65
66
In the Following Hands-On Sessions…
67
Using Google Colab Notebooks
Copy Notebooks
Be aware of mouse cursor positions for scrolling
68
Session 1: Single Track
Author custom tracks based on the Grammar of Graphics
Presenter: Trevor Manz
69
☕️ Coffee Break (15 min)��10:30–10:45
70
Session 2: Track Alignment & Local Data
Compose tracks either by stacking and overlaying (e.g., genes)
Presenter: Trevor Manz
71
Session 3: Semantic Zooming
Use a unique primitive in Gosling to reveal patterns across scales
Presenter: Sehi L'Yi
72
☕️ Coffee Break (15 min)
11:45–12:00
73
Session 4: Coordinated Multiple Views
Compose multiple views with coordinated interactions
Presenter: Qianwen Wang
74
Session 5: Share Your Visualization
Create shareable web-based applications for your Gosling visualizations
Presenter: Qianwen Wang
75
We will use the following slides
Various Ways to Share Visualizations
Due to time limits, we do not cover the creation of Streamlit apps and React apps in this tutorial.
Please refer to Streamlit-gosling repo
Please refer to gosling doc and gosling-react repo for more details.
A URL Link
https://gosling.js.org
https://gosling.js.org/?full=false&spec=(G'arrangementWhorizontalVlinkingIdWidVtitleWComparison%20of%20Micro-C%20and%20Hi-C%20for%20HFFc6%20CellsVviews4%5BG*LDJYdataU2QBXhiRANHi-C'AOUEZS9Y~eUDT%2CG*LDJYdataU2QBXmicroRANMicro-C'AOUEZS9Y~eUDTG%5D%0A)*%20%202b**4!%209'PKj)A%2C2Bs%3A%2F%2Fserver.gosling-lang.org%2Fapi%2Fv1%2Ftileset_info%2F%3FD'fieldWE'chromosomeW7'P'interval4%5B77700000P81000000%5DG%0A*Jvalue'P'rangeWwarm'PKquantitative')K'typeWL(b'tracks4%5Bb*(2'colorUN'markWrect'YtitleWHFFc6_O'width4375YxU2*'domainP%2C%20Q*Kmatrix'A*'urlWhttpRc-hg38'2)Yheight4375Sj2)YxeUDxeTye9b*)b%5DG*)U4(V'%2CG'W4'Xd%3Dhffc6-YA'Z)A*Dxs'A*KbG**jgenomic'~yUDys9Yy%01~jbZYXWVUTSRQPONLKJGEDBA942*_
the orange string in URL is a compression of the gosling JSON spec using JSONCrush
An HTML File
An HTML File
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/higlass@1.11/dist/hglib.css">
<script src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/pixi.js@6/dist/browser/pixi.min.js"></script>
<script src="https://unpkg.com/higlass@1.11/dist/hglib.js"></script>
<script src="https://unpkg.com/gosling.js@0.9.17/dist/gosling.js"></script>
</head>
<body>
<div id="gosling-container"/>
<script>
gosling.embed(
document.getElementById('gosling-container'),
{your_gosling_spec}
);
</script>
</body>
</html>
Github Gist + Gosling Editor
https://gist.github.com/wangqianwen0418/6f092d419fecae20273de919f5a04284
https://gosling.js.org/?gist=wangqianwen0418/6f092d419fecae20273de919f5a04284
Github Gist + Gosling Editor
https://gist.github.com/wangqianwen0418/6f092d419fecae20273de919f5a04284
https://gosling.js.org/?gist=wangqianwen0418/6f092d419fecae20273de919f5a04284
Hands-On Exercises
Choose one visualization you created in previous sessions:
Closing
83
Story of the Name “Gosling”
84
Story of the Name “Gosling”
85
Story of the Name “Gosling”
86
http://gosling-lang.org/about/
Resources
87
Contact
88
#goslinglang
89
ISMB Tutorial Feedback Survey
90
APPENDIX
Applications of Using Gosling
91
Online Editor (https://gosling.js.org)
A interactive website that enables users to author Gosling.js visualization
92
Gosling React Template (https://github.com/gosling-lang/gosling-react)
A template GitHub repository to use Gosling.js and its API in a React application
93
GenoREC
94
Interactive Browser for Somatic Structural Variation
A web-based interactive multi-scale visualization tool that enables browsing individual samples in multiple levels of scale from whole genome, chromosome, and individual genes to raw reads
95
Interactive Browser for Somatic Structural Variation
A web-based interactive multi-scale visualization tool that enables browsing individual samples in multiple levels of scale from whole genome, chromosome, and individual genes to raw reads
96
Interactive Browser for Somatic Structural Variation
A web-based interactive multi-scale visualization tool that enables browsing individual samples in multiple levels of scale from whole genome, chromosome, and individual genes to raw reads
97