Git Product home page Git Product logo

igv.js's Introduction

igv.js

build

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.

Release Notes

Examples

Alignments

Interactions

Copy number

Multiple regions

Mutation Annotation Format (MAF)

Variant color options

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/[email protected]/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/[email protected]/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 build

This creates a dist folder with the following files

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

Tests

To run the tests from the command line

npm run test

Examples

To run the examples install http-server.

Start http-server from the project root directory

npx http-server 

Then open http://localhost:8080/examples in a web browser.

Supported Browsers

igv.js require a modern web browser with support for Javascript ECMAScript 2015.

License

igv.js is MIT licensed.

igv.js's People

Contributors

jrobinso avatar turner avatar khadley avatar bw2 avatar skushch avatar eweitz avatar ishanley avatar david-ma avatar romanzenka avatar helgathorv avatar romgrk avatar brianjohnhaas avatar zoecastillo avatar vrockai avatar jmtcsngr avatar pratibha-strand avatar mschroering avatar llincoln3 avatar kaushik51094 avatar davideby avatar blajoie avatar docwarren avatar anderspitman avatar adamkewley avatar lukasjelonek avatar mikeas1 avatar schwarzmarek avatar sehilyi avatar roadroller avatar liefeld avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.