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')]
Exemplo n.º 2
0
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")
Exemplo n.º 3
0
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._describeModel()

sl.drawNetwork()

assert sl.getNodeFontSize("X0") == 10

sl.setNodeFontSize("X0", 24)

assert sl.getNodeFontSize("X0") == 24

sl.drawNetwork()

sl.regenerateLayout()

sl.drawNetwork()

sl.setNodeFontSize("all", 18)

sl.drawNetwork()
Exemplo n.º 4
0
from pathlib import Path
import pkg_resources

from libsbml_draw.model.sbml_layout import SBMLlayout

#model_file_name = "GlycolysisOriginal_L3V1.xml"
#model_file_name = "GlycolysisOriginal-L3V1.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()

print("node font size: ", sl.getNodeFontSize("ATP"))

sl.drawNetwork("GlycolysisOriginal.pdf")

#sl.drawNetwork(figsize=(20,20))

#sl.setNodeFontSize("all", 8)

#sl.drawNetwork()

#for node in sl._SBMLlayout__network.nodes.values():
#    print("node id, name: ", node.id, node.name)