-
Notifications
You must be signed in to change notification settings - Fork 44
The following are methods that can be called on an instance of Genoverse
or Genoverse.Track
to perform actions required by UI changes external to the instance (i.e. from the website you have integrated Genoverse into).
Add a number of tracks to the genome browser
Argument Type Description tracks Array An array of Genoverse.Track
class definitions to be addedafter Integer or undefined The existing track after which the new tracks will be inserted. For example, if the existing tracks are [ A, B, C, D, E ]
,genoverse.addTracks([ X, Y ], 2)
will result in[ A, B, X, Y, C, D, E ]
. Ifundefined
, the tracks will be inserted after the existing tracks.
Add a single track to the genome browser
Argument Type Description track Genoverse.Track
classA Genoverse.Track
class definition to be addedafter Integer or undefined See genoverse.addTracks
Remove a number of tracks from the genome browser
Argument Type Description tracks Array An array of existing Genoverse.Track
instances to be removed
Remove a single track from the genome browser
Argument Type Description track Genoverse.Track
instanceAn existing Genoverse.Track
instance to be removed
Add a number of highlighted regions to the genome browser
Argument Type Description tracks Array An array of highlighted regions to be added. See configuration for the structure of highlights.
Add a single highlighted regions to the genome browser
Argument Type Description highlight Object A highlighted region to be added. See configuration for the structure of highlights.
Moves the viewpoint to the region between
start
andend
Argument Type Description chr String or undefined The name of a chromosome defined by genoverse.genome
. Ifgenoverse.genome
is undefined,chr
must be undefined, or the current value ofgenoverse.chr
.start Integer A number between 1
andgenoverse.chromosomeSize
end Integer A number between start
andgenoverse.chromosomeSize
update Boolean or undefined If true
, the URL will be updated with the newstart
andend
keepLength Boolean or undefined if true
, the new viewpoint will have the same zoom level as before (end - start
remains unchanged), centered on the givenstart
andend
.
Resizes the
container
element for the instance of Genoverse
Argument Type Description width Integer The width to resize to, in pixel
Sets
genoverse.dragAction
, determining whether a drag (mousedown, mousemove, mouseup) results in the browser region moving, a region being selected, or nothing
Argument Type Description action "select"
,"scroll"
, or"off"
The value which genoverse.dragAction
will be set to
Sets
genoverse.wheelAction
, determining whether a mousewheel scroll zooms the browser in and out, or does nothing
Argument Type Description action "zoom"
or"off"
The value which genoverse.wheelAction
will be set to
If
track
is a Genoverse.Track instance, closes (hides) all popup menus for that track.If
track
isundefined
, closes all popup menus.
Argument Type Description track Genoverse.Track instance or undefined The object whose popup menus will be closed
Execute functions before or after Genoverse or Genoverse.Track functions
Argument Type Description events String One or more space-separated events. Events are function names with an uppercase first letter, appended to "before" or "after", e.g. "beforeAddTrack" or "afterSetWidth". onTracks "tracks"
orGenoverse.Track
instanceIf present, the callback will be executed on any track in the genome browser. Note that providing a specific track instance does not mean the callback will be executed only for that track. If omitted (i.e. genoverse.on(events, callback)
, the callback will be executed on the instance of Genoverse.callback Function The function to be executed for all of the space-separated events
Execute functions before or after Genoverse or Genoverse.Track functions
Argument Type Description events Object An object whose keys are one or more space-separated events (see above), and whose values are the functions to be executed for those events onTracks "tracks"
orGenoverse.Track
instanceSee above
Like
genoverse.on
, but the functions will only be called one time
Like
genoverse.on
, but the functions will only be called one time
Removes all existing data visualizations, and recreates them
Sets all track heights to their initial values
Removes the instance of Genoverse from the web page
Get or set a property on the track or it's model, view or controller, without needing to know specifically which of these objects the property belongs to. Also available on
track.model
,track.view
, andtrack.controller
with identical functionality.
Argument Type Description key String The name of the property to be returned. value Anything If defined, the value of the property will be set to this argument. If null
, the property will be removed from its object.
Set the track's configuration after initalization
Argument Type Description type String One of the keys in track.configSettings
name String One of the keys in track.configSettings[type]
Set the track's configuration after initalization
Argument Type Description config Object An object in the form { type1: "name1", type2, "name2" }
, where eachtype
andname
fulfills the criteria oftrack.setConfig(type, name)
, above
Remove the track from the genome browser
Hide the track in the genome browser, without removing it
Show the track in the genome browser, if it had previously been disabled
Clears all data stored by the track's models and views, removes the images that have been drawn by the track so far, and then requests new data, and creates new images for the current location in the genome browser
Sets the track's height to its initial value
Changes the name of the track, as displayed in the label to the left of its images.
Argument Type Description name String The name for the track. configName Array or undefined
An array of strings derived from the track's current config