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")
model_file_name = "GlycolysisOriginal.xml" model_file = Path( 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")
assert sl.getReactionCurveWidth("_J4")[0] == ('C', 'SUBSTRATE', 5) assert sl.getReactionCurveWidth("_J4")[1] == ('D', 'PRODUCT', 5) sl.drawNetwork(scaling_factor=0.75) assert sl.getNumberOfNodes() == 6 assert sl.getNumberOfReactions() == 6 sl.setNodeEdgeColor("X1", "#ff0000") sl.setNodeFillColor("X1", "#ff000030") sl.setNodeEdgeWidth("X1", 3) assert sl.getNodeEdgeColor("X1") == "#ff0000ff" assert sl.getNodeFillColor("X1") == "#ff000030" assert sl.getNodeEdgeWidth("X1") == 3 assert sl.getNodeEdgeColor("A") == "#0000ff" assert sl.getNodeFillColor("A") == "#c9e0fb" sl.setNodeFontWeight(["A", "B", "C", "D"], "bold") assert sl.getNodeFontWeight("B") == "bold" sl.setReactionEdgeColor("_J0", "#ff0000", role_name="product") sl.setReactionEdgeColor("_J1", "#ff00ff", role_name="substrate") sl.setReactionEdgeColor("_J2", "#ff00ff", role_name="product") sl.setReactionEdgeColor("_J5", "#00ff00", species="D") sl.setReactionEdgeColor("_J3", "#ffff00", role_name="product") sl.setReactionEdgeColor("_J4", "#00ffff")