5.1.3.1.3. cobramod.visualization.items
¶
Escher JSON-schema objects
This modules has all the JSON objects that can be seen in the original JSON schema for Escher.
The classes retain their original JSON names and attributes. - Node: Represents the nodes. They can be a metabolite or markers. They give the position of all dots in the canvas. - Segment: Represents the connections between nodes. - Reaction: Represents a reaction. They contain the needed segments for the visualization of the pathway.
5.1.3.1.3.1. Module Contents¶
5.1.3.1.3.1.1. Classes¶
Simple class that represent a node for the JSON schema of Escher. The |
|
Build a segment for th reaction object for JsonCobramod, which can be |
|
Simple class that represent a reaction for the JSON schema for Escher. A |
- class cobramod.visualization.items.Node(node_type: str, x: float, y: float, label_x: float = None, label_y: float = None, bigg_id: str = '', name: str = '', node_is_primary: bool = False)¶
Bases:
collections.UserDict
Simple class that represent a node for the JSON schema of Escher. The node type can be either a ‘metabolite’, ‘midmarker’ or a ‘multimarker’. Markers only need the arguments x and y. Check method
cobramod.visualization.items.Node.__init__()
to see all the corresponding arguments.
- class cobramod.visualization.items.Segment(*args, **kwargs)¶
Bases:
collections.UserDict
Build a segment for th reaction object for JsonCobramod, which can be later parsed into a proper JSON for Escher. A segment needs a starting position and and end-position. Additionally, the dots for the modification of the arrows (b1, b2) can be included.
- class cobramod.visualization.items.Reaction(*args, **kwargs)¶
Bases:
collections.UserDict
Simple class that represent a reaction for the JSON schema for Escher. A Reaction have the Segment that give the position of the reaction in the canvas.
- Keyword Arguments
name (str) – Name of the reaction.
bigg_id (str) – Identifier of the reactions. It does not have to be from the database BIGG.
reversibility (bool) – If reaction is reversible
label_y (float) – Position in y-axis for the label.
label_x (float) – Position in x-axis for the label.
gene_reaction_rule (str, optional) – Gene rules that specify involved genes.
genes (list, optional) – A list with the genes involved for that identifier. Each item has to be a dictionary with the keys ‘bigg_id’ and ‘name’
metabolites (list, optional) – A list with the metabolites involved. Each iteam has to be an dictionary with the keys ‘bigg_id’ and ‘coefficient’.
segments (PairDictionary, optional) – dictionary with
cobramod.visualization.items.Segment()
. They represent the connections between nodes.
- add_metabolite(self, bigg_id: str, coefficient: float)¶
Add the identifier for a metabolite and its corresponding coefficient into the ‘metabolite’ key.