コード例 #1
0
    pkg_resources.resource_filename("libsbml_draw",
                                    "model/data/" + model_file_name))

sl = SBMLlayout(str(model_file))

sl._describeModel()

assert sl.getNumberOfNodes() == 23
assert sl.getNumberOfReactions() == 11

sl.drawNetwork("GlycolysisOriginal.png")

assert sl.getNodeEdgeWidth("External_glucose") == 3
assert sl.getNodeEdgeWidth("Glucose") == 1
# in this case, bottom means top
assert sl.getNodeVTextAnchor("pyruvate") == "bottom"
assert sl.getNodeVTextAnchor("ADP") == "bottom"

assert sl.getNodeFillColor("NAD") == "#7fff55"
assert sl.getNodeFillColor("NADH") == "#d4ffaa"

assert sl.getNodeFillColor("ATP") == "#ff7faa"
assert sl.getNodeFillColor("ADP") == "#ffd4d4"

assert sl.getNodeEdgeColor("glycerate_3_phosphate") == "#969696"

sl.writeSBMLFile("glycolysis_original.xml")

slr = SBMLlayout("glycolysis_original.xml")

slr.drawNetwork()
コード例 #2
0
        sl.writeSBMLFile("ftest_layout_override.xml")


# This will write if allowed, and when it is read back in, it displays as
# a single blob of garbage because everything is plotted with the same centers
# sl.writeSBMLFile("test_layout_override.xml")
# slr = SBMLlayout("test_layout_override.xml", autoComputeLayout=False)

slr = SBMLlayout(str(model_file), autoComputeLayout=False)

slr._describeModel()

slr.drawNetwork()

assert slr.getNodeTextAnchor("MKK_P") == "center"
# bottom means top in this situation
assert slr.getNodeVTextAnchor("MAPK") == "bottom"

assert slr.getNodeFontSize("MKK") == 11

assert slr.getNodeEdgeColor("MKKK") == "#969696"

assert slr.getNodeFillColor("MAPK_P") == "#c9e0fb"

assert slr.getReactionEdgeColor("J1") == [('MKKK_P', 'SUBSTRATE', '#ff9900'),
                                          ('MKKK', 'PRODUCT', '#ff9900')]

assert slr.getReactionFillColor("J2") == [('MKK', 'SUBSTRATE', '#ff9900'),
                                          ('MKK_P', 'PRODUCT', '#ff9900'),
                                          ('MKKK_P', 'ACTIVATOR', '#ff9900')]
コード例 #3
0
sl.setNodeEdgeWidth(["D", "X1", "C"], 3)

sl.setNodeFontWeight(["X0", "A", "B", "C", "D", "X1"], "bold")

sl.setNodeTextAnchor("X0", "right")
sl.setNodeTextAnchor("A", "left")
sl.setNodeVTextAnchor("B", "center")

sl.drawNetwork()

print("_J0 width: ", sl.getReactionCurveWidth("_J0"))

print("_J1 edge color: ", sl.getReactionEdgeColor("_J1"))
print("_J1 fill color: ", sl.getReactionFillColor("_J1"))

print("_J3 edge color: ", sl.getReactionEdgeColor("_J3"))
print("_J3 fill color: ", sl.getReactionFillColor("_J3"))

print("_J4 edge color: ", sl.getReactionEdgeColor("_J4"))
print("_J4 fill color: ", sl.getReactionFillColor("_J4"))

print("A: fill color: ", sl.getNodeFillColor("A"))
print("B: edge color: ", sl.getNodeEdgeColor("B"))
print("C: edge width: ", sl.getNodeEdgeWidth("C"))

print("X0: text anchor: ", sl.getNodeTextAnchor("X0"))
print("A: text anchor: ", sl.getNodeTextAnchor("A"))
print("B: vtext anchor: ", sl.getNodeVTextAnchor("B"))

sl.writeSBMLFile("model_simple_out.xml")