Genoverse has a large number of configurable properties, in order to allow customization. A basic example with two tracks (a scalebar and some genes) and no plugins would be
var genoverse = new Genoverse({
genome: 'grch38',
tracks: [ Genoverse.Track.Scalebar, Genoverse.Track.Gene ]
});
The following properties can be provided to the constructor for Genoverse:
A DOM node, jQuery selector, or string to create a jQuery selector (e.g.
"#genoverse"
) inside which the instance of Genoverse will be created. Ifundefined
, a<div>
element will be appended todocument.body
.
The width that the
container
DOM element will be
A string or number defining the initial chromosome to display
A string or number defining the initial start position
A string or number defining the initial end position
A string defining the assembly, which can be used by track URL templates
The genome to be used. Can be:
- an object with keys of the number/letter/name of the chromosomes, and values in the form
{ "size": 10000 }
. Additionally an array of bands can be supplied for each chromosome for drawing purposes - see js/genomes/grch38.js for an example. These files can be created for species present in Ensembl by modifying the example node script utils/createGenome.js for the species required.- a string (e.g.
"grch38"
) which will be used to obtain a javascript file from the js/genomes directoryundefined
, in which casechromosomeSize
MUST be set (see below)
If
genome
not is provided,chromosomeSize
MUST be set to the length of the chromosome.If
genome
is provided,chromosomeSize
will be set to the chromosome'ssize
property, as defined by the genome object.
An array of
Genoverse.Track
definitions to be displayed
An array of regions to highlight, in the form
{ "start": 100, "end", 200, "label": "My highlight", "removable": false }
label
defaults to "start-end" (e.g. "100-200") if not provided.If
removable === false
, the highlight cannot be removed.
An array of
Genoverse.Plugins
to be used (from the js/plugins directory), e.g.
[ "controlPanel", "trackControls" ]
The strings in this array correspond to the namespace of each plugin, which are the same as their file names.
The template used to alter the web browser's URL. Should contain placeholders for chr, start and end.
If
false
or empty string, no changes will be made to the URL when navigation occurs.
Determines how the browser's URL gets updated on navigation. Can be:
true
- usewindow.location.hash
false
- usewindow.history.pushState
undefined
- usewindow.history.pushState
if present in the browser, else usewindow.location.hash
The action performed when a mouse drag happens on the genome browser. Can be:
"scroll"
- Move the browser left or right"select"
- Select the region"off"
- Do nothing
The action performed when a mouse drag happens on the genome browser. Can be:
"zoom"
- Zoom in or out"off"
- Do nothing
If
true
, will stop drag, select and zoom actions occurring
If
true
, track configuration and ordering will be saved inwindow.sessionStorage
/window.localStorage
(defined bystorageType
, below) so that users will see the same display when they refresh the page
The storage object used to save track configuration. Set to
"localStorage"
for permanence.See Mozilla's sessionStorage and localStorage documentation for further details.
The default key used in configuration storage is
"genoverse"
.saveKey
will be appended to this to allow different configurations for different instances of Genoverse.
Determines whether to collapse track messages (toggleable pop-outs on the left side of a track's image) by default when the user interacts with the genome browser
Determines whether to automatically resize tracks to show all their features (can be overridden by
track.autoHeight
)
Determines whether to hide an automatically resized tracks if it has no features, or to show it empty (can be overridden by
track.hideEmpty
)