libsbml-draw
|
Public Member Functions | |
def | __init__ (self, sbml_source=None, layout_alg_options=None, layout_number=0, fitToWindow=tuple(), autoComputeLayout=False) |
def | loadSBMLFile (self, sbml_file) |
def | loadSBMLString (self, sbml_string) |
def | setLayoutAlgorithmOptions (self, k=None, grav=None, baryx=None, baryy=None, autobary=None, padding=None) |
def | setLayoutAlgorithm_k (self, k) |
def | setLayoutAlgorithm_grav (self, gravity) |
def | setLayoutAlgorithm_baryx (self, baryx) |
def | setLayoutAlgorithm_baryy (self, baryy) |
def | setLayoutAlgorithm_autobary (self, autobary) |
def | setLayoutAlgorithm_padding (self, padding) |
def | getLayoutAlgorithmOptions (self) |
def | showLayoutAlgorithmOptions (self) |
def | regenerateLayoutAndResetRenderInfo (self) |
def | regenerateLayout (self) |
def | getNumberOfCompartments (self) |
def | getNumberOfNodes (self) |
def | getNumberOfReactions (self) |
def | setModelNamespace (self, level, version) |
def | aliasNode (self, node_id) |
def | getIsNodeAliased (self, node_id) |
def | getIsNodeLocked (self, node_id) |
def | lockNode (self, node_id) |
def | unlockNode (self, node_id) |
def | getNodeCentroid (self, node_id) |
def | setNodeCentroid (self, node_id, x, y) |
def | getReactionCentroid (self, reaction_id) |
def | writeSBMLFile (self, out_file_name) |
def | getCompartmentIds (self) |
def | setCompartmentEdgeColor (self, compartment_id, edge_color) |
def | getCompartmentEdgeColor (self, compartment_id) |
def | setCompartmentFillColor (self, compartment_id, fill_color) |
def | getCompartmentFillColor (self, compartment_id) |
def | getCompartmentLineWidth (self, compartment_id) |
def | setCompartmentLineWidth (self, compartment_id, line_width) |
def | getNodeIds (self) |
def | getNodeColor (self, node_id) |
def | getNodeKeywordIds (self, node_keyword) |
def | setNodeColor (self, node_id, node_color) |
def | getNodeFillColor (self, node_id) |
def | setNodeFillColor (self, node_id, fill_color) |
def | getNodeEdgeColor (self, node_id) |
def | setNodeEdgeColor (self, node_id, edge_color) |
def | getNodeEdgeWidth (self, node_id) |
def | setNodeEdgeWidth (self, node_id, edge_width) |
def | getNodeFontSize (self, node_id) |
def | setNodeFontSize (self, node_id, font_size) |
def | getNodeFontName (self, node_id) |
def | setNodeFontName (self, node_id, font_name) |
def | getNodeFontFamily (self, node_id) |
def | setNodeFontFamily (self, node_id, font_family) |
def | getNodeFontColor (self, node_id) |
def | setNodeFontColor (self, node_id, font_color) |
def | getNodeFontStyle (self, node_id) |
def | setNodeFontStyle (self, node_id, font_style) |
def | getNodeWidth (self, node_id) |
def | getNodeHeight (self, node_id) |
def | getNodeName (self, node_id) |
def | getNodeLowerLeftPoint (self, node_id) |
def | getBoundarySpeciesIds (self) |
def | getFloatingSpeciesIds (self) |
def | getReactionIds (self) |
def | setReactionColor (self, reaction_id, reaction_color) |
def | getReactionEdgeColor (self, reaction_id) |
def | setReactionEdgeColor (self, reaction_id, edge_color) |
def | getReactionFillColor (self, reaction_id) |
def | setReactionFillColor (self, reaction_id, fill_color) |
def | getReactionCurveWidth (self, reaction_id) |
def | setReactionCurveWidth (self, reaction_id, curve_width) |
def | getArrowheadStyle (self, role) |
def | setArrowheadStyle (self, role, style) |
def | getArrowheadNumVerts (self, style) |
def | getArrowheadVert (self, style, vertex_number) |
def | getArrowheadNumStyles (self) |
def | drawNetwork (self, save_file_name=None, show=True, dpi=72, width_shift=.25, height_shift=.25, scaling_factor=1) |
def | getSBMLString (self) |
def | setArrowheadScale (self, role, arrowhead_scale) |
def | getArrowheadScale (self, role) |
def | getNumberOfRoles (self) |
def | getReactionBezierPoints (self, reaction_id) |
Static Public Attributes | |
LIBSBML_DRAW_VERSION = sbnw.getCurrentLibraryVersion() | |
dictionary | NODE_KEYWORDS = {"all", "boundary", "floating"} |
int | WIDTH_PADDING = 2 |
int | HEIGHT_PADDING = 1 |
SBMLlayout represents the model in an SBML file.
def libsbml_draw.model.sbml_layout.SBMLlayout.aliasNode | ( | self, | |
node_id | |||
) |
Creates an alias of this node for each incoming and outgoing reaction. Args: node_id (str): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.drawNetwork | ( | self, | |
save_file_name = None , |
|||
show = True , |
|||
dpi = 72 , |
|||
width_shift = .25 , |
|||
height_shift = .25 , |
|||
scaling_factor = 1 |
|||
) |
Draws the network to screen. The figure can be saved. Args: save_file_name (optional, str): save figure to this file show (optional, bool): if True, display the network on screen dpi (optional, int): desired dots-per-inch for the figure width_shift (optional, float): size in inches of the left and right borders height_shift (optional, float): size in inches of the bottom and top borders scaling_factor (option, float): decrease or increase the size of the figure using this factor; example, 0.5 results in reducing the figure size by one-half Returns: matplotlib.figure.Figure
def libsbml_draw.model.sbml_layout.SBMLlayout.getArrowheadNumStyles | ( | self | ) |
Returns the number of arrowhead styles available. Args: None Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getArrowheadNumVerts | ( | self, | |
style | |||
) |
Returns the number of vertices in the arrowhead of the given style. Args: style (int): which arrowhead style Returns:int
def libsbml_draw.model.sbml_layout.SBMLlayout.getArrowheadScale | ( | self, | |
role | |||
) |
Returns the arrowhead scale for the given role. Bigger values result in bigger arrowheads. Args: role(int) Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getArrowheadStyle | ( | self, | |
role | |||
) |
Returns the arrowhead style for the given role. Args: role (int): which role Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getArrowheadVert | ( | self, | |
style, | |||
vertex_number | |||
) |
Returns a point for the given vertex_number, given an arrowhead style. Args: style (int): which arrowhead style vertex_number (int): specify the vertex in the arrowhead Returns: point with fields x and y
def libsbml_draw.model.sbml_layout.SBMLlayout.getBoundarySpeciesIds | ( | self | ) |
Gets the id values of the Species who have boundaryCondition set to True. Args: None Returns: list of Species ids
def libsbml_draw.model.sbml_layout.SBMLlayout.getCompartmentEdgeColor | ( | self, | |
compartment_id | |||
) |
Returns the color id for the compartment edge color. Args: compartment_id(str): id for the compartment Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getCompartmentFillColor | ( | self, | |
compartment_id | |||
) |
Returns the color id for the compartment fill color. Args: compartment_id(str): id for the compartment Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getCompartmentIds | ( | self | ) |
Returns a list of compartment ids. Args: None Returns: list of str
def libsbml_draw.model.sbml_layout.SBMLlayout.getCompartmentLineWidth | ( | self, | |
compartment_id | |||
) |
Returns the line width for the given compartment. Args: compartment_id (str): id for the compartment Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getFloatingSpeciesIds | ( | self | ) |
Gets the id values of the Species who have boundaryCondition set to False. Args: None Returns: list of Species ids
def libsbml_draw.model.sbml_layout.SBMLlayout.getIsNodeAliased | ( | self, | |
node_id | |||
) |
Returns True if this node is an alias of earlier node. Args: node_id (str): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.getIsNodeLocked | ( | self, | |
node_id | |||
) |
Returns True if this node is locked. Args: node_id(str): id for the node Returns: bool
def libsbml_draw.model.sbml_layout.SBMLlayout.getLayoutAlgorithmOptions | ( | self | ) |
Get the Fruchterman-Reingold layout algorithm parameter values. Args: None Returns: instance of the fr_alg_options class
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeCentroid | ( | self, | |
node_id | |||
) |
Returns the center point of the node. Args: node_id (str): id for the node Returns: tuple, with x and y
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeColor | ( | self, | |
node_id | |||
) |
Returns the id of the fill color for this node. Args: node_id (str): id for the node Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeEdgeColor | ( | self, | |
node_id | |||
) |
Returns the color id for the node edge color. Args: node_id(str): id for the node Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeEdgeWidth | ( | self, | |
node_id | |||
) |
Returns the line width for the node edge. Args: node_id(str): id for the node Returns: float
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFillColor | ( | self, | |
node_id | |||
) |
Returns the color id for the node fill color. Args: node_id(str): id of the node Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFontColor | ( | self, | |
node_id | |||
) |
Returns the color of the node's text. Args: node_id (str): id for the node Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFontFamily | ( | self, | |
node_id | |||
) |
Returns the font family value, which can be the font family or font name.
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFontName | ( | self, | |
node_id | |||
) |
Returns the font family value, which can be the font family or font name. Args: node_id (str): id for the node Returns: str, eg. "Arial" or "serif"
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFontSize | ( | self, | |
node_id | |||
) |
Returns the font size of the node text. Args: node_id (str): id for the node Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeFontStyle | ( | self, | |
node_id | |||
) |
Returns the style of the font for the given node. Args: node_id (str): id for the node Returns: str, "italic", "normal", or "oblique"
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeHeight | ( | self, | |
node_id | |||
) |
Returns the height of the node. Args: node_id (str): id for the node Returns: float
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeIds | ( | self | ) |
Returns a list of node ids. Args: None Returns: list of str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeKeywordIds | ( | self, | |
node_keyword | |||
) |
Returns a list of node ids corresponding to the given keyword. Args: node_keyword(str): 'all', 'boundary', or 'floating' Returns: list of str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeLowerLeftPoint | ( | self, | |
node_id | |||
) |
Returns the point for the node's lower left corner. Args: node_id (str): id for the node Returns: point which has fields x and y
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeName | ( | self, | |
node_id | |||
) |
Returns the name of the node. Args: node_id (str): id for the node Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getNodeWidth | ( | self, | |
node_id | |||
) |
Returns the width of the node. Args: node_id (str): id for the node Returns: float
def libsbml_draw.model.sbml_layout.SBMLlayout.getNumberOfCompartments | ( | self | ) |
Returns the number of compartments in the model. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.getNumberOfNodes | ( | self | ) |
Returns the number of nodes in the model. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.getNumberOfReactions | ( | self | ) |
Returns the number of reactions in the model. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.getNumberOfRoles | ( | self | ) |
Args: None Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionBezierPoints | ( | self, | |
reaction_id | |||
) |
Returns a list of Bezier points (start, end, control1, control2) for each curve in the reaction. Args: reaction_id(str): id for the reaction Returns: list, of BezierPoints named tuple of tuples
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionCentroid | ( | self, | |
reaction_id | |||
) |
Returns the centroid of the reaction. Args: reaction_id (str): id of the reaction Returns: tuple, with x and y
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionCurveWidth | ( | self, | |
reaction_id | |||
) |
Returns the curve width for the given reaction. Args: reaction_id (str): id for the reaction Returns: int
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionEdgeColor | ( | self, | |
reaction_id | |||
) |
Returns the color id for the edge color of the reaction. Args: reaction_id (str): id for the reaction Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionFillColor | ( | self, | |
reaction_id | |||
) |
Returns the fill color for the reaction. Args: reaction_id (str): id for the reaction Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.getReactionIds | ( | self | ) |
Gets the ids of the reactions in the model. Args: None Returns: list of Reaction ids
def libsbml_draw.model.sbml_layout.SBMLlayout.getSBMLString | ( | self | ) |
Returns the SBML string for the model. Args: None Returns: str
def libsbml_draw.model.sbml_layout.SBMLlayout.loadSBMLFile | ( | self, | |
sbml_file | |||
) |
Loads the SBML model into SBMLlayout. Args: sbml_string(str): name of file containing an SBML model Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.loadSBMLString | ( | self, | |
sbml_string | |||
) |
Loads the SBML model into SBMLlayout. Args: sbml_string(str): SBML model in string format Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.lockNode | ( | self, | |
node_id | |||
) |
Locks the node so that a new layout can be generated w/o moving this node. Args: node_id (str): id for the node Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.regenerateLayout | ( | self | ) |
Use this to generate a new layout, and update the network's node reaction, and compartment layout values. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.regenerateLayoutAndResetRenderInfo | ( | self | ) |
Use this to generate a new layout, and reset the network's node and reaction layout and render values. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setArrowheadScale | ( | self, | |
role, | |||
arrowhead_scale | |||
) |
Set a value for matplotlib's mutation_scale to change the size of the arrowhead for a given role. The default value is 10. Bigger values result in bigger arrowheads. Args: arrowhead_scale(int): passed on to matplotlib role(int): role of the reaction Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setArrowheadStyle | ( | self, | |
role, | |||
style | |||
) |
Set the arrowhead style for the given role. Args: role (int): which role style (int): which style Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setCompartmentEdgeColor | ( | self, | |
compartment_id, | |||
edge_color | |||
) |
Sets the compartment edge color. Args: compartment_id (str): id of the compartment to change the color of one compartment, or 'all' to change the color of all the compartments edge_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setCompartmentFillColor | ( | self, | |
compartment_id, | |||
fill_color | |||
) |
Sets the compartment fill color. Args: compartment_id (str): id of the compartment to change the color of one compartment, or 'all' to change the color of all the compartments fill_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setCompartmentLineWidth | ( | self, | |
compartment_id, | |||
line_width | |||
) |
Sets the line width of the compartment. Args: compartment_id (str): id of the compartment to change the width of one compartment, or 'all' to change the width of all the compartments line_width (int): numeric value representing the line width Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_autobary | ( | self, | |
autobary | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'autobary'. Args: autobary (int): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_baryx | ( | self, | |
baryx | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'baryx'. Args: baryx (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_baryy | ( | self, | |
baryy | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'baryy'. Args: baryy (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_grav | ( | self, | |
gravity | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'grav'. Args: gravity (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_k | ( | self, | |
k | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'k'. Args: k (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithm_padding | ( | self, | |
padding | |||
) |
Set the Fruchterman-Reingold layout algorithm parameter 'padding'. Args: padding (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setLayoutAlgorithmOptions | ( | self, | |
k = None , |
|||
grav = None , |
|||
baryx = None , |
|||
baryy = None , |
|||
autobary = None , |
|||
padding = None |
|||
) |
Set values for the Fruchterman-Reingold layout algorithm parameters. Args: k (float): gravity (float): baryx (float): baryy (float): autobary (int): padding (float): Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setModelNamespace | ( | self, | |
level, | |||
version | |||
) |
Specify the Model level and version. Args: level (int): model level version (int): model version Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeCentroid | ( | self, | |
node_id, | |||
x, | |||
y | |||
) |
Sets the center point of the node. Args: node_id (str): id for the node x (float): new x coordinate y (float): new y coordinate Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeColor | ( | self, | |
node_id, | |||
node_color | |||
) |
Sets the node edge color and fill color to the same value. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. node_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeEdgeColor | ( | self, | |
node_id, | |||
edge_color | |||
) |
Sets the node edge color. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. edge_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeEdgeWidth | ( | self, | |
node_id, | |||
edge_width | |||
) |
Sets the line width of the node edge. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. edge_width (float): line width of the edge Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFillColor | ( | self, | |
node_id, | |||
fill_color | |||
) |
Sets the node fill color. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. fill_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFontColor | ( | self, | |
node_id, | |||
font_color | |||
) |
Sets the node font color. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. font_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFontFamily | ( | self, | |
node_id, | |||
font_family | |||
) |
Sets the font family for the node, which can be a value for either the family or name of the font. Args: node_id (str): id for the node font_family (str): value for font family (eg. 'serif') or font name (eg. 'Arial') Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFontName | ( | self, | |
node_id, | |||
font_name | |||
) |
Sets the font family for the node, which can be a value for the family or name of the font. Args: node_id (str): id for the node font_name (str): value for font family (eg. 'serif') or font name (eg. 'Arial') Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFontSize | ( | self, | |
node_id, | |||
font_size | |||
) |
Set the font size for the node. Args: node_id (str): id for the node font_size (int or str): matplotlib acceptable values, which are: {size in points, 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setNodeFontStyle | ( | self, | |
node_id, | |||
font_style | |||
) |
Sets the node font style. Args: node_id (str or list of str): id of the node to change, or keyword 'all', 'boundary', or 'floating' to change the color of all the nodes of that type, or a list of node ids to change. font_style (str): Available font styles are normal, italic, and oblique. Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setReactionColor | ( | self, | |
reaction_id, | |||
reaction_color | |||
) |
Sets the reaction edge color and fill color to the same value. Args: reaction_id (str): id of the reaction to change the color of one reaction, or 'all' to change the color of all the reactions reaction_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setReactionCurveWidth | ( | self, | |
reaction_id, | |||
curve_width | |||
) |
Sets the width of the reaction curve. Args: reaction_id (str): id of the reaction to change the width of one reaction, or 'all' to change the width of all the reactions curve_width (int): numeric value representing the line width Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setReactionEdgeColor | ( | self, | |
reaction_id, | |||
edge_color | |||
) |
Sets the reaction edge color. Args: reaction_id (str): id of the reaction to change the color of one reaction, or 'all' to change the color of all the reactions edge_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.setReactionFillColor | ( | self, | |
reaction_id, | |||
fill_color | |||
) |
Sets the reaction fill color. Args: reaction_id (str): id of the reaction to change the color of one reaction, or 'all' to change the color of all the reactions fill_color (str): id of the color Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.showLayoutAlgorithmOptions | ( | self | ) |
Prints out the values of the Fruchterman-Reingold algorithm paramters, which are: k, grav, baryx, baryy, autobary, and padding. Args: None Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.unlockNode | ( | self, | |
node_id | |||
) |
Unlocks a previously locked node. Args: node_id (str): id for the node Returns: None
def libsbml_draw.model.sbml_layout.SBMLlayout.writeSBMLFile | ( | self, | |
out_file_name | |||
) |
Writes the model as an SBML file. Args: out_file_name (str): name of the file to write Returns: None