AmiGO Manual: Visualize: Difference between revisions

From GO Wiki
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by one other user not shown)
Line 19: Line 19:
* "border": The border color around the text of the node.
* "border": The border color around the text of the node.


The body tag should be able to take simple psuedo-HTML as GraphViz does.
While the body tag should be able to take simple psuedo-HTML as [http://www.graphviz.org/doc/info/shapes.html#html GraphViz does], the HTML support in GraphViz is fiddly (e.g. spaces *do count* and some tags don't work in certain combinations)--it takes a little experimentation.


===Example JSON===
===Example JSON===
Line 46: Line 46:
The AmiGO "Visualize" page is essentially a light wrapper around a RESTful graphing component. The API for it, such as it is, should be fairly stable (at least it hasn't changed in a while), but it may be changed later on. If you're writing an application to use this, please keep it flexable as there may be sudden, and for a period of time undocumented, changes.
The AmiGO "Visualize" page is essentially a light wrapper around a RESTful graphing component. The API for it, such as it is, should be fairly stable (at least it hasn't changed in a while), but it may be changed later on. If you're writing an application to use this, please keep it flexable as there may be sudden, and for a period of time undocumented, changes.


This section aims to describe the current RESTful calls as they exist now (AmiGO 1.8). The base URL will always be assumed to be:
This section aims to describe the current RESTful calls as they exist now (AmiGO 1.8). The base URL will always be assumed to be production:


  http://amigo.geneontology.org/cgi-bin/amigo/visualize
  http://amigo.geneontology.org/cgi-bin/amigo/visualize


or
or labs:


  http://amigo.berkeleybop.org/cgi-bin/amigo/visualize
  http://amigo.berkeleybop.org/cgi-bin/amigo/visualize
or amigo2:
http://amigo2.berkeleybop.org/cgi-bin/amigo2/amigo/visualize


with the arguments described below.
with the arguments described below.
Line 71: Line 75:


Allow a richer API to view multiple terms at the same time, as well as have the ability to specify elements in the graph. Currently, "basic", "multi", and "advanced" are synonyms, but different functionality may be put in in the future.
Allow a richer API to view multiple terms at the same time, as well as have the ability to specify elements in the graph. Currently, "basic", "multi", and "advanced" are synonyms, but different functionality may be put in in the future.
==term==
This variable is available only for the "quickgo" and "single" modes.
It is a single GO id (e.g. "GO:0022008").
==inline==
This variable is available for all modes.
It specifies whether the returned image is intended for inline use (i.e. embedded in a web page) or standalone use (i.e. download or separate viewing). This is only really intended to be used with a "format" of "png".
===true===
The image is intended to be view by itself.
===false===
The image is intended to be embedded into another page.


==format==
==format==
Line 77: Line 100:


===svg===
===svg===
Results as an interactive SVG (SVG+XML and JavaScript).
===svg_raw===
===svg_raw===
Results as raw SVG as returned my GraphViz.
===png===
===png===


This is the default if "format" is not specified.
Results as a PNG image.
This is the default if "format" is not otherwise specified.


===dot===
===dot===


GraphViz dot format.
Results in the GraphViz dot format.


===navi===
===navi===
Line 90: Line 120:
This is an AmiGO internal format and can change without warning. You should probably not use it.
This is an AmiGO internal format and can change without warning. You should probably not use it.


==inline==
==term_data==
 
This variable is available only for the "advanced" mode.
 
It is data input variable (i.e. list of GO ids or JSON). See "term_data_type" below for details on how to use it.
 
==term_data_type==


This variable is available for all "single and "advanced" modes.
This variable is available only for the "advanced" mode.


It specifies whether the returned image is intended for inline use (i.e. embedded in a web page) or standalone use (i.e. download or separate viewing).
===string===


===true===
This is the default.


When "string" is specified, "term_data" is interpreted as a whitespace separated list of GO ids; no further formatting information is sought.


This is useful for viewing multiple terms in the graph.


===false===
===json===


The image is intended
When "json" is specified, "term_data" will be parsed as JSON (see the discussion of the JSON format above). This can be fiddly, but powerful.


=Other Uses in AmiGO=
=Other Uses in AmiGO=


The RESTful graphing component is used by the Term Enrichment tool and Term Details pages (not the main QuickGO generated image). In the case of the Term Enrichment tool, it adds a p-value annotation to each node as well as changing its color in relation to the p-value.
The RESTful graphing component is used by the Term Enrichment tool and Term Details pages (not the main QuickGO generated image). In the case of the Term Enrichment tool, it adds a p-value annotation to each node as well as changing its color in relation to the p-value.
=Color=
The ontology [http://www.geneontology.org/GO.ontology-ext.relations.shtml relation] colors are as follows:
{| border="1" cellspacing="0" cellpadding="5
! relation
! color
! example
|-
| is_a || blue || bgcolor="blue" |
|-
| part_of || lightblue || bgcolor="lightblue" |
|-
| develops_from || brown || bgcolor="brown" |
|-
| regulates || black || bgcolor="black" |
|-
| negatively_regulates || red || bgcolor="red" |
|-
| positively_regulates || green || bgcolor="green" |
|}


[[Category:AmiGO_Manual]]
[[Category:AmiGO_Manual]]
[[Category:AmiGO]]
[[Category:AmiGO]]
[[Category:Software]]

Latest revision as of 16:43, 11 August 2013

Overview

This page allows the users to specify specify an arbitrary GO graph using either of two different input formats: the default/simple one and an advanced one. In both cases, the output is the minimal GO graph containing the inputted GO terms and their closure to the root(s). The user may either select the output as a PNG image or SVG markup (please see Caveats below).

Default format

The default input format is a list of GO IDs (e.g. GO:0002244) separated by whitespace.

Advanced format

The advanced format is actually a simple JSON description of nodes in the graph. While the user cannot specify what nodes appear in the graph beyond the ones used to seed it, they may completely specify the contents of those nodes (e.g. add additional annotation, change the names, or alter coloration).

So far, the following keys are recognized:

  • "title": The title of the node (must be unique).
  • "body": The text appearing under the title.
  • "fill": The color of the node.
  • "font": The color of the font.
  • "border": The border color around the text of the node.

While the body tag should be able to take simple psuedo-HTML as GraphViz does, the HTML support in GraphViz is fiddly (e.g. spaces *do count* and some tags don't work in certain combinations)--it takes a little experimentation.

Example JSON

{"GO:0002244":{"title": "foo",
               "body":  "bar",
               "fill":  "#ccccff",
               "font":  "#0000ff",
               "border":"red"},
"GO:0005575":{"title":"alone",
              "body":""},
"GO:0033060":{}}

Example results (click to enlarge)

Caveats

  • Node titles, if supplied, must be unique.
  • There are bugs in GraphViz--if you get too fancy, strange things might start happening.
  • The SVG+XML output is not supported by Microsoft web browsers.

Web API (EXPERIMENTAL)

The AmiGO "Visualize" page is essentially a light wrapper around a RESTful graphing component. The API for it, such as it is, should be fairly stable (at least it hasn't changed in a while), but it may be changed later on. If you're writing an application to use this, please keep it flexable as there may be sudden, and for a period of time undocumented, changes.

This section aims to describe the current RESTful calls as they exist now (AmiGO 1.8). The base URL will always be assumed to be production:

http://amigo.geneontology.org/cgi-bin/amigo/visualize

or labs:

http://amigo.berkeleybop.org/cgi-bin/amigo/visualize

or amigo2:

http://amigo2.berkeleybop.org/cgi-bin/amigo2/amigo/visualize

with the arguments described below.

mode

This is the most fundamental argument and must always be specified. This argument specifies what the API will be and what engine will be used to return the results.

quickgo

Use AmiGO as a proxy to get (and cache) QuickGO images. This mode always returns PNGs.

single

Use AmiGO's native rendering for viewing a single term in the ontology. This mode always returns PNGs.

basic|multi|advanced

Allow a richer API to view multiple terms at the same time, as well as have the ability to specify elements in the graph. Currently, "basic", "multi", and "advanced" are synonyms, but different functionality may be put in in the future.

term

This variable is available only for the "quickgo" and "single" modes. It is a single GO id (e.g. "GO:0022008").

inline

This variable is available for all modes.

It specifies whether the returned image is intended for inline use (i.e. embedded in a web page) or standalone use (i.e. download or separate viewing). This is only really intended to be used with a "format" of "png".

true

The image is intended to be view by itself.

false

The image is intended to be embedded into another page.

format

This variable is available only for the "advanced" mode.

svg

Results as an interactive SVG (SVG+XML and JavaScript).

svg_raw

Results as raw SVG as returned my GraphViz.

png

Results as a PNG image. This is the default if "format" is not otherwise specified.

dot

Results in the GraphViz dot format.

navi

This is an AmiGO internal format and can change without warning. You should probably not use it.

term_data

This variable is available only for the "advanced" mode.

It is data input variable (i.e. list of GO ids or JSON). See "term_data_type" below for details on how to use it.

term_data_type

This variable is available only for the "advanced" mode.

string

This is the default.

When "string" is specified, "term_data" is interpreted as a whitespace separated list of GO ids; no further formatting information is sought.

This is useful for viewing multiple terms in the graph.

json

When "json" is specified, "term_data" will be parsed as JSON (see the discussion of the JSON format above). This can be fiddly, but powerful.

Other Uses in AmiGO

The RESTful graphing component is used by the Term Enrichment tool and Term Details pages (not the main QuickGO generated image). In the case of the Term Enrichment tool, it adds a p-value annotation to each node as well as changing its color in relation to the p-value.

Color

The ontology relation colors are as follows:

relation color example
is_a blue
part_of lightblue
develops_from brown
regulates black
negatively_regulates red
positively_regulates green