Skip to content

A Jupyter Python widget using the Clustergrammer JavaScript front-end and Python back end.

Notifications You must be signed in to change notification settings

OscarGarciaPeinado/clustergrammer-widget

 
 

Repository files navigation

Clustergrammer-Widget

This is a Jupyter/IPython interactive widget implementation of the interactive heatmap tool Clustergrammer. The front-end visualization, clustergrammer.js is built using D3.js and the back-end, clustergrammer.py is built in Python.

demo_screenshot

Installation

To install use pip:

# python installation
$ pip install clustergrammer_widget

# enable widgetsnbextension
jupyter nbextension enable --py --sys-prefix widgetsnbextension

# enable widget
jupyter nbextension enable --py --sys-prefix clustergrammer_widget

Dependencies

  • Numpy
  • Scipy
  • Pandas

Clustergrammer-widget is compatable with Python 2 and 3.

Example Workflow

The Clustergrammer-widget can be used to visualize a matrix of your data in the TSV format described here.

Within the Jupyter/IPython notebook the widget can be run using the following commands

# import the widget
from clustergrammer_widget import *
from copy import deepcopy

# load data into new network instance and cluster
net = deepcopy(Network())
net.load_file('rc_two_cats.txt')
net.make_clust()

# view the results as a widget
clustergrammer_notebook(network = net.export_net_json())

Development Installation

For a development installation (requires npm),

$ git clone https://github.com/maayanlab/clustergrammer-widget.git
$ cd clustergrammer-widget
$ pip install -e .
$ jupyter nbextension install --py --symlink --user clustergrammer-widget
$ jupyter nbextension enable --py --user clustergrammer-widget

About

A Jupyter Python widget using the Clustergrammer JavaScript front-end and Python back end.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 74.4%
  • JavaScript 22.2%
  • Jupyter Notebook 3.0%
  • HTML 0.2%
  • C 0.1%
  • Smarty 0.1%