Introduction
In Reactome, pathway diagrams are stored using a custom format. Aimming to allow researchers to include images of their favourite pathway diagrams into their publications, posters or presentations, we have developed the diagram exporter. This tool makes it easy to export pathway diagrams in bitmap format, allowing users to specify the output format, the quality and the decorators. The diagram exporter has been deployed as part of our Content Service, which constitutes an easy API that provides access to the Reactome knowledgebase. To learn more about the Content Service and how you can use it, have a look here.
This tutorial will walk you through the simple steps of using this tool to generate images of your favourite pathway diagram.
Get started
Generating the image of a diagram using our API is as easy as just calling the service with the identifier of the diagram and the desired extension (for example ".png", ".jpg" etc.)
/ContentService/exporter/diagram/R-HSA-169911.png
This will export the image in the default quality. To get an image in print quality, use the quality argument. Higher quality value results in higher image quality.
/ContentService/exporter/diagram/R-HSA-169911.png?quality=7
In case the requested pathway has an interactive illustration (EHLD) associated with it, the diagram exporter will export the illustration as an image. In the following example, the EHLD of Hemostasis is requested in png format. Follow this link if you are interested to learn more about our EHLDs.
/ContentService/exporter/diagram/R-HSA-109582.png
If you are interested in a particular reaction or entity, just write it and the service will show it selected in its containing pathway.
/ContentService/exporter/diagram/R-HSA-68919.png
Decorators
The API allows users to easily highlight diagram elements (molecules and reactions) by either selecting them or flagging them. For instance, to select a reaction, we simply need to add the sel argument and its Reactome Identifier, exactly like in the following example.
/ContentService/exporter/diagram/R-HSA-390522.png?sel=R-HSA-390598
We can also use the flg argument to flag diagram entities (genes, molecules, etc.)
/ContentService/exporter/diagram/R-HSA-428359.png?flg=Q9NZI8
The selection and flagging arguments work in exactly the same way for EHLDs.
/ContentService/exporter/diagram/R-HSA-109582.png?sel=R-HSA-983231&flg=THBD
Analysis overlay
Reactome offers a pathway analysis service that supports enrichment and expression analysis. The diagram exporter allows you to overlay the results of the analysis on top of the exported diagrams. To do so, use the token argument to specify the unique token assosiated with the performed analysis. To learn more about our Analysis Service and how to use it have a look to this page.
In the next example, we use the token acquired from an overrepresentation analysis, to overlay the results on top of a diagram and export it in high quality (7) jpeg format.
/ContentService/exporter/diagram/R-HSA-8937144.jpeg?quality=7&token=
In the same way, we can overlay the results of an expression analysis on top of a diagram and export it in our prefered format and quality. In case the submitted sample (for this type of analysis) includes more than one column, we can specify it by using the column argument, like in the following example.
Please keep in mind that in case a column is not specified (null), the first one is selected by default. Also in case a column is not specified and the requested format is gif, then an animated image with all the columns is generated.
/ContentService/exporter/diagram/R-HSA-432047.jpg?quality=7&column=1&token=
Analysis results can also be overlaid on top of our interactive illustrations.
/ContentService/exporter/diagram/R-HSA-69278.png?token=
Animated GIFs
When you run an expression analysis and want to export an animated GIF with a frame per analysis column, set extension to gif and don’t specify column:
/ContentService/exporter/diagram/R-HSA-432047.gif?quality=7&sel=R-ALL-879865&token=
In the same way, you can export animaged gifs of EHLDs
/ContentService/exporter/diagram/R-HSA-69278.gif?quality=7&sel=R-HSA-69242&token=
Color profiles
Reactome provides several color profiles for diagram and analysis. You can use diagramProfile and analysisProfile arguments to modify the default ones.
/ContentService/exporter/diagram/R-HSA-879415.png?quality=7&sel=R-ALL-879865&diagramProfile=standard&analysisProfile=strosobar&token=
Arguments
The folowing table presents a full list of the supported arguments alond with their default values.
Name | Description | Values | Default |
---|---|---|---|
quality |
Quality of the image |
1 - 10 |
5 |
format |
Format of the image |
png, jpg, jpeg, gif |
png |
flags |
List of elements to be flagged |
stId, dbId, identifer, geneName |
null |
selection |
List of elements to be selected |
stId, dbId, identifer, geneName |
null |
diagramProfile |
Color profile for diagram |
modern, standard |
modern |
analysisProfile |
Color profile for analysis |
standard, strosobar, copper plus |
standard |
token |
Analysis token |
String |
null |
column |
The specific expression analysis results column to be overlaid If column is not specified (null), the first one is selected. If column is not specified (null) and format is gif, then an animated gif is generated with all the columns. |
Integers |
null |