Skip to content
Jim Robinson edited this page May 23, 2016 · 8 revisions

##Browser Control API##

After initialization, the browser can be controlled through the object "igv.browser" using the commands described below.

The igv.browser api (preface commands with igv.browser.)
loadTrack(config)
search(locusOrGene)
zoomIn()
zoomOut()

####loadTrack####

Load and configure a track. See the Tracks page for more detail on configuration options.

igv.browser.loadTrack({
  url: 'http://data.broadinstitute.org/igvdata/1KG/b37/data/HG02450/alignment/HG02450.mapped.ILLUMINA.bwa.ACB.low_coverage.20120522.bam',
  label: 'HG02450'
}

####search####

Search by annotation symbol

igv.browser.search('EGFR')

By default the search function uses a webservice to query positions of RefSeq genes for genome "hg19". This can be overriden during initialization by supplying a url to a custom webservice. For details see Browser initialization.

Additionally, one or more annotation tracks can be used to back the "search" function by setting the searchable property to true. See Tracks for more details.

The search function can also be passed an explicit location, for example

igv.browser.search('chr10:1000-2000')

####zoom####

Zoom in by a factor of 2

igv.browser.zoomIn()

Zoom out by a factor of 2

igv.browser.zoomOut()

Clone this wiki locally