Class Index | File Index

Classes


Class Browser

This class is the main interface between JBrowse and embedders
Defined in: Browser.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Browser(params)
Construct a new Browser object.
Method Summary
Method Attributes Method Name and Description
 
addConfigData(config_data)
Merge in some additional configuration data.
 
Add a function to be executed once JBrowse is initialized
 
addRecentlyUsedTracks(trackLabels)
Add the given list of tracks as being recently used.
 
addRefseqs(refSeqs)
 
Wrapper for dojo.cookie that namespaces our cookie names by prefixing them with this.config.containerID.
 
fatalError(error)
Displays links to configuration help in the main window.
 
Instantiate the right config adaptor for a given configuration source.
 
Get the list of the most recently used tracks, stored for this user in a cookie.
 
Key event handler that implements all global keyboard shortcuts.
 
 
Load our configuration file(s) based on the parameters thex constructor was passed.
 
Load our name index.
 
 
 
 
navigate to a given location
 
 
 
Event that fires when the reference sequences have been loaded.
 
 
 
Reports some anonymous usage statistics about this browsing instance.
 
Given a string name, search for matching feature names and set the view location to any that match.
 
Create a global keyboard shortcut.
 
showTracks(trackNameList)
load and display the given tracks
 
 
Examine the loaded and merged configuration for errors.
 
 
Class Detail
Browser(params)
Construct a new Browser object.
Parameters:
params
an object with the following properties:
  • config - list of objects with "url" property that points to a config JSON file
  • containerID - ID of the HTML element that contains the browser
  • refSeqs - object with "url" property that is the URL to list of reference sequence information items
  • browserRoot - (optional) URL prefix for the browser code
  • tracks - (optional) comma-delimited string containing initial list of tracks to view
  • location - (optional) string describing the initial location
  • defaultTracks - (optional) comma-delimited string containing initial list of tracks to view if there are no cookies and no "tracks" parameter
  • defaultLocation - (optional) string describing the initial location if there are no cookies and no "location" parameter
  • show_nav - (optional) string describing the on/off state of navigation box
  • show_tracklist - (optional) string describing the on/off state of track bar
  • show_overview - (optional) string describing the on/off state of overview
Method Detail
addConfigData(config_data)
Merge in some additional configuration data. Properties in the passed configuration will override those properties in the existing configuration.
Parameters:
{Object} config_data

addDeferred(f)
Add a function to be executed once JBrowse is initialized
Parameters:
f
function to be executed

addRecentlyUsedTracks(trackLabels)
Add the given list of tracks as being recently used.
Parameters:
trackLabels
{Array[String]} array of track labels to add

addRefseqs(refSeqs)
Parameters:
refSeqs
{Array} array of refseq records to add to the browser

cookie()
Wrapper for dojo.cookie that namespaces our cookie names by prefixing them with this.config.containerID. Has one additional bit of smarts: if an object or array is passed instead of a string to set as the cookie contents, will serialize it with dojo.toJson before storing.
Parameters:
... Optional
same as dojo.cookie
Returns:
the new value of the cookie, same as dojo.cookie

fatalError(error)
Displays links to configuration help in the main window. Called when the main browser cannot run at all, due to configuration errors or whatever.
Parameters:
error

{Object} getConfigAdaptor(config)
Instantiate the right config adaptor for a given configuration source.
Parameters:
{Object} config
the configuraiton
Returns:
{Object} the right configuration adaptor to use, or undefined if one could not be found

{Array[Object]} getRecentlyUsedTracks()
Get the list of the most recently used tracks, stored for this user in a cookie.
Returns:
{Array[Object]} as [{ time: (integer), label: (track label)}]

globalKeyHandler(evt)
Key event handler that implements all global keyboard shortcuts.
Parameters:
evt

initView()

loadConfig()
Load our configuration file(s) based on the parameters thex constructor was passed. Does not return until all files are loaded and merged in.
Returns:
nothing meaningful

loadNames()
Load our name index.

loadRefSeqs()

makeBookmarkLink(area)
Parameters:
area

makeHelpDialog()

navigateTo(loc)
navigate to a given location
gb=dojo.byId("GenomeBrowser").genomeBrowser
gb.navigateTo("ctgA:100..200")
gb.navigateTo("f14")
Parameters:
loc
can be either:
<chromosome>:<start> .. <end>
<start> .. <end>
<center base>
<feature name/ID>

navigateToLocation(location)
Parameters:
location

onConfigLoaded()

onRefSeqsLoaded()
Event that fires when the reference sequences have been loaded.

onResize()

publish()

reportUsageStats()
Reports some anonymous usage statistics about this browsing instance. Currently reports the number of tracks in the instance and their type (feature, wiggle, etc), and the number of reference sequences and their average length.

searchNames(loc)
Given a string name, search for matching feature names and set the view location to any that match.
Parameters:
{String} loc

setGlobalKeyboardShortcut(keychar)
Create a global keyboard shortcut.
Parameters:
keychar
the character of the key that is typed
... Optional
additional arguments passed to dojo.hitch for making the handler

showTracks(trackNameList)
load and display the given tracks
gb=dojo.byId("GenomeBrowser").genomeBrowser
gb.showTracks(["DNA","gene","mRNA","noncodingRNA"])
Parameters:
trackNameList
{Array|String} array or comma-separated string of track names, each of which should correspond to the "label" element of the track information

subscribe()

validateConfig()
Examine the loaded and merged configuration for errors. Throws exceptions if it finds anything amiss.
Returns:
nothing meaningful

{String} visibleRegion()
Returns:
{String} locstring representation of the current location
(suitable for passing to navigateTo)

{Array[String]} visibleTracks()
Returns:
{Array[String]} of the names of currently-viewed tracks (suitable for passing to showTracks)

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jun 14 2012 17:43:45 GMT-0400 (EDT)