Ejemplo n.º 1
0
#model_file_name = "chance_glycolysis_1960.xml"
#model_file_name = "repressilator_BIOMD12.xml"

model_file_name = "glycolysis_BIOMD176.xml"

model_file = Path(
    pkg_resources.resource_filename("libsbml_draw",
                                    "model/data/" + model_file_name))

sl = SBMLlayout(str(model_file))

sl._describeModel()

sl.drawNetwork()

sl.aliasNode("ATP")
sl.aliasNode("ADP")
sl.drawNetwork()

sl.regenerateLayout()

sl.drawNetwork()

loo = sl.getLayoutAlgorithmOptions()

print(loo.k)

#sl.setLayoutAlgorithm_grav()

#sl.drawNetwork("glycolysis_bm12.png")
Ejemplo n.º 2
0
print("X1 locked, True: ", sl.getIsNodeLocked("X1"))

sl.regenerateLayout()
sl.drawNetwork()

sl.regenerateLayout()
sl.drawNetwork()

sl.unlockNode("X1")

print("X1 locked, False: ", sl.getIsNodeLocked("X1"))

print(sl.getReactionIds())

sl.aliasNode("A")

#print("A aliased? ", sl.getIsNodeAliased("A"))

sl.drawNetwork()

print(sl.getNodeIds())
print(sl.getReactionIds())

print(sl._describeModel())

x = list()
y = list()

for node in sl.getNodeIds():
    centroid = sl.getNodeCentroid(node)
Ejemplo n.º 3
0
from libsbml_draw.model.sbml_layout import SBMLlayout

model_file_name = "BIOMD0000000013_url.xml"
# Poolman2004_CalvinCycle

sl = SBMLlayout(model_file_name, applyRender=False)

sl._describeModel()

#sl.drawNetwork("plant_metabolism.pdf")

sl.aliasNode("ATP_ch")
sl.aliasNode("ADP_ch")
sl.aliasNode("GAP_ch")
sl.aliasNode("PGA_ch")

sl.regenerateLayout()

sl.drawNetwork("plant_metabolism_alias.pdf")
Ejemplo n.º 4
0
from libsbml_draw.model.sbml_layout import SBMLlayout

model_file_name = "model.xml"

model_file = Path(
    pkg_resources.resource_filename("libsbml_draw",
                                    "model/data/" + model_file_name))

applyRender = True

sl = SBMLlayout(str(model_file), applyRender=applyRender)

sl.lockNode("X0")
sl.lockNode("A")

sl.aliasNode("B")

sl.setNodeColor("B_1", "#00ff0030")
sl.setNodeColor("A", "#00ff0030")

sl.lockNode("B_1")
sl.lockNode("D")
sl.unlockNode("X0")
sl.unlockNode("A")


def test_node_locking():
    assert sl.getIsNodeLocked("D") == True
    assert sl.getIsNodeLocked("B_1") == True
    assert sl.getIsNodeLocked("X0") == False
    assert sl.getIsNodeLocked("A") == False