samplevis.json 19.6 KB
Newer Older
jhoogenboom's avatar
jhoogenboom committed
1
2
3
{
  "width": 600,
  "height": 10,
4
5
6
7
8
9
10
11
12
  "signals": [
    {
      "name": "amplitude_threshold",
      "init": 5
    },
    {
      "name": "amplitude_pct_threshold",
      "init": 0.5
    },
13
14
15
16
    {
      "name": "amplitude_markerpct_threshold",
      "init": 0
    },
17
18
19
20
    {
      "name": "orientation_threshold",
      "init": 0
    },
21
22
23
24
    {
      "name": "show_negative",
      "init": true
    },
25
26
27
28
    {
      "name": "show_other",
      "init": true
    },
29
30
31
32
33
34
    {
      "name": "bias_threshold",
      "init": 25
    },
    {
      "name": "filter_marker",
35
36
37
38
39
40
      "init": ""
    },
    {
      "name": "marker_regex",
      "init": {"expr": "regexp('(?:' + replace(replace(replace(filter_marker, /^ *(.*?) *$/, '$1'), /(^| )=(.*?)(?= |$)/g, '$1^$2$$'), / +/g, ')|(?:') + ')')"},
      "expr": "regexp('(?:' + replace(replace(replace(filter_marker, /^ *(.*?) *$/, '$1'), /(^| )=(.*?)(?= |$)/g, '$1^$2$$'), / +/g, ')|(?:') + ')')"
41
42
43
44
45
46
47
48
49
50
51
52
53
    },
    {
      "name": "barwidth",
      "init": 15
    },
    {
      "name": "subgraphoffset",
      "init": 70
    },
    {
      "name": "clickedAllele",
      "verbose": true,
      "streams": [
54
        {"type": "@alleleSelector:click[datum.thedatum]", "expr": "datum.thedatum"}
55
56
57
      ]
    }
  ],
jhoogenboom's avatar
jhoogenboom committed
58
59
  "data": [
    {
jhoogenboom's avatar
jhoogenboom committed
60
      "name": "raw",
jhoogenboom's avatar
jhoogenboom committed
61
62
63
64
65
      "values": "sample_data_file_contents_here",
      "format": {
        "type": "tsv",
        "parse": {
          "forward": "number",
66
67
          "forward_noise": "number",
          "forward_add": "number",
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
68
          "reverse": "number",
69
70
          "reverse_noise": "number",
          "reverse_add": "number",
jhoogenboom's avatar
jhoogenboom committed
71
72
73
74
75
76
          "total": "number",
          "total_noise": "number",
          "total_add": "number"
        }
      },
      "transform": [
77
78
79
80
        {
          "type": "filter",
          "test": "test(marker_regex, datum.marker)"
        },
81
82
83
84
85
86
87
88
89
90
        {
          "type": "formula",
          "field": "forward_corr",
          "expr": "datum.forward_noise? datum.forward-datum.forward_noise : datum.forward"
        },
        {
          "type": "formula",
          "field": "reverse_corr",
          "expr": "datum.reverse_noise? datum.reverse-datum.reverse_noise : datum.reverse"
        },
jhoogenboom's avatar
jhoogenboom committed
91
92
93
94
95
96
97
        {
          "type": "formula",
          "field": "total_corr",
          "expr": "datum.total_noise? datum.total-datum.total_noise : datum.total"
        },
        {
          "type": "formula",
98
99
          "field": "forward_added",
          "expr": "datum.forward_add? datum.forward_corr+datum.forward_add : datum.forward_corr"
jhoogenboom's avatar
jhoogenboom committed
100
        },
jhoogenboom's avatar
jhoogenboom committed
101
102
        {
          "type": "formula",
103
104
105
106
107
108
109
          "field": "reverse_added",
          "expr": "datum.reverse_add? datum.reverse_corr+datum.reverse_add : datum.reverse_corr"
        },
        {
          "type": "formula",
          "field": "total_added",
          "expr": "datum.total_add? datum.total_corr+datum.total_add : datum.total_corr"
jhoogenboom's avatar
jhoogenboom committed
110
111
112
113
        }
      ]
    },
    {
114
      "name": "aggr",
jhoogenboom's avatar
jhoogenboom committed
115
116
117
118
      "source": "raw",
      "transform": [
        {
          "type": "aggregate",
119
          "groupby": ["marker"],
120
          "summarize": {"total_added": ["sum", "max"]}
jhoogenboom's avatar
jhoogenboom committed
121
122
123
124
        }
      ]
    },
    {
125
      "name": "preannotated",
jhoogenboom's avatar
jhoogenboom committed
126
127
128
129
      "source": "raw",
      "transform": [
        {
          "type": "lookup",
130
          "on": "aggr",
131
132
          "onKey": "marker",
          "keys": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
133
          "as": ["aggr"],
134
          "default": {"max_total_added": 0, "sum_total_added": 0}
jhoogenboom's avatar
jhoogenboom committed
135
136
137
        },
        {
          "type": "formula",
138
139
          "field": "pct_of_max",
          "expr": "datum.aggr.max_total_added? (datum.total_added / datum.aggr.max_total_added * 100) : 100"
140
141
        },
        {
142
          "type": "formula",
143
144
          "field": "pct_of_sum",
          "expr": "datum.aggr.sum_total_added? (datum.total_added / datum.aggr.sum_total_added * 100) : 100"
145
        },
146
147
148
149
150
151
152
153
154
155
156
        {
          "type": "formula",
          "field": "markersequence",
          "expr": "datum.marker + '\t' + datum.sequence"
        }
      ]
    },
    {
      "name": "annotated",
      "source": "preannotated",
      "transform": [
jhoogenboom's avatar
jhoogenboom committed
157
158
159
160
161
162
163
164
        {
          "type": "formula",
          "field": "shared",
          "expr": "max(0, datum.total_corr)"
        },
        {
          "type": "formula",
          "field": "corr_shared",
165
          "expr": "min(datum.total, datum.total_added)"
jhoogenboom's avatar
jhoogenboom committed
166
167
168
169
170
171
172
173
        },
        {
          "type": "formula",
          "field": "corr_decreased",
          "expr": "max(datum.total, datum.corr_shared)"
        },
        {
          "type": "formula",
174
175
          "field": "forwardpct",
          "expr": "datum.total_added? (100.0 / datum.total_added * datum.forward_added) : 50"
jhoogenboom's avatar
jhoogenboom committed
176
177
178
        },
        {
          "type": "formula",
179
180
          "field": "minimum",
          "expr": "min(0, datum.total_corr)"
jhoogenboom's avatar
jhoogenboom committed
181
        },
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
182
183
184
        {
          "type": "formula",
          "field": "xlow",
185
186
187
188
189
190
          "expr": "datum.minimum*1.05"
        },
        {
          "type": "formula",
          "field": "maximum",
          "expr": "max(datum.total, datum.total_added)"
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
191
192
193
194
        },
        {
          "type": "formula",
          "field": "xhigh",
195
          "expr": "datum.maximum*1.05"
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
196
197
198
199
        },
        {
          "type": "formula",
          "field": "biasmark",
200
201
202
203
204
205
206
207
208
209
210
          "expr": "50-abs(datum.forwardpct-50) < bias_threshold? '\u2605' : ''"
        },
        {
          "type": "formula",
          "field": "thedatum",
          "expr": "datum"
        }
      ]
    },
    {
      "name": "table",
211
      "source": "preannotated",
212
      "transform": [
213
214
215
216
217
        {
          "type": "formula",
          "field": "sequence",
          "expr": "((show_negative? abs(datum.total_added) : datum.total_added) >= amplitude_threshold && (show_negative? abs(datum.pct_of_max) : datum.pct_of_max) >= amplitude_pct_threshold && (show_negative? abs(datum.pct_of_sum) : datum.pct_of_sum) >= amplitude_markerpct_threshold && min(show_negative? abs(datum.forward_added) : datum.forward_added, show_negative? abs(datum.reverse_added) : datum.reverse_added) >= orientation_threshold)? datum.sequence : 'Other sequences'"
        },
218
219
        {
          "type": "filter",
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
          "test": "show_other || datum.sequence != 'Other sequences'"
        },
        {
          "type": "aggregate",
          "groupby": ["marker", "sequence"],
          "summarize": [
            {"field": "forward",        "ops": ["sum"], "as": ["forward"]},
            {"field": "reverse",        "ops": ["sum"], "as": ["reverse"]},
            {"field": "total",          "ops": ["sum"], "as": ["total"]},
            {"field": "forward_noise",  "ops": ["sum"], "as": ["forward_noise"]},
            {"field": "reverse_noise",  "ops": ["sum"], "as": ["reverse_noise"]},
            {"field": "total_noise",    "ops": ["sum"], "as": ["total_noise"]},
            {"field": "forward_add",    "ops": ["sum"], "as": ["forward_add"]},
            {"field": "reverse_add",    "ops": ["sum"], "as": ["reverse_add"]},
            {"field": "total_add",      "ops": ["sum"], "as": ["total_add"]},
            {"field": "forward_corr",   "ops": ["sum"], "as": ["forward_corr"]},
            {"field": "reverse_corr",   "ops": ["sum"], "as": ["reverse_corr"]},
            {"field": "total_corr",     "ops": ["sum"], "as": ["total_corr"]},
            {"field": "forward_added",  "ops": ["sum"], "as": ["forward_added"]},
            {"field": "reverse_added",  "ops": ["sum"], "as": ["reverse_added"]},
            {"field": "total_added",    "ops": ["sum"], "as": ["total_added"]}
          ]
        },
        {
          "type": "formula",
          "field": "shared",
          "expr": "max(0, datum.total_corr)"
        },
        {
          "type": "formula",
          "field": "corr_shared",
          "expr": "min(datum.total, datum.total_added)"
        },
        {
          "type": "formula",
          "field": "corr_decreased",
          "expr": "max(datum.total, datum.corr_shared)"
        },
        {
          "type": "formula",
          "field": "forwardpct",
          "expr": "datum.total_added? (100.0 / datum.total_added * datum.forward_added) : 50"
        },
        {
          "type": "formula",
          "field": "minimum",
          "expr": "min(0, datum.total_corr)"
        },
        {
          "type": "formula",
          "field": "xlow",
          "expr": "datum.minimum*1.05"
        },
        {
          "type": "formula",
          "field": "maximum",
          "expr": "max(datum.total, datum.total_added)"
        },
        {
          "type": "formula",
          "field": "xhigh",
          "expr": "datum.maximum*1.05"
        },
        {
          "type": "formula",
          "field": "biasmark",
          "expr": "50-abs(datum.forwardpct-50) < bias_threshold? '\u2605' : ''"
        },
        {
          "type": "formula",
          "field": "markersequence",
          "expr": "datum.marker + '\t' + datum.sequence"
        },
        {
          "type": "lookup",
          "on": "annotated",
          "onKey": "markersequence",
          "keys": ["markersequence"],
          "as": ["thedatum"]
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
299
        },
jhoogenboom's avatar
jhoogenboom committed
300
301
        {
          "type": "sort",
302
          "by": ["marker", "-total_added", "-total_corr", "-total", "sequence"]
jhoogenboom's avatar
jhoogenboom committed
303
304
305
306
        }
      ]
    },
    {
307
      "name": "barcounts",
jhoogenboom's avatar
jhoogenboom committed
308
309
310
311
      "source": "table",
      "transform": [
        {
          "type": "aggregate",
312
          "groupby": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
313
314
315
316
317
          "summarize": {"*": "count"}
        }
      ]
    },
    {
318
319
      "name": "subgraphpadding",
      "source": "barcounts",
jhoogenboom's avatar
jhoogenboom committed
320
321
322
      "transform": [
        {
          "type": "cross",
323
          "diagonal": false,
324
          "filter": "datum.b.marker < datum.a.marker"
jhoogenboom's avatar
jhoogenboom committed
325
326
327
        },
        {
          "type": "formula",
328
329
          "field": "marker",
          "expr": "datum.a.marker"
jhoogenboom's avatar
jhoogenboom committed
330
331
332
        },
        {
          "type": "aggregate",
333
          "groupby": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
334
          "summarize": [{"field": "*", "ops": ["count"], "as": ["cumulpadding"]}]
jhoogenboom's avatar
jhoogenboom committed
335
336
337
338
        }
      ]
    },
    {
339
340
      "name": "subgraphoffsets",
      "source": "barcounts",
jhoogenboom's avatar
jhoogenboom committed
341
342
343
      "transform": [
        {
          "type": "cross",
344
345
          "with": "table",
          "diagonal": false,
346
          "filter": "datum.b.marker < datum.a.marker"
jhoogenboom's avatar
jhoogenboom committed
347
348
349
        },
        {
          "type": "formula",
350
351
          "field": "marker",
          "expr": "datum.a.marker"
jhoogenboom's avatar
jhoogenboom committed
352
353
354
        },
        {
          "type": "aggregate",
355
          "groupby": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
356
          "summarize": [{"field": "*", "ops": ["count"], "as": ["cumulcount"]}]
jhoogenboom's avatar
jhoogenboom committed
357
358
359
360
361
        }
      ]
    },
    {
      "name": "yscale",
362
      "source": "barcounts",
jhoogenboom's avatar
jhoogenboom committed
363
364
      "transform": [
        {
jhoogenboom's avatar
jhoogenboom committed
365
          "type": "lookup",
366
          "on": "subgraphpadding",
367
368
          "onKey": "marker",
          "keys": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
369
          "as": ["paddingobj"],
jhoogenboom's avatar
jhoogenboom committed
370
371
372
          "default": {"cumulpadding": 0}
        },
        {
jhoogenboom's avatar
jhoogenboom committed
373
          "type": "lookup",
374
          "on": "subgraphoffsets",
375
376
          "onKey": "marker",
          "keys": ["marker"],
jhoogenboom's avatar
jhoogenboom committed
377
          "as": ["offsetobj"],
jhoogenboom's avatar
jhoogenboom committed
378
379
380
381
382
          "default": {"cumulcount": 0}
        },
        {
          "type": "formula",
          "field": "offset",
383
          "expr": "barwidth*datum.offsetobj.cumulcount + subgraphoffset*datum.paddingobj.cumulpadding"
jhoogenboom's avatar
jhoogenboom committed
384
385
386
387
        },
        {
          "type": "formula",
          "field": "end",
388
          "expr": "datum.offset + barwidth*datum.count"
jhoogenboom's avatar
jhoogenboom committed
389
390
        }
      ]
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
391
392
393
394
395
396
397
    },
    {
      "name": "selectedAlleles",
      "modify": [
        {
          "type": "toggle",
          "signal": "clickedAllele",
398
          "field": "sequence"
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
399
400
401
402
403
        }
      ],
      "transform": [
        {
          "type": "filter",
404
          "test": "datum.sequence"
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
405
406
407
408
409
410
411
412
        }
      ]
    }
  ],
  "predicates": [
    {
      "name": "isSelected",
      "type": "in",
413
      "item": {"arg": "sequence"},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
414
      "data": "selectedAlleles",
415
      "field": "sequence"
jhoogenboom's avatar
jhoogenboom committed
416
417
418
    }
  ],
  "scales": [
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
419
420
421
422
    {
      "name": "b",
      "type": "ordinal",
      "range": ["black", "red"],
423
      "domain": ["", "\u2605"]
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
424
    },
jhoogenboom's avatar
jhoogenboom committed
425
426
427
428
    {
      "name": "c",
      "type": "ordinal",
      "range": ["#5e3c99", "#b2abd2", "#fdb863", "#e66101"],
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
429
430
431
432
433
434
      "domain": ["Genuine reads", "Noise reads", "Noise/recovered overlap", "Recovered reads"]
    },
    {
      "name": "d",
      "type": "ordinal",
      "range": ["transparent"],
435
      "domain": ["\u2014 Strand balance"]
jhoogenboom's avatar
jhoogenboom committed
436
437
438
439
440
441
442
443
444
    }
  ],
  "marks": [
    {
      "type": "text",
      "from": {
        "data": "yscale"
      },
      "properties": {
445
        "update": {
jhoogenboom's avatar
jhoogenboom committed
446
447
448
          "x": {"field": {"group": "width"}, "mult": 0.5},
          "y": {"field": "offset"},
          "fontWeight": {"value": "bold"},
449
          "text": {"field": "marker"},
jhoogenboom's avatar
jhoogenboom committed
450
451
452
453
454
455
456
457
458
459
460
461
462
          "align": {"value": "center"},
          "baseline": {"value": "bottom"},
          "fill": {"value": "black"}
        }
      }
    },
    {
      "type": "group",
      "from": {
        "data": "table",
        "transform": [
          {
            "type": "facet",
463
            "groupby": ["marker"]
jhoogenboom's avatar
jhoogenboom committed
464
465
          },
          {
jhoogenboom's avatar
jhoogenboom committed
466
467
            "type": "lookup",
            "on": "yscale",
468
469
            "onKey": "marker",
            "keys": ["marker"],
470
            "as": ["subgraphscale"]
jhoogenboom's avatar
jhoogenboom committed
471
472
473
474
          }
        ]
      },
      "properties": {
475
        "update": {
jhoogenboom's avatar
jhoogenboom committed
476
477
          "x": {"value": 0},
          "width": {"field": {"group": "width"}},
478
479
          "y": {"field": "subgraphscale.offset"},
          "y2": {"field": "subgraphscale.end"},
jhoogenboom's avatar
jhoogenboom committed
480
481
482
483
484
485
          "stroke": {"value": "#dddddd"}
        }
      },
      "scales": [
        {
          "name": "x",
486
          "type": "linear",
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
487
          "nice": true,
jhoogenboom's avatar
jhoogenboom committed
488
          "range": "width",
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
489
          "domain": {"field": ["xlow", "xhigh"]}
jhoogenboom's avatar
jhoogenboom committed
490
491
492
493
494
        },
        {
          "name": "y",
          "type": "ordinal",
          "range": "height",
495
          "domain": {"field": "sequence"}
jhoogenboom's avatar
jhoogenboom committed
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
        }
      ],
      "axes": [
        {
          "type": "x",
          "scale": "x",
          "grid": true,
          "layer": "back",
          "title": "Number of reads",
          "properties": {
            "labels": {
              "align": {"value": "right"},
              "baseline": {"value": "middle"},
              "dy": {"value": 3},
              "angle": {"value": -25}
            }
          }
        },
        {
          "type": "y",
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
516
517
518
519
520
521
          "scale": "y",
          "properties": {
            "labels": {
              "fill": {"value": "transparent"}
            }
          }
jhoogenboom's avatar
jhoogenboom committed
522
523
524
525
526
527
528
529
530
531
532
533
        }
      ],
      "legends": [
        {
          "fill": "c",
          "properties": {
            "symbols": {
              "size": {"value": 100},
              "stroke": {"value": "transparent"},
              "fillOpacity": {"value": 0.8}
            }
          }
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
534
535
536
537
538
539
540
541
542
543
544
        },
        {
          "fill": "d",
          "properties": {
            "symbols": {
              "stroke": {"value": "transparent"}
            },
            "labels": {
              "x": {"value": 2}
            }
          }
jhoogenboom's avatar
jhoogenboom committed
545
546
547
548
549
550
        }
      ],
      "marks": [
        {
          "type": "rect",
          "properties": {
551
            "update": {
jhoogenboom's avatar
jhoogenboom committed
552
553
              "x": {"scale": "x", "value": 0},
              "x2": {"scale": "x", "field": "shared"},
554
              "y": {"scale": "y", "field": "sequence", "offset": 1},
jhoogenboom's avatar
jhoogenboom committed
555
              "height": {"scale": "y", "band": true, "offset": -2},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
556
              "fill": {"scale": "c", "value": "Genuine reads"},
jhoogenboom's avatar
jhoogenboom committed
557
558
559
560
561
562
563
              "fillOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
564
            "update": {
jhoogenboom's avatar
jhoogenboom committed
565
566
              "x": {"scale": "x", "field": "corr_shared"},
              "x2": {"scale": "x", "field": "corr_decreased"},
567
              "y": {"scale": "y", "field": "sequence", "offset": 1},
jhoogenboom's avatar
jhoogenboom committed
568
              "height": {"scale": "y", "band": true, "offset": -2},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
569
              "fill": {"scale": "c", "value": "Noise reads"},
jhoogenboom's avatar
jhoogenboom committed
570
571
572
573
574
575
576
              "fillOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
577
            "update": {
jhoogenboom's avatar
jhoogenboom committed
578
579
              "x": {"scale": "x", "field": "total_corr"},
              "x2": {"scale": "x", "field": "corr_shared"},
580
              "y": {"scale": "y", "field": "sequence", "offset": 1},
jhoogenboom's avatar
jhoogenboom committed
581
              "height": {"scale": "y", "band": true, "offset": -2},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
582
              "fill": {"scale": "c", "value": "Noise/recovered overlap"},
jhoogenboom's avatar
jhoogenboom committed
583
584
585
586
587
588
589
              "fillOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
590
            "update": {
jhoogenboom's avatar
jhoogenboom committed
591
              "x": {"scale": "x", "field": "corr_shared"},
592
              "x2": {"scale": "x", "field": "total_added"},
593
              "y": {"scale": "y", "field": "sequence", "offset": 1},
jhoogenboom's avatar
jhoogenboom committed
594
              "height": {"scale": "y", "band": true, "offset": -2},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
595
              "fill": {"scale": "c", "value": "Recovered reads"},
jhoogenboom's avatar
jhoogenboom committed
596
597
598
599
600
601
602
              "fillOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "group",
          "from": {
603
            "transform": [{"type": "facet", "groupby": ["sequence"]}]
jhoogenboom's avatar
jhoogenboom committed
604
605
          },
          "properties": {
606
            "update": {
jhoogenboom's avatar
jhoogenboom committed
607
608
609
610
611
612
613
614
615
616
617
              "x": {"value": 0},
              "width": {"field": {"group": "width"}},
              "y": {"scale": "y", "field": "key", "offset": 1},
              "height": {"scale": "y", "band": true, "offset": -2}
            }
          },
          "scales": [
            {
              "name": "balance",
              "range": "height",
              "nice": false,
618
              "clamp": true,
jhoogenboom's avatar
jhoogenboom committed
619
620
621
622
623
              "domain": [0, 100]
            }
          ],
          "marks": [
            {
624
              "type": "rule",
jhoogenboom's avatar
jhoogenboom committed
625
              "properties": {
626
                "update": {
627
                  "x": {"scale": "x", "field": "minimum"},
628
629
630
631
                  "x2": {"scale": "x", "field": "total_added"},
                  "y": {"scale": "balance", "field": "forwardpct"},
                  "stroke": {"scale": "b", "field": "biasmark"},
                  "strokeWidth": {"value": 1}
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
632
633
634
635
636
637
                }
              }
            },
            {
              "type": "text",
              "properties": {
638
                "update": {
639
                  "x": {"scale": "x", "field": "maximum", "offset": 5},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
640
641
642
643
644
645
646
647
648
649
                  "y": {"scale": "balance", "value": 50},
                  "baseline": {"value": "middle"},
                  "fill": {"scale": "b", "field": "biasmark"},
                  "text": {"field": "biasmark"}
                }
              }
            },
            {
              "type": "text",
              "properties": {
650
                "update": {
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
651
652
653
654
                  "x": {"value": -10},
                  "y": {"scale": "balance", "value": 50},
                  "baseline": {"value": "middle"},
                  "align": {"value": "right"},
655
                  "text": {"field": "sequence"},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
656
657
658
659
660
                  "fill": {
                    "rule": [
                      {
                        "predicate": {
                          "name": "isSelected",
661
                          "sequence": {"field": "thedatum"}
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
662
663
664
                        },
                        "value": "green"
                      },
665
                      {"value": "#aaaaaa"}
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
666
667
668
669
670
671
672
                    ]
                  },
                  "fontStyle": {
                    "rule": [
                      {
                        "predicate": {
                          "name": "isSelected",
673
                          "sequence": {"field": "thedatum"}
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
674
                        },
675
                        "value": "normal"
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
676
                      },
677
                      {"value": "italic"}
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
678
679
                    ]
                  }
jhoogenboom's avatar
jhoogenboom committed
680
681
682
683
                }
              }
            }
          ]
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
684
685
686
687
688
        },
        {
          "name": "alleleSelector",
          "type": "rect",
          "properties": {
689
            "update": {
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
690
691
              "x": {"value": 0},
              "width": {"field": {"group": "width"}},
692
              "y": {"scale": "y", "field": "sequence"},
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
693
694
695
696
              "height": {"scale": "y", "band": true},
              "fill": {"value": "transparent"}
            }
          }
jhoogenboom's avatar
jhoogenboom committed
697
698
699
700
        }
      ]
    }
  ]
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
701
}