Heatmap ================================ InterMine makes use of canvasXpress `heatmap `_ to visualize gene expression data. `CanvasXpress `_ is a javascript library based on the `` tag implemented in HTML5. It is written by Isaac Neuhausi. Hierarchical and k-Means clustering algorithms and zoom in/out functionality have been implemented within the heatmap. An example in modMine ---------------------------------- .. note:: The last release of modMine is from 2014, the site is now maintained by the `ENCODE group `_ at Stanford University and the legacy software is available on `GitHub `_. An example application of the tool is in `modMine `_. It visualizes fly expression data (`example `_) generated from `modENCODE project `_. The raw data is parsed and converted to InterMine objects. In a Struts controller, the expression data will be fetched by running a InterMine path query and parsed to JSON string. The JSON string will be sent to a JSP page by a http request to feed into heatmap. Expression data source: an data loader example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `FlyExpressionScoreConverter `_ is a specific data converter for modENCODE fly expression data. Expression data type is an extension of InterMine core model. This example can be found `here `_ and in the block below: .. code-block:: xml # modmine/dbmodel/resources/modencode-metadata_additions.xml Please note that it is now recommended to add the model extension to a source specific additions.xml under a source directory, rather than to a general "additions" file. Controller ~~~~~~~~~~~~~~~~~~~ The controller class `HeatMapController `_ is a component of `Struts MVC framework `_. It holds the logic to process user requests. In HeatMapController, a query is run to fetch expression scores from database (ref method `queryExpressionScore`), then the results are parsed to JSON string (ref method `getJSONString`) and set in the request (ref method `findExpression`). Struts config: .. code-block:: xml # modmine/webapp/resources/struts-config-model.xml # modmine/webapp/resources/tiles-defs-model.xml Web page ~~~~~~~~~~~~~~~~~~~ In modMine we have two separate heatmaps, one for cell line and one for developmental stage. `heatMap.jsp `_ displays the heatmaps. canvasXpress object takes the expression JSON string and other parameters to create the heatmaps. jQuery is used to adjust page layout. Alternatives ------------ A more up to date way of creating widget like heatmaps takes advantage of the InterMine webservices framework to query and generate JSON strings and embed the heatmap on any web page. Please check some examples of the tecnique `here `_ An alternative, and more general, library is `D3.js `_, an example of heatmap can be found `here `_. `ThaleMine `_ used to display a couple of such D3 implementations, and the code is still available `here `_.