Class Browser
This class is the main interface between JBrowse and embedders
Defined in: Browser.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Browser(params)
Construct a new Browser object.
|
Method Attributes | Method Name and Description |
---|---|
addConfigData(config_data)
Merge in some additional configuration data.
|
|
addDeferred(f)
Add a function to be executed once JBrowse is initialized
|
|
addRefseqs(refSeqs)
|
|
fatalError(error)
Displays links to configuration help in the main window.
|
|
getConfigAdaptor(config)
Instantiate the right config adaptor for a given configuration source.
|
|
initView()
|
|
Load our configuration file(s) based on the parameters thex
constructor was passed.
|
|
Load our name index.
|
|
makeBookmarkLink(area)
|
|
navigateTo(loc)
navigate to a given location
|
|
navigateToLocation(location)
|
|
Event that fires when the reference sequences have been loaded.
|
|
onResize()
|
|
searchNames(loc)
|
|
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 filecontainerID
- ID of the HTML element that contains the browserrefSeqs
- object with "url" property that is the URL to list of reference sequence information itemsbrowserRoot
- (optional) URL prefix for the browser codetracks
- (optional) comma-delimited string containing initial list of tracks to viewlocation
- (optional) string describing the initial locationdefaultTracks
- (optional) comma-delimited string containing initial list of tracks to view if there are no cookies and no "tracks" parameterdefaultLocation
- (optional) string describing the initial location if there are no cookies and no "location" parametershow_nav
- (optional) string describing the on/off state of navigation boxshow_tracklist
- (optional) string describing the on/off state of track barshow_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
addRefseqs(refSeqs)
- Parameters:
- refSeqs
- {Array} array of refseq records to add to the browser
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
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()
searchNames(loc)
- Parameters:
- loc
showTracks(trackNameList)
load and display the given tracks
gb=dojo.byId("GenomeBrowser").genomeBrowser gb.showTracks("DNA,gene,mRNA,noncodingRNA")
- Parameters:
- trackNameList
- {String} comma-delimited string containing track names, each of which should correspond to the "label" element of the track information dictionaries
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)
{String}
visibleTracks()
- Returns:
- {String} containing comma-separated list of currently-viewed tracks
(suitable for passing to showTracks)