{
  "fdstools_visversion": "2.3.0",
  "width": 600,
  "height": 10,
  "signals": [
    {
      "name": "amplitude_threshold",
      "init": 5
    },
    {
      "name": "amplitude_pct_threshold",
      "init": 0.5
    },
    {
      "name": "amplitude_markerpct_threshold",
      "init": 0
    },
    {
      "name": "orientation_threshold",
      "init": 0
    },
    {
      "name": "allele_amplitude_threshold",
      "init": 30
    },
    {
      "name": "allele_amplitude_pct_threshold",
      "init": 2
    },
    {
      "name": "allele_amplitude_markerpct_threshold",
      "init": 1.5
    },
    {
      "name": "allele_correction_threshold",
      "init": 0
    },
    {
      "name": "allele_recovery_threshold",
      "init": 0
    },
    {
      "name": "allele_orientation_threshold",
      "init": 0
    },
    {
      "name": "show_negative",
      "init": true
    },
    {
      "name": "filter_uncorrected",
      "init": true
    },
    {
      "name": "show_other",
      "init": true
    },
    {
      "name": "sort_str_by_length",
      "init": true
    },
    {
      "name": "bias_threshold",
      "init": 0
    },
    {
      "name": "filter_marker",
      "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, ')|(?:') + ')')"
    },
    {
      "name": "barwidth",
      "init": 15
    },
    {
      "name": "subgraphoffset",
      "init": 70
    },
    {
      "name": "max_seq_len",
      "init": 70
    },
    {
      "name": "clickedAllele",
      "verbose": true,
      "streams": [
        {
          "type": "@alleleSelector:click[datum.thedatum]",
          "expr": "datum.thedatum"
        }
      ]
    },
    {
      "name": "hovered",
      "init": false,
      "streams": [
        {"type": "@alleleSelector:mouseover[datum.thedatum]", "expr": "datum.thedatum"},
        {"type": "@alleleSelector:mouseout[datum.thedatum]", "expr": "false"}
      ]
    }
  ],
  "data": [
    {
      "name": "raw",
      "values": "sample_data_file_contents_here",
      "format": {
        "type": "tsv",
        "parse": {
          "forward": "number",
          "forward_noise": "number",
          "forward_add": "number",
          "reverse": "number",
          "reverse_noise": "number",
          "reverse_add": "number",
          "total": "number",
          "total_noise": "number",
          "total_add": "number"
        }
      },
      "transform": [
        {
          "type": "filter",
          "test": "test(marker_regex, datum.marker)"
        },
        {
          "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"
        },
        {
          "type": "formula",
          "field": "total_corr",
          "expr": "datum.total_noise? datum.total-datum.total_noise : datum.total"
        },
        {
          "type": "formula",
          "field": "forward_added",
          "expr": "datum.forward_add? datum.forward_corr+datum.forward_add : datum.forward_corr"
        },
        {
          "type": "formula",
          "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"
        }
      ]
    },
    {
      "name": "dummy1",
      "source": "raw"
    },
    {
      "name": "dummy2",
      "source": "raw"
    },
    {
      "name": "dummy3",
      "source": "raw"
    },
    {
      "name": "dummy4",
      "source": "raw"
    },
    {
      "name": "aggrm",
      "source": "raw",
      "transform": [
        {
          "type": "filter",
          "test": "datum.sequence != 'Other sequences'"
        },
        {
          "type": "aggregate",
          "groupby": ["marker"],
          "summarize": {"total_added": ["max"], "total": ["max"]}
        }
      ]
    },
    {
      "name": "dummy5",
      "source": "raw"
    },
    {
      "name": "aggrs",
      "source": "raw",
      "transform": [
        {
          "type": "aggregate",
          "groupby": ["marker"],
          "summarize": {"total_added": ["sum"], "total": ["sum"]}
        }
      ]
    },
    {
      "name": "preannotated",
      "source": "raw",
      "transform": [
        {
          "type": "lookup",
          "on": "aggrm",
          "onKey": "marker",
          "keys": ["marker"],
          "as": ["aggrm"],
          "default": {"max_total_added": 0}
        },
        {
          "type": "lookup",
          "on": "aggrs",
          "onKey": "marker",
          "keys": ["marker"],
          "as": ["aggrs"],
          "default": {"sum_total_added": 0}
        },
        {
          "type": "formula",
          "field": "pct_of_max",
          "expr": "datum.aggrm.max_total_added? (datum.total_added / datum.aggrm.max_total_added * 100) : 100"
        },
        {
          "type": "formula",
          "field": "pct_of_sum",
          "expr": "datum.aggrs.sum_total_added? (datum.total_added / datum.aggrs.sum_total_added * 100) : 100"
        },
        {
          "type": "formula",
          "field": "pct_of_max_uncorrected",
          "expr": "datum.aggrm.max_total? (datum.total / datum.aggrm.max_total * 100) : 100"
        },
        {
          "type": "formula",
          "field": "pct_of_sum_uncorrected",
          "expr": "datum.aggrs.sum_total? (datum.total / datum.aggrs.sum_total * 100) : 100"
        },
        {
          "type": "formula",
          "field": "strlength",
          "expr": "test(/^CE\\d+\\.?\\d*_/, datum.sequence)? parseFloat(substring(datum.sequence, 2, indexof(datum.sequence, '_'))) : 1/0"
        },
        {
          "type": "formula",
          "field": "seq_order",
          "expr": "sort_str_by_length? datum.strlength : 1/0"
        },
        {
          "type": "sort",
          "by": ["marker", "seq_order", "-total_added", "-total_corr", "-total", "sequence"]
        },
        {
          "type": "rank"
        },
        {
          "type": "formula",
          "field": "markersequence",
          "expr": "datum.marker + '\t' + datum.sequence"
        }
      ]
    },
    {
      "name": "annotated",
      "source": "preannotated",
      "transform": [
        {
          "type": "filter",
          "test": "datum.sequence != 'Other sequences'"
        },
        {
          "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": "forwardpct",
          "expr": "datum.forward_corrected? (datum.total_added? (datum.forward_added / datum.total_added * 100) : 50) : (datum.forward / datum.total * 100)"
        },
        {
          "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": "thedatum",
          "expr": "datum"
        }
      ]
    },
    {
      "name": "table",
      "source": "preannotated",
      "transform": [
        {
          "type": "formula",
          "field": "sequence",
          "expr": "((show_negative? abs(filter_uncorrected? datum.total : datum.total_added) : filter_uncorrected? datum.total : datum.total_added) >= amplitude_threshold && (show_negative? abs(filter_uncorrected? datum.pct_of_max_uncorrected : datum.pct_of_max) : filter_uncorrected? datum.pct_of_max_uncorrected : datum.pct_of_max) >= amplitude_pct_threshold && (show_negative? abs(filter_uncorrected? datum.pct_of_sum_uncorrected : datum.pct_of_sum) : filter_uncorrected? datum.pct_of_sum_uncorrected : datum.pct_of_sum) >= amplitude_markerpct_threshold && min(show_negative? abs(filter_uncorrected? datum.forward : datum.forward_added) : filter_uncorrected? datum.forward : datum.forward_added, show_negative? abs(filter_uncorrected? datum.reverse : datum.reverse_added) : filter_uncorrected? datum.reverse : datum.reverse_added) >= orientation_threshold)? datum.sequence : 'Other sequences'"
        },
        {
          "type": "filter",
          "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"]},
            {"field": "rank",           "ops": ["min"], "as": ["rank"]}
          ]
        },
        {
          "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": "forwardpct",
          "expr": "datum.forward_corrected? (datum.total_added? (datum.forward_added / datum.total_added * 100) : 50) : (datum.forward / datum.total * 100)"
        },
        {
          "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"]
        },
        {
          "type": "formula",
          "field": "rank",
          "expr": "datum.sequence == 'Other sequences'? 1/0 : datum.rank"
        },
        {
          "type": "formula",
          "field": "sequence_disp",
          "expr": "length(datum.sequence) > max_seq_len+1? substring(datum.sequence, 0, max_seq_len) + '\u2026' : datum.sequence"
        }
      ]
    },
    {
      "name": "yscale",
      "source": "table",
      "transform": [
        {
          "type": "aggregate",
          "groupby": ["marker", "sequence"],
          "summarize": []
        },
        {
          "type": "rank"
        },
        {
          "type": "aggregate",
          "groupby": ["marker"],
          "summarize": [
            {"field": "sequence", "ops": ["count"], "as": ["count"]},
            {"field": "rank", "ops": ["min"], "as": ["cumulcount"]}
          ]
        },
        {
          "type": "rank"
        },
        {
          "type": "formula",
          "field": "offset",
          "expr": "barwidth*(datum.cumulcount-1) + subgraphoffset*(datum.rank-1)"
        },
        {
          "type": "formula",
          "field": "end",
          "expr": "datum.offset + barwidth*datum.count"
        }
      ]
    },
    {
      "name": "selectedAlleles",
      "source": "annotated",
      "transform": [
        {
          "type": "filter",
          "test": "datum.total_added >= allele_amplitude_threshold && datum.pct_of_max >= allele_amplitude_pct_threshold && datum.pct_of_sum >= allele_amplitude_markerpct_threshold && ((datum.total_added/datum.total*100-100) >= allele_correction_threshold || (datum.total_add/datum.total_added*100) >= allele_recovery_threshold) && min(datum.forward_added, datum.reverse_added) >= allele_orientation_threshold"
        }
      ],
      "modify": [
        {
          "type": "toggle",
          "signal": "clickedAllele",
          "field": "thedatum"
        }
      ]
    }
  ],
  "scales": [
    {
      "name": "b",
      "type": "ordinal",
      "range": ["black", "red"],
      "domain": ["", "\u2605"]
    },
    {
      "name": "c",
      "type": "ordinal",
      "range": ["#5e3c99", "#b2abd2", "#fdb863", "#e66101"],
      "domain": ["Genuine reads", "Noise reads", "Noise/recovered overlap", "Recovered reads"]
    },
    {
      "name": "d",
      "type": "ordinal",
      "range": ["black", "red"]
    },
    {
      "name": "e",
      "type": "ordinal",
      "range": ["M-0.5,0L0.5,0", "M-0.5,0L-0.115385,0M0.115385,0L0.5,0"]
    }
  ],
  "marks": [
    {
      "type": "text",
      "from": {
        "data": "yscale"
      },
      "properties": {
        "update": {
          "x": {"field": {"group": "width"}, "mult": 0.5},
          "y": {"field": "offset"},
          "fontWeight": {"value": "bold"},
          "text": {"field": "marker"},
          "align": {"value": "center"},
          "baseline": {"value": "bottom"},
          "fill": {"value": "black"}
        }
      }
    },
    {
      "type": "group",
      "from": {
        "data": "table",
        "transform": [
          {
            "type": "facet",
            "groupby": ["marker"]
          },
          {
            "type": "lookup",
            "on": "yscale",
            "onKey": "marker",
            "keys": ["marker"],
            "as": ["subgraphscale"]
          }
        ]
      },
      "properties": {
        "update": {
          "x": {"value": 0},
          "width": {"field": {"group": "width"}},
          "y": {"field": "subgraphscale.offset"},
          "y2": {"field": "subgraphscale.end"},
          "stroke": {"value": "#dddddd"}
        }
      },
      "scales": [
        {
          "name": "x",
          "type": "linear",
          "nice": true,
          "range": "width",
          "domain": {"field": ["xlow", "xhigh"]}
        },
        {
          "name": "y",
          "type": "ordinal",
          "range": "height",
          "domain": {"field": "sequence", "sort": {"field": "rank", "op": "min"}}
        }
      ],
      "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",
          "scale": "y",
          "properties": {
            "labels": {
              "fill": {"value": "transparent"},
              "fontSize": {"value": 0}
            }
          }
        }
      ],
      "legends": [
        {
          "fill": "c",
          "properties": {
            "symbols": {
              "size": {"value": 100},
              "stroke": {"value": "transparent"},
              "fillOpacity": {"value": 0.8}
            }
          }
        },
        {
          "stroke": "d",
          "shape": "e",
          "values": ["Strand balance", "Allele threshold"],
          "properties": {
            "symbols": {
              "size": {"value": 100}
            }
          }
        }
      ],
      "marks": [
        {
          "type": "rect",
          "properties": {
            "update": {
              "x": [
                {"test": "datum.thedatum", "scale": "x", "value": 0},
                {"scale": "x", "value": 0, "offset": 0.5}
              ],
              "x2": [
                {"test": "datum.thedatum", "scale": "x", "field": "shared"},
                {"scale": "x", "field": "shared", "offset": -0.5}
              ],
              "y": [
                {"test": "datum.thedatum", "scale": "y", "field": "sequence", "offset": 1},
                {"scale": "y", "field": "sequence", "offset": 1.5}
              ],
              "height": [
                {"test": "datum.thedatum", "scale": "y", "band": true, "offset": -2},
                {"scale": "y", "band": true, "offset": -3}
              ],
              "fill": [
                {"test": "datum.thedatum", "scale": "c", "value": "Genuine reads"}
              ],
              "stroke": [
                {"test": "!datum.thedatum", "scale": "c", "value": "Genuine reads"}
              ],
              "strokeWidth": [
                {"test": "datum.thedatum || datum.shared == 0", "value": 0},
                {"value": 1}
              ],
              "fillOpacity": {"value": 0.8},
              "strokeOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
            "update": {
              "x": [
                {"test": "datum.thedatum", "scale": "x", "field": "corr_shared"},
                {"scale": "x", "field": "corr_shared", "offset": 0.5}
              ],
              "x2": [
                {"test": "datum.thedatum", "scale": "x", "field": "total"},
                {"scale": "x", "field": "total", "offset": -0.5}
              ],
              "y": [
                {"test": "datum.thedatum", "scale": "y", "field": "sequence", "offset": 1},
                {"scale": "y", "field": "sequence", "offset": 1.5}
              ],
              "height": [
                {"test": "datum.thedatum", "scale": "y", "band": true, "offset": -2},
                {"scale": "y", "band": true, "offset": -3}
              ],
              "fill": [
                {"test": "datum.thedatum", "scale": "c", "value": "Noise reads"}
              ],
              "stroke": [
                {"test": "!datum.thedatum", "scale": "c", "value": "Noise reads"}
              ],
              "strokeWidth": [
                {"test": "datum.thedatum || datum.corr_shared == datum.total", "value": 0},
                {"value": 1}
              ],
              "fillOpacity": {"value": 0.8},
              "strokeOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
            "update": {
              "x": [
                {"test": "datum.thedatum", "scale": "x", "field": "total_corr"},
                {"scale": "x", "field": "total_corr", "offset": 0.5}
              ],
              "x2": [
                {"test": "datum.thedatum", "scale": "x", "field": "corr_shared"},
                {"scale": "x", "field": "corr_shared", "offset": -0.5}
              ],
              "y": [
                {"test": "datum.thedatum", "scale": "y", "field": "sequence", "offset": 1},
                {"scale": "y", "field": "sequence", "offset": 1.5}
              ],
              "height": [
                {"test": "datum.thedatum", "scale": "y", "band": true, "offset": -2},
                {"scale": "y", "band": true, "offset": -3}
              ],
              "fill": [
                {"test": "datum.thedatum", "scale": "c", "value": "Noise/recovered overlap"}
              ],
              "stroke": [
                {"test": "!datum.thedatum", "scale": "c", "value": "Noise/recovered overlap"}
              ],
              "strokeWidth": [
                {"test": "datum.thedatum || datum.total_corr == datum.corr_shared", "value": 0},
                {"value": 1}
              ],
              "fillOpacity": {"value": 0.8},
              "strokeOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "rect",
          "properties": {
            "update": {
              "x": [
                {"test": "datum.thedatum", "scale": "x", "field": "corr_shared"},
                {"scale": "x", "field": "corr_shared", "offset": 0.5}
              ],
              "x2": [
                {"test": "datum.thedatum", "scale": "x", "field": "total_added"},
                {"scale": "x", "field": "total_added", "offset": -0.5}
              ],
              "y": [
                {"test": "datum.thedatum", "scale": "y", "field": "sequence", "offset": 1},
                {"scale": "y", "field": "sequence", "offset": 1.5}
              ],
              "height": [
                {"test": "datum.thedatum", "scale": "y", "band": true, "offset": -2},
                {"scale": "y", "band": true, "offset": -3}
              ],
              "fill": [
                {"test": "datum.thedatum", "scale": "c", "value": "Recovered reads"}
              ],
              "stroke": [
                {"test": "!datum.thedatum", "scale": "c", "value": "Recovered reads"}
              ],
              "strokeWidth": [
                {"test": "datum.thedatum || datum.corr_shared == datum.total_added", "value": 0},
                {"value": 1}
              ],
              "fillOpacity": {"value": 0.8},
              "strokeOpacity": {"value": 0.8}
            }
          }
        },
        {
          "type": "group",
          "from": {
            "transform": [{"type": "facet", "groupby": ["sequence"]}]
          },
          "properties": {
            "update": {
              "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,
              "clamp": true,
              "domain": [0, 100]
            }
          ],
          "marks": [
            {
              "type": "rule",
              "properties": {
                "update": {
                  "x": {"scale": "x", "field": "minimum"},
                  "x2": {"scale": "x", "field": "total_added"},
                  "y": {"scale": "balance", "field": "forwardpct"},
                  "stroke": {"scale": "b", "field": "biasmark"},
                  "strokeWidth": {"value": 1}
                }
              }
            },
            {
              "type": "text",
              "properties": {
                "update": {
                  "x": {"scale": "x", "field": "maximum", "offset": 5},
                  "y": {"scale": "balance", "value": 50},
                  "baseline": {"value": "middle"},
                  "fill": {"scale": "b", "field": "biasmark"},
                  "text": {"field": "biasmark"}
                }
              }
            },
            {
              "type": "text",
              "properties": {
                "update": {
                  "x": {"value": -10},
                  "y": {"scale": "balance", "value": 50},
                  "baseline": {"value": "middle"},
                  "align": {"value": "right"},
                  "text": {"field": "sequence_disp"},
                  "fill": [
                    {
                      "test": "datum.thedatum && indata('selectedAlleles', datum.thedatum._id, 'thedatum._id')",
                      "value": "green"
                    },
                    {"value": "#aaaaaa"}
                  ],
                  "fontStyle": [
                    {
                      "test": "datum.thedatum && indata('selectedAlleles', datum.thedatum._id, 'thedatum._id')",
                      "value": "normal"
                    },
                    {"value": "italic"}
                  ]
                }
              }
            }
          ]
        },
        {
          "type": "rule",
          "from": {
            "transform": [
              {
                "type": "aggregate",
                "groupby": ["marker"],
                "summarize": {"xhigh": "max"}
              },
              {
                "type": "lookup",
                "on": "aggrm",
                "onKey": "marker",
                "keys": ["marker"],
                "as": ["aggrm"],
                "default": {"max_total_added": 0}
              },
              {
                "type": "lookup",
                "on": "aggrs",
                "onKey": "marker",
                "keys": ["marker"],
                "as": ["aggrs"],
                "default": {"sum_total_added": 0}
              },
              {
                "type": "formula",
                "field": "threshold",
                "expr": "max(allele_amplitude_threshold, allele_orientation_threshold*2, allele_amplitude_pct_threshold*datum.aggrm.max_total_added/100, allele_amplitude_markerpct_threshold*datum.aggrs.sum_total_added/100)"
              },
              {
                "type": "filter",
                "test": "datum.threshold <= datum.max_xhigh"
              }
            ]
          },
          "properties": {
            "update": {
              "x": {"scale": "x", "field": "threshold"},
              "y": {"value": 0},
              "y2": {"field": {"group": "height"}},
              "stroke": {"value": "red"},
              "strokeOpacity": {"value": 0.5},
              "strokeWidth": {"value": 1},
              "strokeDash": {"value": [5, 3]}
            }
          }
        },
        {
          "name": "alleleSelector",
          "type": "rect",
          "properties": {
            "update": {
              "x": {"value": 0},
              "width": {"field": {"group": "width"}},
              "y": {"scale": "y", "field": "sequence"},
              "height": {"scale": "y", "band": true},
              "fill": {"value": "transparent"},
              "cursor": [
                {"test": "datum.thedatum", "value": "pointer"}
              ]
            }
          }
        }
      ]
    }
  ]
}