Skip to content
Embeddable genomic visualization component based on the Integrative Genomics Viewer
Branch: master
Clone or download
SchwarzMarek and jrobinso show strand marks on all features (#876)
Adds strand/direction (>/<) mark to all features.
Reverse strand must be explicitly specified.
If nothing is specified no strand mark added.
Latest commit fa8b689 Mar 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
dev
doc Use simplified referenceFrame object locuschange event. Jan 2, 2019
examples Add parser for ad-hoc "gtexgwas" format. See issue #874 Mar 16, 2019
img
js show strand marks on all features (#876) Mar 20, 2019
php
resources Web app (#826) Dec 16, 2018
test
vendor Update cram-bundle to handle missing content-range header. See # Jan 17, 2019
wrapper Adjust build process to keep non-transpiled non-minified "igv.js". Fixes Feb 13, 2019
.gitignore Alert Dialog. Layout fixes. (#836) Jan 15, 2019
.travis.yml Implement continuous integration (#732) Sep 11, 2018
Gruntfile.js
LICENSE
README.md
embed.html use igv.min in embed.html Jan 12, 2019
index.html
package-lock.json
package.json 2.2.5 Feb 20, 2019
webpack.config.js

README.md

igv.js

Build Status

igv.js is an embeddable interactive genome visualization component developed by the Integrative Genomics Viewer (IGV) team.

Below are examples and a quickstart guide.
See the Wiki for more documentation.

Examples

Alignments

Copy number

Multiple regions

More

Quickstart

Installation

igv.js consists of a single javascript file with no external dependencies. To link directly to the current release copy this snippet

<script src="https://cdn.jsdelivr.net/npm/igv@2.2.5/dist/igv.min.js"></script>

Pre-built files for ES5 (igv.min.js) and ES6 (igv.esm.min.js) can be downloaded from https://cdn.jsdelivr.net/npm/igv@2.2.5/dist/.

Alternatively you can install with npm

npm install igv

and source the appropriate file for your module system (igv.min.js or igv.esm.min.js) in node_modules/igv/dist.

To use igv.js include it with a script tag

<script src="igv.min.js/>

or import it as a requirejs module

requirejs(['igv.min'], function (igv) {...} (see examples/igv-require.html)

or import it as an es6 module

import igv from 'igv.esm.min.js' (see examples/igv-esm.html)

Usage

To create an igv.js browser supply a container div and an initial configuration defining the reference genome, initial tracks, and other state to the function igv.createBrowser(div, config).

This function returns a promise for an igv.Browser object which can used to control the browser. For example, to open a browser on a single alignment track opened at a specific locus:

      var igvDiv = document.getElementById("igv-div");
      var options =
        {
            genome: "hg38",
            locus: "chr8:127,736,588-127,739,371",
            tracks: [
                {
                    "name": "HG00103",
                    "url": "https://s3.amazonaws.com/1000genomes/data/HG00103/alignment/HG00103.alt_bwamem_GRCh38DH.20150718.GBR.low_coverage.cram",
                    "indexURL": "https://s3.amazonaws.com/1000genomes/data/HG00103/alignment/HG00103.alt_bwamem_GRCh38DH.20150718.GBR.low_coverage.cram.crai",
                    "format": "cram"
                }
            ]
        };

        igv.createBrowser(igvDiv, options)
                .then(function (browser) {
                    console.log("Created IGV browser");
                })

For more details see the Wiki for full documentation of the API.

Development

Requirements

Building igv.js and running the examples require Linux or MacOS. Other Unix environments will probably work but have not been tested.

Windows users can use Windows Subsystem for Linux.

Building

Building igv.js and running the examples requires node.js.

git clone https://github.com/igvteam/igv.js.git
cd igv.js
npm install
npm run grunt

This creates a dist folder with the following files

  • igv.min.js - ES5 compatible UMDS file for script include, AMD, or CJS modules. A script include will define an "igv" global.
  • igv.esm.min.js -- ES6 module

Tests

To run the tests from the command line

    grunt test

To run the tests in a browser start an http-server

npm run http-server

Then open http://localhost:8080/test/runTests.html.

Examples

To run the examples start an http-server

npm run http-server

Then open http://localhost:8080/index.html.

Supported Browsers

igv-webapp and igv.js require a modern web browser with support for Javascript ECMAScript 2015. We test on the latest versions of Chrome, Safari, Firefox, and Edge. Internet Explorer (IE) is not supported.

License

igv.js is MIT licensed.

You can’t perform that action at this time.