MODEL_FILE_NAME = "largerpathway.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() == 6 assert sl.getNumberOfReactions() == 5 assert sl.getNodeFontSize("ABCDEFG") == 12 assert sl.getNodeFontWeight("F") == "normal" assert sl.getNodeFillColor("E") == "#a0e0a030" sl.drawNetwork("larger_pathway.png") # sl.setReactionCurveWidth("all", 12) sl.drawNetwork() sl.writeSBMLFile("ftest_larger_pathway.xml") slr = SBMLlayout("ftest_larger_pathway.xml")
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") assert sl.getReactionEdgeColor("_J0")[0] == ('X0', 'SUBSTRATE', '#0000ff') assert sl.getReactionEdgeColor("_J0")[1] == ('A', 'PRODUCT', '#ff0000ff') assert sl.getReactionEdgeColor("_J1")[0] == ("A", "SUBSTRATE", "#ff00ffff") assert sl.getReactionEdgeColor("_J1")[1] == ("B", "PRODUCT", "#0000ff") assert sl.getReactionEdgeColor("_J2")[0] == ('B', 'SUBSTRATE', '#0000ff')