Name: oncoprintjs
Owner: cBioPortal
Description: OncoPrint visualization
Created: 2014-12-15 18:25:58.0
Updated: 2017-12-17 15:45:18.0
Pushed: 2018-01-11 18:36:11.0
Homepage: null
Size: 1168
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is the library that generates the Oncoprint visualization in cBioPortal. Essentially, it populates a canvas of a grid of m
tracks of n
types, where each element can either be a discrete value represented by a colored glyph on a grey background or a continuous value within a color range. Oncoprint can have many conceivable uses, but in cBioPortal, it is primarily used to visualize tracks of m
genes and n
patient samples, where the colored glyphs represent genomic alterations. It is also used to display a heatmap of gene and/or protein expression values for those m
genes and n
patient samples.
Oncoprint is on NPM. To install:
npm install --save oncoprintjs
In order to use it, just require
it into your script.
const Oncoprint = require('oncoprintjs');
This will load the Oncoprint
prototype into your environment. A full documentation of the API is still pending, but to see the basic usage in action, please follow the instructions below and take a look at the examples in the test/
directory.
First, clone the repo:
git clone https://github.com/cBioPortal/oncoprintjs.git
Install the necessary NPM packages defined in package.json
by running:
npm install
Next, execute
webpack
Which will write dist/oncoprint.bundle.js
, which is a CommonJS module and can be included using require
.
The directory rules/
contains glyph styling specifications that are specific to the genomic alterations use case of Oncoprint, which you may want to use.
If you make changes to the Oncoprint code base and want to load it into the examples, do not modify oncoprint.bundle.js
, since all of your code will get overwritten when compiled using webpack
. Instead, modify the files in src/
and then re-run webpack
.
The test/
folder holds the code that runs the examples. All examples are mounted in index.html
, which contains one JS file per example.
WARNING: THESE MAY NOT BE UP TO DATE AND MAY NOT WORK.
The file server.js
starts the basic node server, serving files from dist/
, rules/
, and test/
on port 3000. To see the examples, execute the following:
node server.js
Note: These examples are very oversimplified versions of what is used in production versions of cBioPortal and are only meant to test code paths and give a sense of how the API connects together.