Skip to content

Commit 009c1f7

Browse files
committed
feat(editor): add example using models from Tan 2018 (#1148)
1 parent c41c62b commit 009c1f7

File tree

5 files changed

+109
-7
lines changed

5 files changed

+109
-7
lines changed

editor/example/index.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,19 +446,25 @@ export const editorExampleObj: {
446446
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_DENSITY,
447447
image: THUMBNAILS.SPATIAL_DENSITY,
448448
},
449+
SPATIAL_LAYOUT_SUPERIMP: {
450+
group: 'Spatial Layout',
451+
name: 'Multiple tracks',
452+
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_MULTIPLE_TRACKS,
453+
image: THUMBNAILS.SPATIAL_MULTIPLE_TRACKS
454+
},
455+
SPATIAL_LAYOUT_TAN_COMP: {
456+
group: 'Spatial Layout',
457+
name: 'Human Cell Model (Tan et al., Science 2018): Comparison',
458+
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_TAN_COMP,
459+
image: THUMBNAILS.SPATIAL_TAN,
460+
},
449461
SPATIAL_LAYOUT_3D_YEAST_MODEL: {
450462
group: 'Spatial Layout',
451463
name: '3D Yeast Model (Nature 2010)',
452464
spec: JsonExampleSpecs.EX_SPEC_3D_YEAST_MODEL,
453465
image: THUMBNAILS.SPATIAL_YEAST,
454466
forceShow: true
455467
},
456-
SPATIAL_LAYOUT_SUPERIMP: {
457-
group: 'Spatial Layout',
458-
name: 'Multiple tracks',
459-
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_MULTIPLE_TRACKS,
460-
image: THUMBNAILS.SPATIAL_MULTIPLE_TRACKS
461-
},
462468
CORCES_ET_AL: {
463469
group: 'Coordinated Multiple Views',
464470
name: 'Corces et al. 2020',

editor/example/json-spec/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import { EX_SPEC_TEMPLATE } from './track-template';
2626
import { EX_SPEC_MOUSE_EVENT } from './mouse-event';
2727
import { EX_SPEC_PERF_ALIGNMENT } from './perf-alignment';
2828
import { EX_SPEC_DEBUG } from './debug';
29-
import { EX_SPEC_SPATIAL_MINIMAL, EX_SPEC_SPATIAL_MULTIPLE_TRACKS, EX_SPEC_SPATIAL_COLOR, EX_SPEC_SPATIAL_DENSITY } from './spatial-layout';
29+
import {
30+
EX_SPEC_SPATIAL_MINIMAL, EX_SPEC_SPATIAL_MULTIPLE_TRACKS, EX_SPEC_SPATIAL_COLOR, EX_SPEC_SPATIAL_DENSITY,
31+
EX_SPEC_SPATIAL_TAN_COMP
32+
} from './spatial-layout';
3033
import { EX_SPEC_3D_YEAST_MODEL } from './3d-yeast-model';
3134

3235
export const JsonExampleSpecs = {
@@ -67,4 +70,5 @@ export const JsonExampleSpecs = {
6770
EX_SPEC_3D_YEAST_MODEL,
6871
EX_SPEC_SPATIAL_COLOR,
6972
EX_SPEC_SPATIAL_DENSITY,
73+
EX_SPEC_SPATIAL_TAN_COMP,
7074
};

editor/example/json-spec/spatial-layout.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,96 @@ export const EX_SPEC_SPATIAL_MULTIPLE_TRACKS: GoslingSpec = {
215215
]
216216
};
217217

218+
219+
export const EX_SPEC_SPATIAL_TAN_COMP: GoslingSpec = {
220+
title: 'Tan 2018 (Science) comparison',
221+
arrangement: "horizontal",
222+
views: [
223+
{
224+
layout: {
225+
type: 'spatial',
226+
model: {
227+
type: 'csv',
228+
url: 'https://raw.githubusercontent.com/dvdkouril/chromospace-sample-data/refs/heads/main/gosling-3d/tan-2018/Tan-2018_GSM3271347_gm12878_01.csv',
229+
xyz: ['x', 'y', 'z'],
230+
chromosome: 'chr',
231+
position: 'coord'
232+
}
233+
},
234+
width: 500,
235+
height: 500,
236+
alignment: "overlay",
237+
tracks: [
238+
{
239+
color: {
240+
value: 'gainsboro'
241+
},
242+
size: {
243+
value: 0.005,
244+
},
245+
mark: 'sphere',
246+
},
247+
{
248+
color: {
249+
value: 'darkslateblue'
250+
},
251+
size: {
252+
value: 0.02,
253+
},
254+
mark: 'box',
255+
dataTransform: [{
256+
type: "filter",
257+
field: "chr",
258+
oneOf: ["1(pat)"],
259+
}],
260+
},
261+
262+
]
263+
},
264+
{
265+
layout: {
266+
type: 'spatial',
267+
model: {
268+
type: 'csv',
269+
url: 'https://raw.githubusercontent.com/dvdkouril/chromospace-sample-data/refs/heads/main/gosling-3d/tan-2018/Tan-2018_GSM3271348_gm12878_02.csv',
270+
xyz: ['x', 'y', 'z'],
271+
chromosome: 'chr',
272+
position: 'coord'
273+
}
274+
},
275+
width: 500,
276+
height: 500,
277+
alignment: "overlay",
278+
tracks: [
279+
{
280+
color: {
281+
value: 'gainsboro'
282+
},
283+
size: {
284+
value: 0.005,
285+
},
286+
mark: 'sphere',
287+
},
288+
{
289+
color: {
290+
value: 'darkslateblue'
291+
},
292+
size: {
293+
value: 0.02,
294+
},
295+
mark: 'box',
296+
dataTransform: [{
297+
type: "filter",
298+
field: "chr",
299+
oneOf: ["1(pat)"],
300+
}],
301+
},
302+
303+
]
304+
}
305+
]
306+
};
307+
218308
export const EX_SPEC_SPATIAL_SUPERIMPOSITION: GoslingSpec = {
219309
title: 'Spatial Layout: superimposition',
220310
views: [

editor/example/thumbnails.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import SPATIAL_YEAST from './thumbnails/SPATIAL_YEAST.png';
3535
import SPATIAL_COLOR from './thumbnails/SPATIAL_COLOR.png';
3636
import SPATIAL_DENSITY from './thumbnails/SPATIAL_DENSITY.png';
3737
import SPATIAL_MULTIPLE_TRACKS from './thumbnails/SPATIAL_MULTIPLE_TRACKS.png';
38+
import SPATIAL_TAN from './thumbnails/SPATIAL_TAN.png';
3839

3940
export const THUMBNAILS = {
4041
ALIGNMENT,
@@ -74,4 +75,5 @@ export const THUMBNAILS = {
7475
SPATIAL_COLOR,
7576
SPATIAL_DENSITY,
7677
SPATIAL_MULTIPLE_TRACKS,
78+
SPATIAL_TAN,
7779
};
106 KB
Loading

0 commit comments

Comments
 (0)