A data visualization for cancer genomic data.
npm install oncoprintjs
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.npm install --save oncoprintjs
In order to use it, just require it into your script.
const Oncoprint = require('oncoprintjs');
It can also be imported
import Oncoprint from "oncoprintjs";
A full documentation of the API is still pending, but the typescript declarations in dist/js/oncoprint.d.ts may be of use.
git clone https://github.com/cBioPortal/oncoprintjs.git
Install the necessary NPM packages defined in package.json by running:
npm install
Next, build
npm run build
Which will write dist/oncoprint.bundle.js, which is a CommonJS module and can be included using require, or import.
The directory rules/ contains glyph styling specifications that are specific to the genomic alterations use case of Oncoprint, which you may want to use.
yalc (https://github.com/wclr/yalc) is extremely useful for this.
Whenever you have made a change to oncoprintjs you want to bring into another package:
(1) First navigate to the oncoprint directory. Then build:
npm run build
(2) Then "publish" the package locally using yalc
yalc publish
(3) Now go to the directory of your project (e.g. cbioportal-frontend), and add the local package
yalc add oncoprintjs
(4) Install packages again, using npm or yarn. Now, you will be using your local version of oncoprintjs.
(5) When you no longer want to be using the local version of oncoprintjs, simply run
yalc remove oncoprintjs
And run npm or yarn again.
oncoprint.bundle.js, since all of your code will get overwritten when compiled using npm run build. Instead, modify the files in src/ and then re-run npm run build.