ValueScale
Auto-generated from the config schema in the source — see the config guide for concepts. Built into JBrowse core. View source.
Example usage
A log axis floored at 1:
{
type: 'LinearWiggleDisplay',
scales: { y: { type: 'log', domainMin: 1 } },
}A GC line plot whose axis spans the loaded values, 30 to 60%:
{
type: 'LinearWiggleDisplay',
scales: { y: { zero: false } },
}The whole visible range, spikes included, rather than the fence the wiggle displays start on:
{
type: 'LinearWiggleDisplay',
scales: { y: { domainQuantile: 1 } },
}Three samples' coverage on one axis that still follows the data, each track's display naming the same group:
{
type: 'LinearAlignmentsDisplay',
scales: { y: { autoscaleGroup: 'depth' } },
}A titled axis with a labelled genome-wide threshold over a plain suggestive one:
{
type: 'LinearMarkDisplay',
scales: {
y: {
title: '-log10 p',
rules: [{ value: 7.3, color: 'red', label: 'p = 5e-8' }, 5],
},
},
}The value scale of a quantitative display, written as scales.y: the
wiggle plot, the alignments coverage band and the mark display, the
Manhattan plot among them, each carry one, with the axis guides it draws —
its ticks, its grid, its rules and its title.
Vega-Lite's spelling: a pinned end is domainMin or domainMax, an end
left unset autoscales over the loaded regions, and zero says whether an
autoscaled linear or symlog axis reaches 0 whatever those regions hold.
Two defaults come from the display rather than from the scale.
domainQuantile starts at 0.99 on the wiggle plot, fencing a spike, and
at 1, the extremes, on the coverage band and the mark display. symlogConstant starts at 0 on the wiggle family and the mark
display and at 1 on the coverage band.
Every scale carries the same guides: rules, reference lines at chosen
values, grid, a line at every tick, minimalTicks, and title, the
caption beside the axis. A rule naming no color draws in the one color
the chrome rules every plot in, so a red line is a claim its author makes
rather than a meaning a display assigns.
Config slots
Slot types (fileLocation, frozen, ...) are explained in the config slot types reference. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
scales.y.rules.valuenumber = 0 | The rule's position on the axis, in the units the axis plots: a -log10(p) over a Manhattan plot, a depth over coverage. |
scales.y.rules.colormaybeColor | The line's color, and its label's. Unset draws every rule in the one color the chrome rules plots in, so a threshold that means something particular — genome-wide significance, a diploid depth — is one an author paints, on the plot where it means it. |
scales.y.rules.labelstring = '' | Free text drawn at the rule's right-hand end. JBrowse assigns it no meaning: "2 copies" over a coverage plot is a claim only the author can make, since no ploidy can be assumed. |
scales.y.typestringEnum (linear, log, symlog) = 'linear' | The axis's scale type, which sets the ticks, the cross-hatches and the renderer's placement. log cannot represent 0 or negative values and floors the domain above them; symlog is log-like away from zero and linear through it, so a track whose values touch or cross 0 keeps them. |
scales.y.domainMinmaybeNumber | The bottom of the axis, pinning what would otherwise autoscale to the loaded regions. Unset autoscales that end. The Y axis panel's Min field writes here. |
scales.y.domainMaxmaybeNumber | The top of the axis. Unset autoscales that end. |
scales.y.zeroboolean = true | Whether an autoscaled linear or symlog axis reaches 0 whatever the loaded values span, Vega-Lite's zero. On, a plot of values between 30 and 60 draws 0 to 60, and a bar always shows its whole height. Off, the axis spans the values alone. A pinned end is unmoved either way, a log axis has no 0, and a density plot, which maps score to color and has no axis, spans its values whatever this says. The Y axis panel's "Include 0" toggles it. |
scales.y.autoscaleGroupmaybeString | A name shared by the tracks whose axes autoscale together: each unpinned end spans the data of every track in the view naming the same group, so three coverage lanes stay comparable as the view moves. A pinned end stays this track's own. The Y axis panel's "Share axis with" writes it. |
scales.y.symlogConstantnumber = per display | Width of symlog's linear region around zero. 0 derives it from the domain, a thousandth of its largest magnitude — right for a wiggle track, whose units are its own. The coverage band starts at 1 instead, which makes symlog exactly log(depth+1) and puts the knee at one read.advanced |
scales.y.domainQuantilenumber = per display | The fence for an unpinned end's outliers. An end follows the loaded values' extreme; below 1, an extreme that would stretch the axis past twice the span this quantile of the values draws stops at that fence, and the bars past it wear the red clip strip. So 0.99 leaves a plot with no spike whole and keeps one spike from flattening the rest. Each end's quantile is measured among the values on its side of 0, so a sparse minority tail stays visible, and the span includes 0 where zero reaches it. A color ramp's domainQuantile clips at the quantile itself, since a saturated color hides nothing its key does not say. The Y axis panel's "Clip extreme outliers" toggles it. |
scales.y.gridboolean = false | Rule the plot across at every tick, ggplot2's panel grid and Vega-Lite's axis.grid. The Y axis panel's "Grid lines" toggles it. |
scales.y.minimalTicksboolean = false | Label only the two ends of the axis. advanced |
scales.y.titlemaybeString | The caption beside the axis, naming what it measures, drawn once however many bands the scale rules and at every zoom. Optional, as JBrowse's other captions are: unset, "" or null, the axis has none; some text is that text. |
scales.y.rulestypes.array(valueScaleRuleSchema()) | Horizontal reference lines at chosen values, across every band the scale rules: a significance threshold, a zero line, an allele-frequency cut. Each is { value, color, label }, or a bare number for a plain line. An autoscaled end widens to keep every rule on the axis; a pinned domainMin or domainMax that excludes a rule drops it. |
Related links
- Tutorial: A selected haplotype (Dog10K)
- Tutorial: CNV across a population (1000 Genomes)
- User guide: Quantitative track
- Config guide: Hi-C track
- Config guide: Mark display
- Config guide: Quantitative track
- Developer guide: Upgrading to v5
- Docs: URL query parameter API