npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

juicebox.js

v2.4.8

Published

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.

Downloads

4

Readme

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/[email protected]/dist/css/juicebox.css">

  • Juicebox javascript -- see below

To import juicebox as an ES6 module

import juicebox from "https://cdn.jsdelivr.net/npm/[email protected]/dist/juicebox.esm.js";

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

<script src="https://cdn.jsdelivr.net/npm/[email protected]/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

  • loadHicFile({url: urlString, name: string})
  • loadTracks([array of track configs...])

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.