public class SBGN2Escher
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.String> |
arc2GlyphMap
Arc s' ids with their respective process (Glyph ) nodes ids. |
static java.util.ResourceBundle |
bundle
Default values.
|
protected org.sbgn.bindings.Sbgn |
document
Input SBGN-ML document.
|
protected EscherMap |
escherMap
Output Escher map.
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
glyphId2LabelMap
Glyph ids with their respective label. |
protected java.util.Set<java.lang.String> |
glyphIds
List of
Glyph ids. |
static java.util.ResourceBundle |
messages
Localization support.
|
protected java.util.Set<java.lang.String> |
metaboliteIds
List of
Metabolite ids. |
protected java.util.HashMap<java.lang.String,java.lang.String> |
port2GlyphMap
Port ids with their respective Glyph ids. |
protected java.util.Set<java.lang.String> |
processIds
List of process (
Glyph ) ids. |
protected long |
reactionId
Generated reaction ids.
|
Constructor and Description |
---|
SBGN2Escher()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCanvasInfo(org.sbgn.bindings.Bbox bbox)
Add canvas info to the internal
escherMap field. |
void |
addMetaInfo()
Add meta info about the map to the internal
escherMap field. |
EscherMap |
convert(org.sbgn.bindings.Sbgn document)
Converts
Sbgn document to EscherMap by iteratively creating nodes,
reactions, etc. |
Node |
createMidMarker(org.sbgn.bindings.Glyph glyph)
Create an Escher
Node (mid-marker) from process Glyph . |
Node |
createMultiMarker(org.sbgn.bindings.Arc.Next next)
Create an Escher
Node (multi-marker) from Arc.Next . |
Node |
createNode(org.sbgn.bindings.Glyph glyph)
Create an Escher
Node (metabolite) from EPN Glyph . |
EscherReaction |
createReaction(org.sbgn.bindings.Glyph glyph)
Create an
EscherReaction from an SBGN-ML Glyph . |
java.util.List<Segment> |
createSegments(org.sbgn.bindings.Arc arc)
Create a list of
Segment s from an SBGN-ML Arc . |
TextLabel |
createTextLabel(org.sbgn.bindings.Glyph glyph)
Create a
TextLabel from an SBGN-ML Glyph . |
double |
extractCoefficient(java.lang.Object object) |
java.lang.String |
getGlyphIdFromPortId(java.lang.String id)
Get
Glyph id from a Port or Glyph id. |
java.lang.String |
getIdFromSourceOrTarget(java.lang.Object sOrT)
Extract id from either a
Glyph or a Port . |
protected void |
preProcessSbgn()
Processes the input
Sbgn document and populates internal helper fields. |
public static final java.util.ResourceBundle messages
public static final java.util.ResourceBundle bundle
protected EscherMap escherMap
protected org.sbgn.bindings.Sbgn document
protected long reactionId
protected java.util.Set<java.lang.String> glyphIds
Glyph
ids.protected java.util.HashMap<java.lang.String,java.lang.String> port2GlyphMap
Port
ids with their respective Glyph
ids.protected java.util.HashMap<java.lang.String,java.lang.String> arc2GlyphMap
Arc
s' ids with their respective process (Glyph
) nodes ids.protected java.util.Set<java.lang.String> processIds
Glyph
) ids.protected java.util.Set<java.lang.String> metaboliteIds
Metabolite
ids.protected java.util.HashMap<java.lang.String,java.lang.String> glyphId2LabelMap
Glyph
ids with their respective label.public void addCanvasInfo(org.sbgn.bindings.Bbox bbox)
escherMap
field.bbox
- BBox containing canvas info.public void addMetaInfo()
escherMap
field.public Node createNode(org.sbgn.bindings.Glyph glyph)
Node
(metabolite) from EPN Glyph
.glyph
- The glyph
.node
.public Node createMidMarker(org.sbgn.bindings.Glyph glyph)
Node
(mid-marker) from process Glyph
.glyph
- The glyph
.node
.public Node createMultiMarker(org.sbgn.bindings.Arc.Next next)
Node
(multi-marker) from Arc.Next
.next
- The next
element.node
.public EscherReaction createReaction(org.sbgn.bindings.Glyph glyph)
EscherReaction
from an SBGN-ML Glyph
. The glyph is used to create
the mid-marker.glyph
- The glyph
.reaction
.public double extractCoefficient(java.lang.Object object)
object
- public TextLabel createTextLabel(org.sbgn.bindings.Glyph glyph)
TextLabel
from an SBGN-ML Glyph
.glyph
- The glyph
.text label
.public java.util.List<Segment> createSegments(org.sbgn.bindings.Arc arc)
Segment
s from an SBGN-ML Arc
.arc
- The arc
.segments
.public java.lang.String getIdFromSourceOrTarget(java.lang.Object sOrT)
Glyph
or a Port
. Since the source/target of an
Arc
is a plain Object
and it needs to be cast into a Glyph
or
Port
, this methods checks its type and returns the id.sOrT
- The source/target object.public java.lang.String getGlyphIdFromPortId(java.lang.String id)
Glyph
id from a Port
or Glyph
id.id
- The port
or glyph
id.glyph
id.public EscherMap convert(org.sbgn.bindings.Sbgn document)
Sbgn
document to EscherMap
by iteratively creating nodes,
reactions, etc.document
- The SBGN
document to convert.escher map
.protected void preProcessSbgn()
Sbgn
document and populates internal helper fields.