2.4.8 • Published 11 months ago

juicebox.js v2.4.8

Weekly downloads
72
License
MIT
Repository
github
Last release
11 months ago

juicebox.js

juicebox.js is an embeddable interactive contact map viewer for .hic files written in JavaScript and CSS. It is based on the desktop Juicebox visualization application.

Installation

Requirements:

  • Font Awesome CSS

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">

  • Juicebox CSS

    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/juicebox.js@2.4.8/dist/css/juicebox.css">

  • Juicebox javascript -- see below

To import juicebox as an ES6 module

import juicebox from "https://cdn.jsdelivr.net/npm/juicebox.js@2.4.8/dist/juicebox.esm.js";

Or as a script include (defines the "juicebox" global)

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

Alternatively you can install with npm

npm install juicebox

and source the appropriate file for your module system (juicebox.min.js or juicebox.esm.js) in node_modules/juicebos.js/dist. Or build from source (see Development section below).

Usage

To create an juicebox instance call juicebox.init with a container div and an initial configuration object as illustrated below.

   juicebox.init(container, config)
       .then(function (hicBrowser) {
            console.log("Juicebox loaded");
        })

Configuration config object examples follow

   const config = {
       "url": "https://hicfiles.s3.amazonaws.com/hiseq/gm12878/dilution/combined.hic",    
   }
  • Juicebox config with contact map, gene annotations, CTCF wig track, and 2D annotations (see examples/juicebox.html):
   const config = {
            "url": "https://hicfiles.s3.amazonaws.com/hiseq/gm12878/dilution/combined.hic",
            "name": "Combined",
            "locus": "18:28,504,357-29,748,974 18:28,504,357-29,748,974",
            "normalization": "VC_SQRT",
            "backgroundColor": "255,255,255",
            "colorScale": "60,255,0,0",
            "tracks": [
                {
                    "url": "https://www.encodeproject.org/files/ENCFF144KUK/@@download/ENCFF144KUK.bigWig",
                    "type": "wig",
                    "format": "bigwig",
                    "name": "Homo sapiens GM12878 CTCF "
                    "color": "green"
                },
                {
                    "url": "https://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/ncbiRefSeq.txt.gz",
                    "type": "annotation",
                    "format": "refgene",
                    "name": "Refseq Genes",
                },
                {
                    "url": "https://hicfiles.s3.amazonaws.com/hiseq/gm12878/in-situ/combined_peaks.txt",
                    "name": "Rao & Huntley et al. | Cell 2014 | GM12878 combined loops"
                },
                {
                    "url": "https://hicfiles.s3.amazonaws.com/hiseq/hap1/in-situ/combined_peaks.txt",
                    "name": "Sanborn & Rao et al. | PNAS 2015 | Hap1 loops",
                    "color": "#fffa03",
                    "displayMode": "upper"
                },
                {
                    "url": "https://hicfiles.s3.amazonaws.com/external/mumbach/GSE80820_HiChIP_GM_cohesin_peaks.txt",
                    "name": "Mumbach Rubin Flynn et al. | Nature Methods 2016 | GM12878 cohesin combined loops",
                    "color": "#000000",
                    "displayMode": "lower"
                }
            ]
        }

API

The juicebox.init function returns a promise for a HICBrowser object. This object exposes functions for interacting with the viewer including

For a description of track configurations see the documentation for igv.js. Example of a basic track configuration object:

See examples/juicebox-api.html for an example of using the API to load hicfiles and tracks.

Development

Requirements

Building juicebox.js requires Linux or MacOS, and node.js.

Other Unix environments will probably work but have not been tested. Windows users can use Windows Subsystem for Linux.

Building

git clone https://github.com/igvteam/juicebox.js.git
cd juicebox.js
npm install
npm run build

This creates a dist folder with the following files

  • juicebox.js - ES5 compatible file. A script include will define the "juicebox" global.
  • juicebox.min.js - minified version of juicebox.js
  • juicebox.esm.js -- ES6 module
  • css -- folder containing required css file juicebox.css and associated images

Supported Browsers

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

Juicebox-web

For an out-of-the box web application for viewing and sharing contact maps from .hic files see Juicebox-web, a web application embedding a juicebox.js viewer.

License

juicebox.js is MIT licensed.

2.4.7

11 months ago

2.4.8

11 months ago

2.4.1

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.5

1 year ago

2.4.4

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.4.0

1 year ago

2.3.1

1 year ago

2.2.5

1 year ago

2.2.4

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

3 years ago

2.1.13

3 years ago

2.1.12

3 years ago

2.1.11

3 years ago

2.1.10

3 years ago

2.1.9

3 years ago

2.1.8

3 years ago

2.1.7

3 years ago

2.1.6

3 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.5.0-rc.3

4 years ago

1.5.0-rc.2

4 years ago

1.4.2

5 years ago

1.4.0

5 years ago

1.3.9

5 years ago

0.9.8

6 years ago