Skip to content

Commit

Permalink
add GenomeSpy visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
tuner committed Apr 20, 2023
1 parent 8ae1b93 commit 16b4a93
Show file tree
Hide file tree
Showing 21 changed files with 33,259 additions and 0 deletions.
5 changes: 5 additions & 0 deletions genomespy-visualization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GenomeSpy Visualization

This directory contains visualization specifications and data files for the
[GenomeSpy](https://genomespy.app/) visualization published at
https://csbi.ltdk.helsinki.fi/pub/projects/lahtinen_et_al_2023/
203 changes: 203 additions & 0 deletions genomespy-visualization/gistic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
{
"$schema": "https://unpkg.com/@genome-spy/core/dist/schema.json",

"name": "gistic-track",
"title": "GISTIC analysis",

"visible": false,

"resolve": { "scale": { "x": "shared" } },

"vconcat": [
{
"name": "gistic-q-value",
"title": { "text": "Q-values", "orient": "none" },
"height": 100,

"layer": [
{
"data": { "values": [0] },

"encoding": {
"y": { "field": "data", "type": "quantitative", "title": null }
},

"mark": {
"type": "rule",
"color": "black",
"opacity": 0.3
}
},
{
"data": {
"url": "data/scores.gistic",
"format": {
"type": "tsv"
}
},

"transform": [
{
"type": "formula",
"expr": "datum['-log10(q-value)'] * (datum.Type == 'Del' ? -1 : 1)",
"as": "-log10(q-value)"
}
],

"encoding": {
"color": {
"field": "Type",
"type": "nominal",
"scale": {
"domain": ["Amp", "Del"],
"range": ["#e45756", "#4c78a8"]
}
},
"y": { "field": "-log10(q-value)", "type": "quantitative" },
"x": {
"chrom": "Chromosome",
"pos": "Start",
"type": "locus",
"axis": null
},
"x2": { "chrom": "Chromosome", "pos": "End" }
},

"mark": {
"type": "rect",
"minOpacity": 1
}
},
{
"data": {
"values": [0.602, -0.602]
},

"encoding": {
"y": { "field": "data", "type": "quantitative", "title": null }
},

"mark": {
"type": "rule",
"strokeDash": [3, 1],
"color": "black",
"opacity": 0.3
}
},
{
"data": {
"values": [
"GISTIC q-values, computed for the representative discovery-cohort samples."
]
},
"encoding": {
"text": { "field": "data" }
},
"mark": {
"type": "text",
"x": 0,
"xOffset": 5,
"y": 1,
"yOffset": 5,
"baseline": "top",
"align": "left"
}
}
]
},
{
"name": "gistic-all-lesions",
"title": { "text": "Regions and peaks", "orient": "none" },

"height": 30,

"data": {
"url": "data/all_lesions.conf_75.txt",
"format": { "type": "tsv" }
},

"transform": [
{
"type": "regexExtract",
"field": "Unique Name",
"regex": "^(Amplification|Deletion) Peak[ ]+\\d+$",
"as": ["Type"],
"skipInvalidInput": true
},
{ "type": "filter", "expr": "!!datum.Type" },
{
"type": "regexFold",
"columnRegex": ["^(.*) Limits$"],
"asValue": ["limits"],
"asKey": "Segment type"
},
{
"type": "regexExtract",
"field": "limits",
"regex": "^(chr[^:]+):(\\d+)-(\\d+)",
"as": ["Chrom", "Start", "End"]
},
{
"type": "project",
"fields": [
"Segment type",
"Chrom",
"Start",
"End",
"Type",
"Descriptor",
"q values"
]
}
],

"encoding": {
"color": {
"field": "Type",
"type": "nominal",
"scale": {
"domain": ["Amplification", "Deletion"],
"range": ["#e45756", "#4c78a8"]
}
},
"y": {
"field": "Type",
"type": "nominal",
"scale": { "domain": ["Amplification", "Deletion"] },
"title": null
},
"x": {
"chrom": "Chrom",
"pos": "Start",
"type": "locus",
"axis": null
},
"x2": { "chrom": "Chrom", "pos": "End" },
"opacity": {
"field": "Segment type",
"type": "nominal",
"scale": {
"type": "ordinal",
"domain": ["Wide Peak", "Peak", "Region"],
"range": [0.3, 1, 0.3]
}
},
"size": {
"field": "Segment type",
"type": "nominal",
"scale": {
"type": "ordinal",
"domain": ["Wide Peak", "Peak", "Region"],
"range": [11, 15, 2]
}
}
},

"mark": {
"type": "rule",
"minLength": 2,
"minOpacity": 1
}
}
]
}
21 changes: 21 additions & 0 deletions genomespy-visualization/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>GenomeSpy</title>
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/@genome-spy/app@0.27.x/dist/style.css"
/>
</head>
<body>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@genome-spy/app@0.27.x/dist/index.js"
></script>

<script>
genomeSpyApp.embed(document.body, "spec.json", {});
</script>
</body>
</html>
Loading

0 comments on commit 16b4a93

Please sign in to comment.