Skip to content
Simon Brent edited this page Mar 8, 2022 · 1 revision

Genoverse has a number of predefined tracks, which can be found in src/js/Track/library.

Chromosome

A track displaying chromosome bands, predominantly for use in the karyotype plugin.

Gene

A track showing genes obtained from the Ensembl REST API. When sufficiently zoomed in, genes are split into their transcripts.

HighlightRegion

A track for highlighting regions of the genome, used by genoverse.addHighlight

Legend

A track to show a legend for the features of another track or tracks.

The legend track displays a series of coloured boxes and associated labels, based on which features are currently visible for the legend's track(s).

For a feature to result in a legend, it must have a legend property, for example

{ legend: 'feature type 1', color: 'green', ... }
{ legend: 'feature type 2', color: 'black', legendColor: 'red' ... }
{ legend: [{ label: 'feature type 3', color: 'blue' }, { label: 'feature type 3a', color: 'cyan' }] ... }

would result in

  • a green box labelled "feature type 1"
  • a red box labelled "feature type 2"
  • a blue box labelled "feature type 3"
  • a cyan box labelled "feature type 3a"

Configuration

lockToTrack (default true)

If true, the legend will initially appear just below the last track that the legend is for, and will move automatically to retain this state when tracks are reordered.

If false, the legend will initially appear below the last non-legend track.

unsortable (default true)

If false, legends can be moved separately to the track(s) it is for. If such a move occurs, lockToTrack is set to false.

shared (default undefined)

If true, the legends for any other tracks with the same namespaced legend will be merged into one track, for example

new Genoverse({
  tracks: [
    Genoverse.Track.extend({ name: 'track 1', legend: Genoverse.Track.Legend.Foo.extend({ shared: true }) }),
    Genoverse.Track.extend({ name: 'track 2', legend: Genoverse.Track.Legend.Foo.extend({ shared: true }) }),
  ],
})

would result in two tracks but only one legend.

Scalebar

Displays alternating black and white bars, separated by grey guidelines which extend which the whole length of the genome browser (behind other tracks), and coordinate labels to show where in the chromosome the browser is currently focussed. When present, always appears as the first track in the browser.

Configuration

stranded (default undefined)

If true, the black and white bars and coordinate labels will also appear as the last track in the browser

Scaleline

Displays an arrow which extends the length of the genome browser, with a centre-aligned label showing how wide the region being shown is.

Configuration

strand (default 1)

If 1, the arrow points to the right, and an additional label saying "Forward strand" is shown on the left (at the base of the arrow) If -1, the arrow points to the left, and an additional label saying "Reverse strand" is shown on the right (at the base of the arrow) If false, the arrow is double-headed, and there is no additional label

dbSNP

A track sequence variants from the dbSNP database, obtained from the Ensembl REST API.

File

An abstract class, extended to show data loaded from files rather than a URL. The following extensions exist to support their respective file types:

  • File.BAM: supports .bam + .bam.bai
  • File.BED
  • File.BIGBED
  • File.BIGWIG
  • File.GFF
  • File.VCF: supports both .vcf and .vcf.gz + .vcf.gz.tbi
  • File.WIG

Graph

An abstract class, extended to show data as either a bar (Graph.Bar) or line (Graph.Line) graph

Configuration

yRange (default undefined)

An array of [ minY, maxY ] for the graph

showZeroY (default true)

If true, 0 will always be included in auto-generated yRanges. If yRange is defined in track configuration, this setting will be ignored.

axesSettings (default { axisColor: 'black', axisLabelColor: 'black', scaleLineColor: '#E5E5E5' })

Used to change the colors of the axes

showPopups (default true)

For Graph.Line tracks only. If true, clicking on the track will show popups. If false, popups will not appear.

fill (default false)

For Graph.Line tracks only. If true, the area between the line and 0 on the y-axis will be colored. If falsy, only the line itself will be colored.

lineWidth (default 1)

For Graph.Line tracks only. A number determining the width in pixels to draw the line.

datasets (default [])

An array of objects used to group features in order to display multiple bars/lines on the same graph.

dataset[].name

A string used to identify the dataset. Features with a dataset property matching that name will be displayed as part of the dataset.

dataset[].color

An HTML color code string. Bars/lines in the dataset will be drawn with this color. If not set, bars/lines will be black.

dataset[].globalAlpha

A number between 0 and 1, determining the alpha value (opacity) used to draw the bars/lines for the dataset. If not set, the alpha value will be 1 (full opaque).

dataset[].fill

For Graph.Line tracks only. Overwrites track.fill for the dataset.

dataset[].lineWidth

For Graph.Line tracks only. Overwrites track.lineWidth for the dataset.

resizable (default true)

rescaleableY (default 'auto')

resizable and rescaleableY combine to define what happens when the track "resizes", as follows:

resizable rescaleableY Effect
true true Users can change the track height, and doing so changes the y-axis range (y-axis range will change proportionally to track height change)
true 'auto' Users can change the track height, and doing so does not change the y-axis range. However, the y-axis range will automatically change so that no peaks are cut off.
true false Users can change the track height, and doing so does not change the y-axis range (peak heights will change proportionally to track height change)
false true Like true/true
false 'auto' Track height cannot be changed, but the y-axis range will automatically change so that no peaks are cut off
false false Neither track height nor y-axis range can be changed, either by users or automatically
'auto' true Like false/'auto'
'auto' 'auto' Like false/'auto'
'auto' false Like false/'auto' (it is not possible to change a track's height such that no peaks are cut off without being able to change the y-axis range)

Static

An abstract class, extended to show data which is not region-specific, such as the Scaleline and Legend tracks.