Class GraphTranslatorJson
- java.lang.Object
-
- de.unirostock.sems.bives.ds.graph.GraphTranslator
-
- de.unirostock.sems.bives.ds.graph.GraphTranslatorJson
-
public class GraphTranslatorJson extends GraphTranslator
The Class GraphTranslatorJson to translate internal graph structures into JSON format. (e.g. to pass the graph to CytoscapeJS) The resulting graph will look like:{ "elements": { "edges": [ { "classes": "bives-ioedge", "data": { "source": "s2", "target": "r3" } }, { "classes": "bives-stimulator bives-deleted", "data": { "source": "s4", "target": "r3" } }, [...] ], "nodes": [ { "classes": "compartment", "data": { "id": "c1", "name": "compartment" } }, { "classes": "species", "data": { "id": "s2", "name": "sigb", "parent": "c1" } }, { "classes": "reaction bives-modified", "data": { "id": "r3", "name": "sigb degr", "parent": "c1" } }, [...] ] } }
for more information see JsonGraphFormatDescription- Author:
- Martin Scharm
-
-
Constructor Summary
Constructors Constructor Description GraphTranslatorJson()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.json.simple.JSONObject
getJsonGraph()
Gets the JSON object.String
translate(HierarchyNetwork hn)
Translate a hierarchy network.String
translate(ReactionNetwork rn)
Translate a reaction network.
-
-
-
Method Detail
-
getJsonGraph
public org.json.simple.JSONObject getJsonGraph()
Gets the JSON object.- Returns:
- the JSON object representing the graph
-
translate
public String translate(ReactionNetwork rn)
Description copied from class:GraphTranslator
Translate a reaction network. Might return null if not available.- Specified by:
translate
in classGraphTranslator
- Parameters:
rn
- the internal reaction network- Returns:
- the graph format
-
translate
public String translate(HierarchyNetwork hn)
Description copied from class:GraphTranslator
Translate a hierarchy network. Might return null if not available.- Specified by:
translate
in classGraphTranslator
- Parameters:
hn
- the internal hierarchy network- Returns:
- the graph format
-
-