Skip to content

Commit

Permalink
grammatical fixes in interacting with viz
Browse files Browse the repository at this point in the history
  • Loading branch information
cornhundred committed Feb 16, 2017
1 parent 9509c0c commit 3ee1cc4
Show file tree
Hide file tree
Showing 71 changed files with 11,132 additions and 54 deletions.
2 changes: 1 addition & 1 deletion docs/_build_html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6d951a9cf5925d085b5d376fd31212d6
config: e22f7d2efb6cf8a09998f298823ed2eb
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/_build_html/.doctrees/app_integration.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/clustergrammer_js.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/clustergrammer_py.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/clustergrammer_web.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/clustergrammer_widget.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/interacting_with_viz.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/license.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/matrix_format_io.doctree
Binary file not shown.
17 changes: 17 additions & 0 deletions docs/_build_html/_sources/app_integration.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _app_integration:

Clustergrammer App Integrations
--------------------------------
Clustergrammer can be integrated into other web applications and is being utilized to visualize data for the following Ma'ayan lab web applications:

- `Enrichr`_
- `GEN3VA`_
- `L1000CDS2`_
- `GEO2Enrichr`_
- `Harmonizome`_

.. _`Enrichr`: http://amp.pharm.mssm.edu/Enrichr/
.. _`GEN3VA`: http://amp.pharm.mssm.edu/gen3va/
.. _`L1000CDS2`: http://amp.pharm.mssm.edu/l1000cds2/
.. _`GEO2Enrichr`: http://amp.pharm.mssm.edu/g2e/
.. _`Harmonizome`: http://amp.pharm.mssm.edu/Harmonizome/
36 changes: 36 additions & 0 deletions docs/_build_html/_sources/biology_specific_features.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _biology_specific_features:

Biology-Specific Features
-------------------------
Clustergrammer was built to visualize high-dimensional biological data (e.g. genome-wide expression data), but can be generally applied to any high-dimensional data (e.g. any matrix). Clustergrammer has several biology-specific features that facilitate analysis of gene-level biological data, such as: gene-expression data, proteomics-data, etc. To take advantage of these features gene-level data (e.g. dimensions) must be given as rows. See `CCLE Explorer`_ for examples of gene-expression data. These features are available in the :ref:`clustergrammer_web` as well as the :ref:`clustergrammer_widget`.

.. _hzome_gene_info:

Mouseover Gene Name and Description
===================================
The human genome consists of over 20,000 genes and modern high-throughput measurements are capable of making measurements across the entire genome (e.g. genome-wide expression studies). Human genes have official gene symbols (e.g. EGFR) that are frequently used to label genes in these datasets. Since no biologist can be knowledgeable about every gene in the genome a common and repetitive task for biologists is looking up the names and descriptions of genes (given as official gene symbols) in a dataset or visualization. To streamline this, Clustergrammer automatically gives the full name and description of a gene (provided by data aggregated through the `Harmonizome`_) as a tooltip when a user mouses over a gene label. This simple feature speeds up analysis of large gene-level datasets.

The JavaScript file `hzome_functions.js`_ provides this functionality by utilizing `Harmonizome's RESTful API`_ to obtain gene names and descriptions on mouseover events. `hzome_functions.js`_ is passed to :ref:`clustergrammer_js` as a callback function. See `load_clustergram.js`_ for an example use case. This method of enhancing :ref:`clustergrammer_js`'s behavior can be extended by developers for other use cases.

Enrichment Analysis
===================
The field of biology has amassed an enormous amount of information about the genes in living organisms such as: function, disease-association, up-stream regulators, protein-level binding partners, etc. Integration of this information can help biologists understand patterns in their data. For instance, enrichment analysis a popular method to identify biological information specific to a list of genes - e.g. a biologist may use enrichment analysis to identify up-stream regulatory transcription factors that specifically target their measured set of up-regulated genes and thereby form hypotheses about potential up-stream regulators in their system.

**Export to Enrichr**

When a user visualizes a matrix with genes as rows, Clustergrammer automatically enables integration with the enrichment analysis tool `Enrichr`_. Users can export their genes of interest to Enrichr using the interactive dendrogram or import enrichment results from Enrichr using the Enrichr tool on the top left.

.. _enrichrgram:

**Enrichrgram**

The JavaScript file `Enrichrgram.js`_ provides this functionality using `Enrichr's RESTful API`_ to generate enrichment results from a list of input genes. `Enrichrgram.js`_ works with the :ref:`clustergrammer_js` API to depict enriched terms and their associated genes as row categories by adding/removing row categories. This general behavior of adding/removing row categories can be extended by developers for other use cases.

.. _`Enrichrgram.js`: https://github.com/MaayanLab/clustergrammer/blob/master/js/Enrichrgram.js
.. _`hzome_functions.js`: https://github.com/MaayanLab/clustergrammer/blob/master/js/hzome_functions.js
.. _`load_clustergram.js`: https://github.com/MaayanLab/clustergrammer/blob/master/js/load_clustergram.js
.. _`CCLE Explorer`: http://amp.pharm.mssm.edu/clustergrammer/CCLE/
.. _`Harmonizome`: http://amp.pharm.mssm.edu/Harmonizome/
.. _`Enrichr`: http://amp.pharm.mssm.edu/Enrichr/
.. _`Enrichr's RESTful API`: http://amp.pharm.mssm.edu/Enrichr/help#api
.. _`Harmonizome's RESTful API`: http://amp.pharm.mssm.edu/Harmonizome/documentation
38 changes: 38 additions & 0 deletions docs/_build_html/_sources/building_webpage.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _building_web_page:

Clustergrammer for Web-development
----------------------------------
Clustergrammer can be used by developers to add interactive heatmap visualizations to their web pages and web applications.

Embedding Clustergrammer
========================

The Clustergrammer web app can be used to produce visualizations that are embedded into another page using an IFrame - see below:
::

<iframe id="iframe_preview" src="http://amp.pharm.mssm.edu/clustergrammer/viz/5734a7399fee36034aeb787e/rc_two_cats.txt" frameborder="0"></iframe>

Users can obtain a permanent link to their visualization by manually uploading their data using the upload section of Clustergrammer-Web's `homepage`_ and copying the URL to the full-screen version of their visualization. Alternatively users can programmatically upload their data using the :ref:`clustergrammer_web_api` and receive their permanent links through the API.


Adding Clustergrammer to a Page
===============================
The Clustergrammer-JS library can be used to generate an interactive visualization in your webpage. Simply include the ``clustergrammer.js`` script in your page and load the pre-calculated :ref:`Clustergrammer-JSON <clustergrammer_json>` to generate a visualization.


Clustergrammer can be used to generate interactive visualizations for your own web application by: using the Clustergrammer.js library on your site, or embedding a visualization provided by the Clustergrammer web app.


The easiest way to generate a visualize of your own data on a webpage is to:

#. follow the :ref:`clustergrammer_py_workflow` to cluster your matrix and generate the front-end JSON
#. then use the :ref:`example_pages` workflow to visualize your calculated JSON

These examples require Clustergrammer's JavaScript and Python libraries:

#. the front-end Clustergrammer.js JavaScript library makes the interactive visualization
#. the back-end Clustergrammer.py Python library clusters a matrix of data and makes the JSON for the front-end

These libraries can be installed npm, ``npm install Clustergrammer``, and pip, ``pip install clustergrammer``, respectively.

.. _`homepage`: http://amp.pharm.mssm.edu/clustergrammer
15 changes: 15 additions & 0 deletions docs/_build_html/_sources/case_studies.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _case_studies:

Case Studies
------------
Clustergrammer was built to visualize biological data but is applicable for visualizing high-dimensional data in general. Below are links to several example use cases for Clustergrammer:

- `Cancer Cell Line Encyclopedia Gene Expression Data`_
- `Zika Virus RNA-seq Data Visualization`_
- `Iris flower dataset`_
- `MNIST Handwritten Digit Dataset`_

.. _`Cancer Cell Line Encyclopedia Gene Expression Data`: http://amp.pharm.mssm.edu/clustergrammer/CCLE/
.. _`Zika Virus RNA-seq Data Visualization`: http://nbviewer.jupyter.org/github/maayanlab/Zika-RNAseq-Pipeline/blob/master/Zika.ipynb
.. _`Iris flower dataset`: http://nbviewer.jupyter.org/github/MaayanLab/iris_clustergrammer_visualization/blob/master/Iris%20Dataset.ipynb
.. _`MNIST Handwritten Digit Dataset`: https://maayanlab.github.io/MNIST_heatmaps/
96 changes: 96 additions & 0 deletions docs/_build_html/_sources/clustergrammer_js.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.. _clustergrammer_js:

Clustergrammer-JS
-----------------
|npm-version|
|license|

Clustergrammer-JS is the front-end JavaScript library that builds the interactive heatmap visualization in `SVG`_ using the visualization library `D3.js`_


Dependencies
============

- `D3.js`_
- `JQuery`_
- `Underscore`_

Installation
============
Clustergrammer.js can be installed using node package manager (`npm package`_) with the following:
::

npm install clustergrammer

or the source code and library, ``clustergrammer.js``, can be obtained from the `clustergrammer`_ GitHub repo.

.. _javascript_workflow_example:

JavaScript Workflow Example
============================
This workflow shows how to make a visualization using a JSON produced by Clustergrammer.py
::

// load visualization JSON to network_data
var args = {
'root': '#id_of_container',
'network_data': 'network_data'
}

var cgm = Clustergrammer(args);

The id of the container where the visualization will be made is passed as ``root`` (this root container must be made by the user). The visualization JSON contains the information necessary to make the visualization and is passed as ``network_data``. See the Clustergrammer.js API for additional arguments that can be passed to Clustergrammer.js.

.. _example_pages:

Example Pages
=============
The `clustergrammer`_ contains several example pages demonstrating how to make a webpage with a Clustergrammer heatmap. The page `index.html`_ and corresponding script `load_clustergram.js`_ show how to make a full-screen resizable visualization.

The page `multiple_clust.html`_ and corresponding script `load_multiple_clustergrams.js`_ show how to visualize multiple clustergrams on one page. Note that each heatmap requires its own container.

.. _clustergrammer_js_api:

Clustergrammer-JS API
=====================
Clustergrammer-JS' API allows users to pass options to the front-end visualization, such as optional callback functions.

.. _clustergrammer_json:

Clustergrammer-JSON
===================
The JSON format required for Clustergrammer.js is described here:

.. _clustergrammer_js_dev:

Clustergrammer-JS Development
=============================
Clustergrammer-JS' source code can be found in the `clustergrammer`_ GihHub repo. The Clustergrammer-JS library is utilized by the :ref:`clustergrammer_web` and the :ref:`clustergrammer_widget`.

Clustergrammer-JS is built with `Webpack Module Bundler`_ from the source files in `src`_.

Please :ref:`contact` Nicolas Fernandez or Avi Ma'ayan with questions or use the GitHub `issues`_ feature to raise an issue.

.. _`SVG`: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
.. _`clustergrammer`: https://github.com/MaayanLab/clustergrammer
.. _`npm package`: https://www.npmjs.com/package/clustergrammer
.. _`index.html`: https://github.com/MaayanLab/clustergrammer/blob/master/index.html
.. _`load_clustergram.js`: https://github.com/MaayanLab/clustergrammer/blob/master/js/load_clustergram.js
.. _`multiple_clust.html`: https://github.com/MaayanLab/clustergrammer/blob/master/multiple_clustergrams.html
.. _`load_multiple_clustergrams.js`: https://github.com/MaayanLab/clustergrammer/blob/master/js/load_multiple_clustergrams.js
.. _`D3.js`: https://d3js.org/
.. _`JQuery`: https://jquery.com/
.. _`Underscore`: http://underscorejs.org/
.. _`Webpack Module Bundler`: https://webpack.github.io/
.. _`src`: https://github.com/MaayanLab/clustergrammer/tree/master/src
.. _`issues`: https://github.com/MaayanLab/clustergrammer/issues

.. |npm-version| image:: https://img.shields.io/npm/v/clustergrammer.svg
:alt: version
:scale: 100%
:target: https://www.npmjs.com/package/clustergrammer

.. |license| image:: https://img.shields.io/npm/l/clustergrammer.svg
:alt: license
:scale: 100%
:target: https://github.com/MaayanLab/clustergrammer/blob/master/LICENSES/LICENSE
72 changes: 72 additions & 0 deletions docs/_build_html/_sources/clustergrammer_py.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _clustergrammer_py:

Clustergrammer-PY
-----------------
|pypi-version|

Clustergrammer-PY is the back-end Python library that is used to hierarchically cluster the data and generate the JSON for the front-end Clustergrammer.js visualization library. Clustergrammer-PY is compatible with Python 2 and 3.

Dependencies
============

- `Numpy`_
- `SciPy`_
- `Pandas`_

Installation
============
Clustergrammer-PY can be installed using pip (`package index`_) with the following:
::

pip install clustergrammer

or the source code can be obtained from the `GitHub repo`_.

.. _clustergrammer_py_workflow:

Python Workflow Example
=======================
This workflow shows how to cluster a matrix of data and generate a visualization JSON (for use by Clustergrammer.js) from a matrix file:
::

# make network object
from clustergrammer import Network
net = Network()

# load matrix file
net.load_file('your_matrix.txt')

# calculate clustering using default parameters
net.make_clust()

# write visualization JSON to file
net.write_json_to_file('viz', 'mult_view.json')

The file ``mult_view.json`` will be loaded by the front-end and used to build the interactive visualization.

.. _clustergrammer_py_api:

Clustergrammer-PY API
=====================
Clustergrammer-PY generates a Network object, which is used to load a matrix (e.g. from a Pandas DataFrame), normalize/filter the matrix, cluster the matrix, and finally generate the visualization JSON for the front-end Clustergrammer.js.

.. _clustergrammer_py_dev:

Clustergrammer-PY Development
=============================
Clustergrammer-PY's source code can be found in the `clustergrammer-py`_ GitHub repo. The Clustergrammer-PY library is utilized by the :ref:`clustergrammer_web` and the :ref:`clustergrammer_widget`.

Please :ref:`contact` Nicolas Fernandez or Avi Ma'ayan with questions or use the GitHub `issues`_ feature to raise an issue.

.. _`GitHub repo`: http://github.com/MaayanLab/clustergrammer-py
.. _`package index`: https://pypi.python.org/pypi?:action=display&name=clustergrammer
.. _`clustergrammer-py`: https://github.com/MaayanLab/clustergrammer-py
.. _`issues`: https://github.com/MaayanLab/clustergrammer-py/issues
.. _`Pandas`: http://pandas.pydata.org/
.. _`Numpy`: http://www.numpy.org/
.. _`SciPy`: https://www.scipy.org/

.. |pypi-version| image:: https://img.shields.io/pypi/v/clustergrammer.svg
:alt: version
:scale: 100%
:target: https://pypi.python.org/pypi?:action=display&name=clustergrammer
66 changes: 66 additions & 0 deletions docs/_build_html/_sources/clustergrammer_web.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _clustergrammer_web:

Clustergrammer Web App
----------------------
|github-version|

The Clustergrammer web application (referred to as Clustergrammer-Web) enables users to easily generate interactive and shareable heatmap visualizations.

.. _clustergrammer_web_upload:

Uploading Data through the Homepage
====================================

**<add-screenshot upload screenshots>**


.. _clustergrammer_web_viz:

Clustergrammer-Web Visualization
================================
Uploading a matrix to Clustergrammer-Web will redirect the user to a new permanent and shareable page with three views of their data:

#. clustered heatmap view of their matrix
#. clustered similarity matrix of the columns in their original matrix
#. clustered similarity matrix of the rows in their original matrix

.. _clustergrammer_web_api:

Clustergrammer-Web API
======================
Clustergrammer-Web's RESful API enables users to programmatically generate visualizations. The API can be useful for users that need to generate many clustergrams or developers that need to automatically generate visualizations for their own web application.

*Matrix Upload*

Users can post a matrix file to Clustergrammer-Web using the endpoint
::

http://amp.pharm.mssm.edu/clustergrammer/matrix_upload/

and receive a permanent link to their visualization. Below is an example in Python 2.7 showing the post request and how to obtain the link from the response object:
::

import requests

filename = 'example_matrix.txt'
upload_url = 'http://amp.pharm.mssm.edu/clustergrammer/matrix_upload/'

r = requests.post(upload_url, files={'file': open(filename, 'rb')})

link = r.text

.. _clustergrammer_web_dev:

Clustergrammer-Web Development
==============================
Clustergrammer-Web is a `dockerized`_ web application built using the Python library `Flask`_. Clustergrammer-Web uses the :ref:`clustergrammer_js` and :ref:`clustergrammer_py` libraries and the source code can be found in the `clustergrammer-web`_ GitHub repo.


.. _`Flask`: http://flask.pocoo.org/
.. _`dockerized`: https://docs.docker.com/
.. _`clustergrammer-web`: https://github.com/MaayanLab/clustergrammer-web/

.. |github-version| image:: https://img.shields.io/github/release/MaayanLab/clustergrammer-web.svg
:alt: version
:scale: 100%
:target: https://github.com/MaayanLab/clustergrammer-web

0 comments on commit 3ee1cc4

Please sign in to comment.