URL query parameter API
JBrowse Web reads its launch state from the URL. Embedded components such as
@jbrowse/react-linear-genome-view2 leave URL handling to the host app.
Query string or hash fragment
- Every parameter works in either place:
?config=…&loc=…or#config=…&loc=…. - A fragment is never sent to the server, so a long value (an
encoded-orjson-session, a whole session spec, a big&sessionTracks=) cannot trip the request-line limit that answers a long query string with HTTP 414. The Share button writes every link as a hash URL, which also keeps a short link's key out of the web server's logs. - If the fragment contains an
=, JBrowse reads its parameters only from there and ignores the query string. A link must therefore put every parameter in the fragment:?config=my.json#session=spec-{…}loads the defaultconfig.json, notmy.json.
Linear genome view (simple)
One linear genome view, from a handful of parameters:
http://host/jbrowse2/?config=test_data/config.json&loc=chr1:6000-7000&assembly=hg19&tracks=gene_track,vcf_track
&assembly=,&loc=,®ions=,&nav=,&tracks=,&tracklist=,&highlight=,&sessionTracks=and&extendSession=apply only to this launch. Every other launch type holds the same settings inside the session it loads.?config=,&sessionName=,&hubURL=,&renderer=and&session=work for any launch type.&password=holds an older&session=share-link's key, and&adminKey=belongs to JBrowse CLI admin server.
?config=
?config=test_data/volvox/config.json
- A path to a config file, relative to the current folder, fetched by the
client. Omitted, JBrowse loads
config.jsonfrom the current folder, which@jbrowse/clisets up. ?config=noneskips the config entirely, for a&hubURL=whose hub supplies the assemblies and tracks.- To change the default without putting
?config=in every link, setwindow.__jbrowseConfigPathin the<head>ofindex.html(Avoiding stale config). An explicit?config=still wins.
&assembly=
&assembly=hg19, the name of an entry in the config's assemblies array.
&loc=
&loc=chr1:6000-7000, navigated to on load. Accepted forms:
&loc=chr1:6000-7000 // using - notation for range
&loc=chr1:6000..7000 // using .. notation for range
&loc=chr1:7000 // centered on this position
&loc=chr1 // the whole of one chromosome
&loc=chr1%206000%207000 // refName, start and end, whitespace separated
&loc=chr1:34M-35M // coordinates abbreviated with a unit suffix
&loc=GENEID // if you have used `jbrowse text-index`- A coordinate takes a
k,MorGsuffix, optionally followed byborbp, and is expanded to whole base pairs on load. - A gene name needs a text index: one built with
jbrowse text-index, or a hub track's ownsearchIndex(track hubs). - Several whitespace-separated locstrings (
%20in a URL) open a discontinuous view showing each region in turn: a gene and its fusion partner, an allele beside the sequences it derives from. The location box displays the same form once a view holds more than one region, so what you copy out of it pastes back into a URL. &loc=and&assembly=start a fresh session, ignoring the config'sdefaultSession;&extendSession=truenavigates that session instead.
®ions=
&assembly=hg38®ions=chr1,chr2,chr3
Restricts the whole-genome overview to this subset of the assembly's
chromosomes, in this order, for dropping unplaced contigs or reordering. Names
resolve through the assembly's aliases and take globs. It
requires &assembly=, is ignored when &loc= is set, and is the simple-URL
form of the spec's displayedRegionNames.
&highlight=
&highlight=chr1:6000-7000, a band over the region on every track, with
&assembly= and &loc=.
- Several regions are space-separated (
%20). - Always pass
&assembly=. A highlight is stored with an assembly name, and every view of that assembly draws it; a saved session keeps them in itshighlightslist, where each entry takesassemblyName. - The highlight list shows them, with links back to each.
- A URL-encoded JSON object in place of a locstring adds
color(used as-is, alpha included) andlabel(shown beside the chip icon):&highlight={"refName":"11","start":32200274,"end":32203877,"color":"rgba(240,128,128,0.3)","label":"R2_intron"}. Locstrings and JSON objects can be mixed in one value. - To box one feature by name and sort it to the top of its track, see
featureHighlights.
&tracklist=
&tracklist=true opens the track selector on load. Default false.
&nav=
&nav=false hides the linear genome view's navigation bar. Default true.
&tracks=
&tracks=gene_track,vcf_track, a comma-separated list of trackIds from the
config. A trackId added by &sessionTracks= can be named here too.
&sessionTracks=
Adds track configs to the session from the URL. A track over a data file needs
no type or adapter, since the extension gives both, but nothing implies its
assembly, so name it
(the shortest track):
&sessionTracks=[{"trackId":"reads","uri":"https://example.com/sample.bam","assemblyNames":["hg38"]}]A track with no data file, such as BLAST hits included inline as a
FromConfigAdapter, takes the full form.
Live link,
whose value pretty-printed is:
[
{
"type": "FeatureTrack",
"trackId": "url_track",
"name": "URL track",
"assemblyNames": ["volvox"],
"adapter": {
"type": "FromConfigAdapter",
"features": [
{
"uniqueId": "one",
"refName": "ctgA",
"start": 100,
"end": 200,
"name": "Boris"
}
]
}
}
]&sessionName=
&sessionName=My%20Custom%20Session names the session in the header bar, for
any launch type. Without it the name is generated with a timestamp.
&hubURL=
&hubURL=https://example.com/hub.txt&config=none
- Loads one or more UCSC track hubs (comma-separated) as a session, usually with
?config=nonesince the hub supplies the assemblies and tracks. &assembly=and&loc=open the hub at a place;&assembly=is required, since it names the hub genome&loc=resolves against:?config=none&hubURL=https://example.com/hub.txt&assembly=GCF_019202715.1&loc=chr1:1-100000.&sessionTracks=registers into the hub session, so&tracks=can name one of them beside the hub's own.- Each hub opens with a single linear genome view. For several views, a
workspace layout or a dotplot, put the hub in a session spec's
sessionConnections. - Opening track hubs by URL is the full workflow.
&renderer=
&renderer=webgl pins the drawing backend, overriding detection: webgpu,
webgl, or canvas2d (alias canvas). A pin never falls through, so a backend
that cannot start shows an error on every track. It is a debugging aid
(my tracks are blank),
and JBrowse Desktop takes the same choice as
--renderer.
&safeMode
&safeMode, bare, loads without the plugins this browser
keeps for this configuration,
for one load only. Use it when a plugin crashes the app before any menu is on
screen; the fatal error dialog offers the same thing as a button.
Navigating within the default session
&extendSession=true beside &loc= navigates a curated defaultSession
instead of replacing it:
?loc=chr1:100000-200000&extendSession=true&loc=, &tracks=, &highlight=, &nav= and &tracklist= then apply to the
first linear genome view of that session, whose assembly is used, so
&assembly= is not needed. &sessionTracks= is not layered on; a
session spec is the way to add a track config to a curated
session.
Which parameter decides the launch
A link can contain several of these at once, and they do not combine: one decides what opens and the rest are layered onto it or dropped. Highest first:
&session=, in any form (spec-,share-,encoded-,json-,local-). A value matching none of those prefixes is an error.&extendSession=truebeside&loc=/&assembly=, which navigates the config'sdefaultSession. It outranks a hub, which would otherwise replace that session.&hubURL=. A link with both a hub and&loc=navigates inside the hub.&loc=/&assembly=alone open a fresh single linear genome view.- A link with none of these opens the config's
defaultSession.
?config=, &sessionName= and &renderer= sit outside the ranking and apply
to whichever launch wins. &sessionTracks= applies to the hub launch and to the
bare shorthand. A default session or &session= lists its tracks itself, so
&sessionTracks= adds none there.
Session spec
A session spec is the session as JSON in the URL, the value of &session=
prefixed spec-:
&session=spec-{"views":[{"type":"LinearGenomeView","assembly":"volvox","loc":"ctgA:1-5100"}]}{
"views": [
{
"assembly": "volvox",
"loc": "ctgA:1-5100",
"type": "LinearGenomeView",
"tracks": [
"gff3tabix_genes",
"volvox_filtered_vcf",
"volvox_microarray",
"volvox_cram"
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-5100%22%2C%22type%22%3A%22LinearGenomeView%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%2C%22volvox_filtered_vcf%22%2C%22volvox_microarray%22%2C%22volvox_cram%22%5D%7D%5D%7D&sessionName=JBrowse+docs+example- Each view object lists the keys it launches with, written directly on the
view. A
defaultSessionin a config uses the same object (Config and session JSON), so a view moves between a spec, a config and anaddViewcall unchanged. viewstakes several views, opened together.locis optional; omitting it shows the whole genome. Other view types take other keys: a dotplot takes two assemblies.- Each view's
typedispatches to aLaunchView-<type>extension point, which is how plugins add launchable view types.
Session-wide fields
Four top-level arrays furnish the session the views open into, applied in this order so each can name what the ones before it registered:
sessionAssembliesregisters assemblies. With?config=nonea spec is then fully self-contained: a novel assembly, its tracks, and the views over them.sessionConnectionsattaches connections, UCSC track hubs or JBrowse hubs, and waits for each to finish fetching before launching the views, so a view can name an assembly or trackId the connection supplies. A spec with noviewsleaves the connection to open a view.&hubURL=relies on exactly this.sessionTracksregisters track configs, the spec form of&sessionTracks=.views, then alayoutthat tiles them into a workspace.
Everything a session holds this way stays with the session: opening the link
never writes into the config.json the instance serves.
{
"sessionAssemblies": [
{
"name": "my_assembly",
"uri": "https://example.com/my_assembly.2bit"
}
],
"sessionTracks": [
{
"type": "FeatureTrack",
"trackId": "my_track",
"name": "My track",
"assemblyNames": ["my_assembly"],
"adapter": { "type": "FromConfigAdapter", "features": [] }
}
],
"views": [
{
"type": "LinearGenomeView",
"assembly": "my_assembly",
"tracks": ["my_track"]
}
]
}{
"sessionConnections": [
{
"type": "UCSCTrackHubConnection",
"connectionId": "my_hub",
"name": "My hub",
"hubTxtLocation": { "uri": "https://example.com/hub.txt" }
}
],
"views": [
{
"type": "LinearGenomeView",
"assembly": "GCF_019202715.1",
"loc": "chr1:1-100000"
}
]
}&sessionName= names a spec's session the same as any other
launch.
Fields every view takes
idpins the created view's id so another view in the same spec can point at it (an MsaView'sconnectedViewId). It is the one key the launcher reserves; the rest of what every view takes comes fromBaseViewModeland appears in each view's table below,displayNameamong them.displayedRegionNamesis the spec form of®ions=: with noloc, it restricts the whole-genome overview to these chromosomes, in this order. It works on the linear genome view, the circular view, each axis of a dotplot and each row of a synteny view. Volvox showing its two contigs, order reversed:
{
"views": [
{
"type": "LinearGenomeView",
"assembly": "volvox",
"displayedRegionNames": ["ctgB", "ctgA"],
"tracks": ["gff3tabix_genes"]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22displayedRegionNames%22%3A%5B%22ctgB%22%2C%22ctgA%22%5D%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleGlob region names
An entry containing * is a glob matched against the refName, so ["*_hap1"]
covers sixteen scaffolds in one entry and survives the assembly being rebuilt.
*is the only metacharacter; regex punctuation in a refName (chr1.1,scaffold[2]) matches literally.- A glob contributes its matches in the assembly's order; exact names contribute
in the order written, and entries already taken are skipped, so
["chr1_hap1", "*_hap1"]reads as "chr1 first, then the rest of hap1". - Globs match aliases and match case-insensitively, the same as an exact entry. A name matching nothing is dropped, and a list matching nothing at all is reported.
- There is no negation, and on a UCSC-style assembly
chr*also takeschrUn_GL000195v1andchr1_KI270706v1_random, whilechr1*takeschr10throughchr19. Globs suit name families an assembly separates (*_hap1,*_MATERNAL,*_alt); a main-chromosome subset is best written as a list. - The dotplot and synteny import forms put the same syntax in a text box beside each assembly.
Advanced track configuration
A tracks entry is a trackId string, or an object with initial display state:
{
"views": [
{
"assembly": "volvox",
"loc": "ctgA:1-5100",
"type": "LinearGenomeView",
"tracks": [
"simple_track_id",
{
"trackId": "my_bam_track",
"displaySnapshot": {
"type": "LinearAlignmentsDisplay",
"height": 300
}
},
{
"trackId": "my_wiggle_track",
"displaySnapshot": {
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 100 } }
}
}
}
]
}
]
}displaySnapshottakes anything the display's menu offers:typeto pick a display,height,encoding.color(a field, or avalueholding a CSS color or ajexl:expression),encoding.yon a quantitative track (YChannel),forceLoadto render past the "too much data" gate (BaseLinearDisplay).trackSnapshotsets track state such aspinned: true.- Any other key on the object is a display setting, so
{ "trackId": "my_bam_track", "type": "LinearAlignmentsDisplay", "height": 300 }is the shorthand for the nested form. Use the explicit form when you also passtrackSnapshot. modifierstakes the jb2export command line's track options, such as["color:strand", "sort:base", "encoding.color.field=tags.HP"]. A linear genome view applies them over the entry's other settings once it has navigated, sosort:pivots at the view's center.
Linear genome view
A LinearGenomeView object takes the
simple params plus grow, which pads loc by
that fraction on each side (0.2 pads 20%), and showHitTrack, which sets
whether a loc that is a gene name also opens the track the name was found in
(by default, only when the view lists no tracks). Beyond those it takes any
property the state model declares.
Linear genome view properties
Launch keys, resolved once on attach and then discarded, because they have
no direct representation in the view's state — assembly,
displayedRegionNames, grow, highlight, loc, nav, showHitTrack,
tracklist. There are no others; a key outside this set and the table below is
a typo, and the launcher names it in a console warning.
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
axis | The ruler's guide, a LinearGenomeViewAxis object: { grid: false } stops its ticks running down through the tracks. |
colorByFrame | color CDS segments by reading frame |
displayedRegions | currently displayed regions, can be a single chromosome, arbitrary subsections, or the entire set of chromosomes in the genome. The entire set is not advised if your assembly is very fragmented |
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
hideHeader | drop the header bar entirely — location box, navigation buttons and overview |
hideHeaderOverview | keep the header, drop the whole-chromosome overview strip below it |
hideNoTracksActive | suppress the "No tracks active" placeholder, for an embed that opens with no tracks on purpose |
minimized | collapse the view to its header bar and keep it in the session |
scalebarOnly | when true, only the header and coordinate scalebar are rendered |
showAminoAcids | draw translated codons on coding features once zoomed in far enough: an alternating per-codon shading, and the amino acid letters on top of it at base-level zoom. Independent of colorByFrame, which only recolors the segments by frame. |
showCenterLine | show the "center line". A personal preference: never in a session snapshot. It, showCytobands, trackLabels, colorByFrame, showAminoAcids and showTrackOutlines start from this browser's last choice, which their setters record. |
showCytobands | whether to show the "cytobands" in the overview scale bar (the resolved, capability-gated value is the effectiveShowCytobands getter) |
showTrackOutlines | show the track outlines |
trackLabels | how to display the track labels, can be "overlapping", "offset", or "hidden", or empty string "" (which uses the LinearGenomeViewPlugin config default). The resolved value is the effectiveTrackLabels getter. See the LinearGenomeViewPlugin docs at https://jbrowse.org/jb2/docs/config/lineargenomeviewconfigschema/ for how the config is used |
trackSelectorType | vestigial: the hierarchical selector is the only one that exists, so this value is ignored. Retained because saved sessions and share links persist it. |
windowStartBp | Left edge of the viewport, in linearized bp — the concatenated displayedRegions space that offsetPx indexes, which has no inter-region padding, so the two differ only by bpPerPx. May be negative when the view is scrolled past the left end.The view stores the genomic window it frames rather than the pixels that framed it, because pixels mean nothing without the width they were measured at and a snapshot does not include one. A session authored in a 1000px window therefore shows the same region when opened at 500px, as the same location given as a &loc= does: both ways to share a view store intent. |
windowWidthBp | Width of the viewport in bp. Zero means "not established yet": no width has been measured, so there is nothing to divide by. The first measure fills it in, and bpPerPx is windowWidthBp / width from then on. |
bpPerPxandoffsetPxare the zoom and the horizontal scroll, and they are the exception to the typo rule above: the view stores its viewport as a genomic window now, so neither is a declared property, but the view still accepts and converts both.locsurvives an assembly whose regions were rebuilt; use these two only to reproduce a viewport to the pixel. The conversion stores the old zoom, until the view's first width measure, aslegacyBpPerPx, a declared property for saved sessions. Write the window fields above (orloc) rather than setting it yourself.displayedRegionsgives the regions the view lays out as full{refName, start, end, assemblyName}objects, which is the form for showing part of a chromosome;displayedRegionNamesnames whole ones.showCytobandsandshowTrackOutlinesdefault to the visitor's stored preference, so set them explicitly in a link that has to look the same for everyone.showCytobandsSettingis the old name ofshowCytobands. It is not a declared property, but the view converts it on the way in, so a v4 link or saved spec naming it still works; writeshowCytobandsin a new one.colorByCDSis the old name ofcolorByFrame, converted the same way.
Live example: alignments display settings
An alignments track colored by pair orientation, with soft-clipped bases shown
and an enlarged height. Swapping pileup.softClips for pileup.connectors
draws a connector between the mates of each aberrant pair and across split-read
junctions:
{
"views": [
{
"assembly": "volvox",
"loc": "ctgA:1-10000",
"type": "LinearGenomeView",
"tracks": [
{
"trackId": "volvox_sv_cram",
"displaySnapshot": {
"height": 250,
"pileup": { "softClips": { "show": true } },
"encoding": { "color": "pairOrientation" }
}
}
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-10000%22%2C%22type%22%3A%22LinearGenomeView%22%2C%22tracks%22%3A%5B%7B%22trackId%22%3A%22volvox_sv_cram%22%2C%22displaySnapshot%22%3A%7B%22height%22%3A250%2C%22pileup%22%3A%7B%22softClips%22%3A%7B%22show%22%3Atrue%7D%7D%2C%22encoding%22%3A%7B%22color%22%3A%22pairOrientation%22%7D%7D%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleLive example: feature track color
encoding.color on a feature track's display takes a value holding a CSS
color, or a jexl: expression such as
"jexl:get(feature,'type')=='gene'?'blue':'gray'" to color per feature:
{
"views": [
{
"assembly": "volvox",
"loc": "ctgA:1-50000",
"type": "LinearGenomeView",
"tracks": [
{
"trackId": "gff3tabix_genes",
"displaySnapshot": {
"encoding": { "color": { "value": "green" } }
}
}
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-50000%22%2C%22type%22%3A%22LinearGenomeView%22%2C%22tracks%22%3A%5B%7B%22trackId%22%3A%22gff3tabix_genes%22%2C%22displaySnapshot%22%3A%7B%22encoding%22%3A%7B%22color%22%3A%7B%22value%22%3A%22green%22%7D%7D%7D%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleLive example: highlight a feature, and sort it to the top
&highlight= paints a band over a region across every track. To
box one feature at whatever row the track's layout puts it, set
featureHighlights on the display, the same state the right-click "Highlight
feature" item and a feature search write
(LinearBasicDisplay,
LinearVariantDisplay, and every other canvas display):
{
"views": [
{
"assembly": "volvox",
"loc": "ctgA:1-50000",
"type": "LinearGenomeView",
"tracks": [
{
"trackId": "gff3tabix_genes",
"displaySnapshot": {
"height": 200,
"featureHighlights": [{ "refName": "ctgA", "name": "EDEN" }]
}
}
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-50000%22%2C%22type%22%3A%22LinearGenomeView%22%2C%22tracks%22%3A%5B%7B%22trackId%22%3A%22gff3tabix_genes%22%2C%22displaySnapshot%22%3A%7B%22height%22%3A200%2C%22featureHighlights%22%3A%5B%7B%22refName%22%3A%22ctgA%22%2C%22name%22%3A%22EDEN%22%7D%5D%7D%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+example- A declarative highlight also sorts its feature to a top row of the track, ahead of the row packer's order, and holds it there across pan and zoom.
- By name,
{"refName": "ctgA", "name": "EDEN"}, matched exactly and case-insensitively within that refName. Prefer this. A name that is ambiguous (a gene and its same-named transcript) boxes both. - By span,
{"refName": "ctgA", "start": 1049, "end": 9000}, in interbase coordinates, matched within one base of the track's record. A location box reads the same feature asctgA:1,050-9,000, so coordinates copied off the screen are a base short at the start. An entry with both forms falls back tonamewhen the span misses. - A span that resolves to nothing logs a console warning once data covering it has loaded; a name that resolves to nothing logs no warning. The clear-highlights button in the view header removes them.
Circular view
The circular view shows the whole genome, so there is no loc. It takes
assembly, tracks, displayedRegionNames (which chromosomes get an arc, in
that order, globs allowed) and height, which sizes the
drawing since the circle auto-fits its container.
{
"views": [
{
"assembly": "volvox",
"type": "CircularView",
"tracks": ["volvox_sv_test"]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22type%22%3A%22CircularView%22%2C%22tracks%22%3A%5B%22volvox_sv_test%22%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleCircular view properties
Launch keys, which name something to do on load rather than state the view holds:
| Launch key | What it does |
|---|---|
assembly | the assembly whose chromosomes the circle draws, or the assemblies, in the order their slices are laid out — a synteny ribbon plot wants both ends of its alignments on the circle. Optional because a spec view is untyped user input; without one the view opens on its import form |
autoDiagonalize | On a circle of two genomes with a synteny track, reorder the second genome's chromosomes to follow the first's and lay them out mirrored, so the ribbons form a band of parallel arcs instead of crossing at the center. The figure is hidden behind a "Reordering chromosomes" screen during the wait. Same key and same pass as the linear synteny view's and the dotplot's |
displayedRegionNames | whole chromosomes to draw, in this order; the rest of the assembly's contigs are left off the circle. A list applies to every assembly on the circle, and { hg38: ['chr1'], mm39: ['chr2'] } restricts each one separately, leaving an assembly it does not name whole |
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
autoFit | whether the view refits to its box on resize; a manual zoom or pan clears it |
bpPerPx | the zoom level, base-pairs per pixel. Capped by minimumRadiusPx, and refit over by the first resize unless autoFit is false. |
disableImportForm | never show the import form, even on an error, for an embed that picks the assembly itself (the SV inspector) |
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
encoding | The channels every track in the view paints with, a SyntenyEncoding object. Its color is a SyntenyColor channel: "strand", "query", "reference", "track", a measurement (identity, mapq, dnds) or a column the tracks declare, with scale.domain ordering a text column's labels, scale.range coloring them and scale.names naming them in the key, scale.range or scale.scheme, scale.reverse and pinned ends reshaping a ramp, and scale.type: 'threshold' binning a number at scale.domain's cuts; { value } paints every alignment. Unset, the view's default paints: query on the circular view, the default scheme elsewhere. Its opacity is a SyntenyOpacity channel. |
filter | The alignments drawn, a list of FieldPredicate entries an alignment must all pass. A field is any field color takes, or length, the alignment's bp on its own axis: [{ field: 'length', gte: 10000 }] clears a whole-genome hairball. A filter edit recolors and refetches nothing. |
height | the view's height in px, which sizes the fitted circle. Left at its default in a multi-view session, the view opens square to its width |
hideTrackSelectorButton | chrome switch, for an embed that drives the view itself |
hideVerticalResizeHandle | chrome switch, for an embed that drives the view itself |
legend | the key naming each track's ring, chords or ribbons in the corner, a HiddenLegend object: { show: true } draws it |
minimized | collapse the view to its header bar and keep it in the session |
minimumRadiusPx | how far out the circle may zoom, as the smallest radius it shrinks to; it is what caps bpPerPx |
minVisibleWidth | arcs thinner than this many pixels are elided instead of drawn, so a few thousand unplaced contigs do not become a ring of hairlines |
offsetRadians | the figure's rotation in radians, the linear view's offsetPx |
paddingPx | blank margin between the circle and the edge of the figure |
parkedColors | By color object, the field the last write away from one left, with its members |
render | How the ribbons rasterize, a SyntenyRender object: antialias fades a sub-pixel ribbon by its on-screen width, so an unfiltered whole-genome view doesn't read as a full-opacity hairball. Unset, it fades once sub-pixel ribbons dominate a display and leaves a sparse comparison at full alpha; true and false fix it. Resolved view-wide by fadeThinAlignments. |
spacingPx | the gap drawn between adjacent chromosome arcs |
trackColors | trackId -> explicit color under encoding.color: 'track'. Absent means the track takes an automatic slot from the palette. |
trackSelectorType | ignored, kept because saved sessions carry it |
bpPerPx and offsetRadians are the circle's zoom and rotation; pairing them
with autoFit: false stops the first resize refitting over them.
Dotplot view
{
"views": [
{
"type": "DotplotView",
"views": [
{
"assembly": "volvox"
},
{
"assembly": "volvox"
}
],
"tracks": ["volvox_fake_synteny"]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig_main_thread.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22DotplotView%22%2C%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%7D%2C%7B%22assembly%22%3A%22volvox%22%7D%5D%2C%22tracks%22%3A%5B%22volvox_fake_synteny%22%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleviews[0]is the horizontal axis andviews[1]the vertical. Each takes an optionallocto navigate that axis; omit it for a whole-genome overview.- Each also takes
displayedRegionNames, which changes what the axis displays at all wherelocnavigates within it. A haplotype-resolved assembly shown whole interleaves both haplotypes, and["*_hap1"]on one axis plots one haplotype against the reference. It is applied beforeautoDiagonalize.
Dotplot view properties
Launch keys, which name something to do on load rather than state the view holds:
| Launch key | What it does |
|---|---|
autoDiagonalize | After tracks load, automatically run the chromosome diagonalization pass so the bottom/vertical axis follows the top/horizontal axis. The canvas is hidden behind a "Reordering chromosomes…" spinner during the wait, so the user doesn't see an undiagonalized flash. |
highlight | loc-strings ("chr1:100-200"), JSON strings or objects, mirroring the linear genome view's highlight |
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
assemblyNames | the two assemblies being compared, horizontal axis first. A spec normally names these per axis instead, as views[0].assembly and views[1].assembly. |
axis | Both genome axes' guide, a DotplotAxis object: grid extends each axis' ruler ticks across the plot as faint lines, the way LinearGenomeView's axis.grid extends its ruler down over the tracks, and labels numbers the major ticks. |
coord | The coordinate system, a SyntenyCoord object: { ratio: 1 } keeps hview and vview at one bpPerPx so the plot stays square. Wheel zoom already preserves the ratio; box-zoom and other independent ops trigger an autorun resync. |
data | What the fetch reads, a SyntenyData object: resolution picks a tiered file's stored tier. One value for the view, so every track draws at the same tier. |
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
encoding | The channels every track in the view paints with, a SyntenyEncoding object. Its color is a SyntenyColor channel: "strand", "query", "reference", "track", a measurement (identity, mapq, dnds) or a column the tracks declare, with scale.domain ordering a text column's labels, scale.range coloring them and scale.names naming them in the key, scale.range or scale.scheme, scale.reverse and pinned ends reshaping a ramp, and scale.type: 'threshold' binning a number at scale.domain's cuts; { value } paints every alignment. Unset, the view's default paints: query on the circular view, the default scheme elsewhere. Its opacity is a SyntenyOpacity channel. |
filter | The alignments drawn, a list of FieldPredicate entries an alignment must all pass. A field is any field color takes, or length, the alignment's bp on its own axis: [{ field: 'length', gte: 10000 }] clears a whole-genome hairball. A filter edit recolors and refetches nothing. |
height | the height of the plot in pixels |
hview | the horizontal axis, as a full 1D view state. A spec writes views[0] instead, which the launcher resolves into this. |
indels | The insertions and deletions inside each alignment, a SyntenyIndels part: { show: false } plots each alignment as one straight segment, and { encoding: { opacity: 0 } } leaves each indel a gap in its line. |
lineWidth | Line width in CSS pixels of every alignment in the plot |
minimized | collapse the view to its header bar and keep it in the session |
parkedColors | By color object, the field the last write away from one left, with its members |
trackColors | trackId -> explicit color under encoding.color: 'track'. Absent means the track takes an automatic slot from the palette. |
trackSelectorType | vestigial: the hierarchical selector is the only one that exists, so this value is ignored. Retained because saved sessions and share links persist it. |
vview | the vertical axis, the counterpart to hview. A spec writes views[1]. |
Dotplot highlights
highlight works as it does on the linear genome view. A region draws as a
vertical band when its assembly matches the horizontal axis and a horizontal
band when it matches the vertical one, so on a self-vs-self plot it appears on
both. Include assemblyName to tie a band to one axis of a non-self plot.
{
"views": [
{
"type": "DotplotView",
"views": [
{ "assembly": "volvox", "loc": "ctgA:1-50000" },
{ "assembly": "volvox", "loc": "ctgA:1-50000" }
],
"tracks": ["volvox_fake_synteny"],
"highlight": ["ctgA:5000-15000"]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig_main_thread.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22DotplotView%22%2C%22views%22%3A%5B%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-50000%22%7D%2C%7B%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-50000%22%7D%5D%2C%22tracks%22%3A%5B%22volvox_fake_synteny%22%5D%2C%22highlight%22%3A%5B%22ctgA%3A5000-15000%22%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleLinear synteny view
{
"views": [
{
"type": "LinearSyntenyView",
"tracks": ["volvox_fake_synteny"],
"views": [
{
"loc": "ctgA:1-30000",
"assembly": "volvox"
},
{
"loc": "ctgA:1000-31000",
"assembly": "volvox"
}
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearSyntenyView%22%2C%22tracks%22%3A%5B%22volvox_fake_synteny%22%5D%2C%22views%22%3A%5B%7B%22loc%22%3A%22ctgA%3A1-30000%22%2C%22assembly%22%3A%22volvox%22%7D%2C%7B%22loc%22%3A%22ctgA%3A1000-31000%22%2C%22assembly%22%3A%22volvox%22%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+example- Each entry in
viewsis one genome row, a linear genome view, so it takes the LGV's keys and launch props (trackLabels,colorByFrame,showAminoAcids), and itstracksentries take inline display options. displayedRegionNamesrestricts a row to a subset of its assembly, with globs, so a whole-genome view can put one haplotype on each row (["*_MATERNAL"]above["*_PATERNAL"]).locnavigates within what a row displays and takes precedence.- A self-self alignment is allowed.
Linear synteny view properties
Top-level fields set the view's initial display state. The same view colored by strand, with curved ribbons and stronger opacity:
{
"views": [
{
"type": "LinearSyntenyView",
"tracks": ["volvox_fake_synteny"],
"encoding": { "color": "strand", "opacity": 0.8 },
"mark": { "interpolate": "bump" },
"views": [
{ "loc": "ctgA:1-30000", "assembly": "volvox" },
{ "loc": "ctgA:1000-31000", "assembly": "volvox" }
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearSyntenyView%22%2C%22tracks%22%3A%5B%22volvox_fake_synteny%22%5D%2C%22encoding%22%3A%7B%22color%22%3A%22strand%22%2C%22opacity%22%3A0.8%7D%2C%22mark%22%3A%7B%22interpolate%22%3A%22bump%22%7D%2C%22views%22%3A%5B%7B%22loc%22%3A%22ctgA%3A1-30000%22%2C%22assembly%22%3A%22volvox%22%7D%2C%7B%22loc%22%3A%22ctgA%3A1000-31000%22%2C%22assembly%22%3A%22volvox%22%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleThe v4 spellings colorBy and alpha still open, as encoding.color and
encoding.opacity, and the betas' cigarMode and drawCigar as indels.
Launch keys, which name something to do on load rather than state the view holds:
| Launch key | What it does |
|---|---|
autoDiagonalize | After tracks load, automatically run the chromosome diagonalization pass so the bottom/vertical axis follows the top/horizontal axis. The canvas is hidden behind a "Reordering chromosomes…" spinner during the wait, so the user doesn't see an undiagonalized flash. |
collapseEmptyRows | Open any genome row the launch gives no tracks collapsed to its ruler. The "No tracks active / Open track selector" block costs ~90px per row, which on a five-row launch is more of the viewport than the ribbons; a row is one click from expanding again (MiniControls, or the view menu's "Rows" → "Expand all views"). Off by default so an authored session keeps its rows as written — the launch dialog turns it on, and offers a checkbox to not. |
coord | { ratio: 1 } puts every genome row on one bp/px, the coarsest row's, instead of fitting each to the pane width. The largest genome then fills the frame and the rest are drawn shorter in proportion, so a size difference between rows (polyploidy, a genome duplication) is visible as length rather than hidden by the per-row stretch — and orthologs between two rows line up at the same scale on both. Applied last, after any autoDiagonalize pass. The SyntenyCoord object, { ratio: 1 }. |
levelHeights | Pixel height of each synteny strip, one entry per level, or one number for every level. Useful for whole-genome views where the default ~100px is too cramped for the ribbon detail to be readable. |
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
axis | Each row's ruler guide, a LinearSyntenyAxis object: { grid: true } continues the query row's scalebar ticks down through every band, each joined to the coordinate the alignment pairs it with. |
data | What the fetch reads, a SyntenyData object: resolution picks a tiered file's stored tier. One value for the view, so every track draws at the same tier. |
diagonalizeAnchorRow | Which genome row "Re-order chromosomes" keeps as it is: the rows below it are ordered against the row above them, and the rows above it against the row below. It matters wherever the top row is not the one whose order means something: linkage_groups/alg_stack stacks six genomes whose linkage groups are the jellyfish row's chromosomes, and anchored on the top row every row below is ordered off a comb jelly instead. |
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
encoding | The channels every track in the view paints with, a SyntenyEncoding object. Its color is a SyntenyColor channel: "strand", "query", "reference", "track", a measurement (identity, mapq, dnds) or a column the tracks declare, with scale.domain ordering a text column's labels, scale.range coloring them and scale.names naming them in the key, scale.range or scale.scheme, scale.reverse and pinned ends reshaping a ramp, and scale.type: 'threshold' binning a number at scale.domain's cuts; { value } paints every alignment. Unset, the view's default paints: query on the circular view, the default scheme elsewhere. Its opacity is a SyntenyOpacity channel. |
filter | The alignments drawn, a list of FieldPredicate entries an alignment must all pass. A field is any field color takes, or length, the alignment's bp on its own axis: [{ field: 'length', gte: 10000 }] clears a whole-genome hairball. A filter edit recolors and refetches nothing. |
indels | The insertions and deletions inside each alignment, a SyntenyIndels part: { show: false } draws each alignment as one block, and { encoding: { opacity: 0 } } leaves each indel a gap. |
levels | One synteny band per adjacent pair of views, each holding one track list. The track-selector and add-track widgets address a band through trackContainerFor. |
mark | How every band's ribbons draw, a SyntenyMark object: { interpolate: 'bump' } curves their sides. |
minimized | collapse the view to its header bar and keep it in the session |
navigation | How a move on one row carries to the others, a SyntenyNavigation object: { follow: true } has the rows follow the anchor row through the alignment. |
offscreen | The marks along both edges of each band for the alignments the view cannot draw a ribbon for, a SyntenyOffscreen part: { show: false } removes them and the second query per pair of rows they cost. |
overdrawPx | pixels beyond the visible viewport edge that synteny lines are still drawn. Effective up to the pan buffer (syntenyPanBufferPx: 2000px, or half the viewport when that is wider) — the worker emits CIGAR detail and location markers only that far, so a larger value draws ribbons whose detail stops partway along them. |
parkedColors | By color object, the field the last write away from one left, with its members |
render | How the ribbons rasterize, a SyntenyRender object: antialias fades a sub-pixel ribbon by its on-screen width, so an unfiltered whole-genome view doesn't read as a full-opacity hairball. Unset, it fades once sub-pixel ribbons dominate a display and leaves a sparse comparison at full alpha; true and false fix it. Resolved view-wide by fadeThinAlignments. |
trackColors | trackId -> explicit color under encoding.color: 'track'. Absent means the track takes an automatic slot from the palette. |
trackSelectorType | Ignored: the hierarchical selector is the only one. Declared because sessions and share links still contain it. |
levels is accepted because the view declares it; tracks fills it and
levelHeights sizes them, so use levels only to author a band's full state.
Linear synteny view (multi-way)
With three or more rows, each track in a flat tracks list goes on every band
whose two rows its assemblyNames cover. A pairwise track goes on its one band,
and one multi-genome track covers the whole stack:
{
"views": [
{
"type": "LinearSyntenyView",
"tracks": ["volvox_ins.paf", "volvox_del.paf"],
"views": [
{ "loc": "ctgA:1-50000", "assembly": "volvox_ins" },
{ "loc": "ctgA:1000-50000", "assembly": "volvox" },
{ "loc": "ctgA:1000-44000", "assembly": "volvox_del" }
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearSyntenyView%22%2C%22tracks%22%3A%5B%22volvox_ins.paf%22%2C%22volvox_del.paf%22%5D%2C%22views%22%3A%5B%7B%22loc%22%3A%22ctgA%3A1-50000%22%2C%22assembly%22%3A%22volvox_ins%22%7D%2C%7B%22loc%22%3A%22ctgA%3A1000-50000%22%2C%22assembly%22%3A%22volvox%22%7D%2C%7B%22loc%22%3A%22ctgA%3A1000-44000%22%2C%22assembly%22%3A%22volvox_del%22%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+example- A track that covers no band, or whose config names no
assemblyNames, is reported and not drawn. - A list of lists names each band's tracks instead,
tracks[i]between rowsiandi + 1. Use it to give a band a different track than its coverage picks, or none.
Breakpoint split view
{
"views": [
{
"type": "BreakpointSplitView",
"views": [
{
"loc": "ctgA:1-5000",
"assembly": "volvox",
"tracks": ["volvox_cram"]
},
{
"loc": "ctgB:1-5000",
"assembly": "volvox",
"tracks": ["volvox_cram"]
}
]
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22BreakpointSplitView%22%2C%22views%22%3A%5B%7B%22loc%22%3A%22ctgA%3A1-5000%22%2C%22assembly%22%3A%22volvox%22%2C%22tracks%22%3A%5B%22volvox_cram%22%5D%7D%2C%7B%22loc%22%3A%22ctgB%3A1-5000%22%2C%22assembly%22%3A%22volvox%22%2C%22tracks%22%3A%5B%22volvox_cram%22%5D%7D%5D%7D%5D%7D&sessionName=JBrowse+docs+exampleviews lists the two or more linear genome views that make up the split view,
each with a location, an assembly and tracks. Beside views, the spec accepts
every setting the view's menu offers:
| Property | What it does |
|---|---|
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
interactiveOverlay | let the connection and junction curves drawn between the panels respond to hover and click; off, they are a static overlay |
linkViews | sync scroll and zoom across the panels, so panning one pans them all |
minimized | collapse the view to its header bar and keep it in the session |
showHeader | show the view's own header bar, above the panels' own |
Spreadsheet view
{
"views": [
{
"type": "SpreadsheetView",
"uri": "test_data/volvox/volvox.filtered.vcf.gz",
"assembly": "volvox"
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22SpreadsheetView%22%2C%22uri%22%3A%22test_data%2Fvolvox%2Fvolvox.filtered.vcf.gz%22%2C%22assembly%22%3A%22volvox%22%7D%5D%7D&sessionName=JBrowse+docs+exampleLaunch keys, which name something to do on load rather than state the view holds:
| Launch key | What it does |
|---|---|
assembly | the assembly the sheet's rows are read against. With only this and no uri, the view opens on its import form with that assembly already selected rather than the first one in the config |
baseUri | what a relative uri resolves against. A config loaded from a URL gets this beside every uri in it, a defaultSession view's included, so the sheet's file resolves against the config the way a track's does |
fileType | the file's format. Otherwise detected from the extension, falling back to VCF, so name it for a file the extension does not identify |
filterText | search-box text, applied once the file is loaded |
svEventFilter | the rearrangement event to open the sheet narrowed to: a value of the file's INFO.EVENT, matched whole |
uri | the file to load into the sheet. A spec view is untyped user input, so this can be absent, and the view then opens on the import form |
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
drilldownTracks | trackIds the views a row opens start with, beside the loaded file's own track: the tumor and normal alignments, a coverage track, an assembly's synteny track |
height | the height of the sheet in pixels |
hideVerticalResizeHandle | chrome switch, for an embed that sizes the view itself |
minimized | collapse the view to its header bar and keep it in the session |
fileType is one of VCF, BED, BEDPE or STAR-Fusion, for a URL with no
extension or a STAR-Fusion file, which has no extension.
SV inspector
{
"views": [
{
"type": "SvInspectorView",
"uri": "test_data/volvox/volvox.dup.vcf.gz",
"assembly": "volvox"
}
]
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22SvInspectorView%22%2C%22uri%22%3A%22test_data%2Fvolvox%2Fvolvox.dup.vcf.gz%22%2C%22assembly%22%3A%22volvox%22%7D%5D%7D&sessionName=JBrowse+docs+exampleThe circular half draws the rows the spreadsheet half's filter leaves, so
filterText makes a chord subset reachable from a link.
Launch keys, which name something to do on load rather than state the view holds:
| Launch key | What it does |
|---|---|
assembly | the assembly both halves are read against. With only this and no uri, the view opens on its import form with that assembly already selected rather than the first one in the config |
baseUri | what a relative uri resolves against. A config loaded from a URL gets this beside every uri in it, a defaultSession view's included, so the sheet's file resolves against the config the way a track's does |
drilldownTracks | trackIds every view a row or chord opens starts with, beside the callset's own track: the tumor and normal alignments, a coverage track, an assembly's synteny track |
fileType | the file's format. Otherwise detected from the extension, falling back to VCF, so name it for a file the extension does not identify |
filterText | search-box text for the spreadsheet half, applied once the file is loaded. The circular half draws the rows it leaves, so this is what makes a chord subset reachable from a link |
svEventFilter | the rearrangement event to open the sheet narrowed to: a value of the file's INFO.EVENT, matched whole |
uri | the file to load into the sheet. A spec view is untyped user input, so this can be absent, and the view then opens on the import form |
Properties, which are whatever the state model declares and the view restores natively:
| Property | What it does |
|---|---|
displayName | displayName is displayed in the header of the view, or assembly names being used if none is specified |
height | height of the whole view in pixels |
minimized | collapse the view to its header bar and keep it in the session |
onlyDisplayRelevantRegionsInCircularView | draw only the chromosomes the visible rows touch |
spreadsheetWidthFraction | share of the view's width given to the spreadsheet |
Plugin-provided view types
A plugin makes its view launchable by registering a LaunchView-<type>
extension point. Once the plugin is
loaded, through the config's plugins, a hosted config, or a session's
sessionPlugins, a spec launches its view by
type. Each plugin's launch-parameters page lists its fields:
ProteinViewfromjbrowse-plugin-protein3d(uniprotId,pdbId,url,structures,transcriptId,connectedView). Every link in the TP53 structures tutorial is one of these specs.MsaViewfromjbrowse-plugin-msaview(msa,tree,msaFileLocation,connectedViewId,connectedTranscript).
Tiled views / Workspaces
A spec's layout arranges its views into a tiled workspace. It is a tree of two
kinds of node:
- a panel, with a
viewsarray of indices into the spec'sviews, stacked vertically. An index names every view that entry created: aProteinViewwith aconnectedViewopens its genome view and then the structure, and its index is the pair, stacked. An entry may also be a view id the spec pinned withid, to place one of those views alone - a container, with
childrenand adirection:"horizontal","vertical"or"tabs"(one tab group, one child visible at a time)
Containers nest arbitrarily deep. An index past the end, or an id no view in the
spec has, is reported and left out of the layout. The live session takes the
same layout tree: session.applyLayoutSpec(layout) (see
the live model guide) counts a panel's indices into
session.views instead, and refuses a panel spelled any other way.
Views 0 and 1 stacked in a left panel taking 70% of the width, view 2 alone on the right:
{
"views": [
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgA:1-5000",
"tracks": ["gff3tabix_genes"]
},
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgA:5000-10000",
"tracks": ["gff3tabix_genes"]
},
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgB:1-5000",
"tracks": ["gff3tabix_genes"]
}
],
"layout": {
"direction": "horizontal",
"children": [
{ "views": [0, 1], "size": 70 },
{ "views": [2], "size": 30 }
]
}
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-5000%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%2C%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A5000-10000%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%2C%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgB%3A1-5000%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%5D%2C%22layout%22%3A%7B%22direction%22%3A%22horizontal%22%2C%22children%22%3A%5B%7B%22views%22%3A%5B0%2C1%5D%2C%22size%22%3A70%7D%2C%7B%22views%22%3A%5B2%5D%2C%22size%22%3A30%7D%5D%7D%7D&sessionName=JBrowse+docs+examplesizeis a panel's proportion of the split, at any depth: a nested container sizes its children as well as taking a share of its parent.- Size every sibling and the numbers are proportions, so
7and3lay out the same as70and30. Leave one bare and they are read as percentages, the bare panel taking what the sized ones leave:70beside a bare panel is 70/30, and7beside a bare panel is 7/93. - Dragging the divider adjusts from there, and the position is saved with the session.
A fixed reference panel on the left, and a set of tabs to page through on the right:
{
"views": [
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgA:1-5000",
"tracks": ["gff3tabix_genes"]
},
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgA:1-5000",
"tracks": ["volvox_sv_test"]
},
{
"type": "LinearGenomeView",
"assembly": "volvox",
"loc": "ctgB:1-5000",
"tracks": ["gff3tabix_genes"]
}
],
"layout": {
"direction": "horizontal",
"children": [
{ "views": [0] },
{
"direction": "tabs",
"children": [{ "views": [1] }, { "views": [2] }]
}
]
}
}Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-%7B%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-5000%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%2C%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgA%3A1-5000%22%2C%22tracks%22%3A%5B%22volvox_sv_test%22%5D%7D%2C%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22volvox%22%2C%22loc%22%3A%22ctgB%3A1-5000%22%2C%22tracks%22%3A%5B%22gff3tabix_genes%22%5D%7D%5D%2C%22layout%22%3A%7B%22direction%22%3A%22horizontal%22%2C%22children%22%3A%5B%7B%22views%22%3A%5B0%5D%7D%2C%7B%22direction%22%3A%22tabs%22%2C%22children%22%3A%5B%7B%22views%22%3A%5B1%5D%7D%2C%7B%22views%22%3A%5B2%5D%7D%5D%7D%5D%7D%7D&sessionName=JBrowse+docs+example- The first child of a
tabsnode is the tab shown. Tabs can be renamed by double-clicking and dragged out into a split. - A
tabsnode is the one container whosesizedoes not divide space, so asizeon its children has no effect, and a container nested inside it has its views gathered into a single tab. The session shows a notification when a spec does either.
Other session formats
Besides spec-, &session= takes four formats that contain a session snapshot
rather than instructions for building one.
&session=json-
A plain JSON snapshot, the shape "Export session..." produces, and the Share button's "Plaintext JSON" option: the longest format, and the one to read.
&session=json-{"session":{"id":"xSHu7qGJN","name":"test","sessionPlugins":[{"name":"MsaView","url":"https://unpkg.com/jbrowse-plugin-msaview/dist/jbrowse-plugin-msaview.umd.production.min.js"}]}}&session=encoded-
The JSON snapshot as base64 plus gzip is the Share button's "Long URL" option. It works without the session-sharing server, and because it is long the Share button puts it in the fragment.
https://jbrowse.org/code/jb2/latest/#session=encoded-eJyNU2FzmkAQ_SvOfaaNIKDyLbFN0xlrTWRqnU4mc8ACm8BB7k6Ndfj...&session=local-
https://host/jbrowse2/?session=local-Fjphq8kjY. A loaded session is stored in
sessionStorage and IndexedDB and the URL bar switches to this form. The same tab
restores from sessionStorage; a new tab on the same machine restores from
IndexedDB.
&session=share-
https://host/jbrowse2/#session=share-Xb3_kPq9LmZ, from the Share button.
- The client mints a random key, encrypts the session and uploads the blob without the key to a DynamoDB store, under a hash of the key. The link carries only the key, and the recipient's browser sends the store only the hash and decrypts the session itself, so the store's contents cannot be read even by JBrowse administrators.
- A share service that names its own ids puts the id in the link before the key.
- A link from before JBrowse 5 carries its key as
&password=, and still opens. - Behind a firewall that cannot reach the shortener, the Share dialog's gear
icon switches to "Long URL".
shareURLin the config points at a shortener of your own.
Are share links reproducible
- The short link is not reproducible: each click mints a new key and uploads a new blob, so the same view gives a new key every time.
- "Long URL" is reproducible: it contains the whole session in the link, so the same view and config produce the same link, and it survives moving the instance.
- The config can still break either link: a restored session names tracks by
trackId, so a redeploy that regeneratesconfig.jsonwith different ids leaves the link unable to find them (keeping trackIds stable).
Loading a plugin from a URL
A snapshot's sessionPlugins array is the only way to name a plugin in the URL
itself. The array takes the same definitions as a config's plugins array and
works in all four snapshot formats. The plugin belongs to that session and is
not installed for the user.
nameis required for a UMD bundle, the.umd.production.min.jsbuilds the plugin store publishes. The loader resolves the bundle as the globalJBrowsePlugin<Name>, so a definition with only aurlloads the script but does not find the global.- An unrecognized plugin prompts the visitor. Anything not served from
https://jbrowse.org/plugins/and not in the plugin store opens an "unknown plugins" dialog before the session loads, since a plugin is arbitrary JavaScript running with the page's privileges. A config'spluginsare gated the same way, but only when the config is cross-origin. - A JSON session bypasses the launcher. A plugin's view type opened this way is instantiated straight from the snapshot, so anything its launcher would have resolved has to be written out. Build the session in the app and copy it out of Share, gear, "Plaintext JSON".
- These URLs get long. Put the session
in the fragment, and
config=with it, since a fragment containing=makes JBrowse ignore the query string.
For everyone opening a config to have the plugin, put it in that config's
plugins array.
See also
- Tutorial: Embedding JBrowse
- Config guide: Default session
- Developer guide: Extension points
- Docs: Config and session JSON