Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active October 8, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/3374405 to your computer and use it in GitHub Desktop.
Save kenwebb/3374405 to your computer and use it in GitHub Desktop.
Glycolysis Petri net, with mass action kinetics
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Fri Aug 17 2012 17:47:07 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Glycolysis Petri net, with mass action kinetics
Description: Glycolysis Petri net, with mass action kinetics
Url: http://www.primordion.com/Xholon/wb/
InternalName:
YoutubeId:
Keywords:
My Notes
--------
This is a simple Petri net model of the Glycolysis pathway inside each biological cell.
How to run the Java app that's included on this Xholon Workbook page::
(1) Click the "Save locally" button at the top of this page.
This will assemble the contents of the workbook into a separate web browser page.
Position the cursor in the new page and do "Select All" (Ctrl-A).
(2) Click the second "Launch" button further down on this page (http://www.primordion.com/Xholon/jnlp/Chameleon_0.jnlp).
This will start the Chameleon Java application. It's called Chameleon because if can be changed into anything else.
Select "File --> Open".
(3) Drag the contents of the workbook into the Chameleon app.
Just click on the selected text in the new browser window, and drag it anywhere within the Chameleon window.
An SVG image should appear in its own window.
(4) Click the "Refresh" button in the Chameleon window.
Explore the model to confirm that it has the same structure that's specified on this page.
Click the "Start" button to start the simulation.
Use the "Pause" and "Step" buttons to pause, unpause, and single-step the simulation.
(5) Expand the View node, and click the xYChart node to display a line chart.
By default, the simulation uses Mass Action kinetics (kineticsType="2"). Each Transition node has a reaction rate k which is defined once at the PetriNet level. You can also give each Transition a separate k value.
The PetriNet node also specifies a timeStepMultiplier of 4, which provides a simple way of doing mathematical integration. Each time step the transitions execute 4 times, but each transition only does 1/4 of its normal work. With a timeStepMultiplier of 1 and the default value for k, the model will blow up because of extreme oscillation of the token values on Place nodes::
Try timeStepMultiplier values of 1, 2, and 3.
You can also run the model as a normal Petri net without Mass Action kinetics::
Change kineticsType="2" to kineticsType="1" on the PetriNet node.
Leave the probability set to 0.5 (p="0.5") for a stochastic Petri net, or change it to 1.0 (p="1.0") for a completely deterministic Petri net.
Change timeStepMultiplier to 1.
The places and transitions of the Petri net can also get their kinetics by moving around in a Grid and interacting only when they bump into each other::
Change the kinetics type to 3 (kineticsType="3") on the PetriNet node.
Change timeStepMultiplier to 1.
Change QueueTransitions shouldAct="true" to shouldAct="false", to prevent the normal Petri net behavior from also running.
The Cytoplasm node specifies the number or rows (rows="20") and columns (cols="20") in the Grid. You can change these.
The more rows and columns, the more dilute the solution, and the longer it will take for things to happen.
The line charts generated with each of these options are qualitatively and quantitatively similar in some ways.
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
]]></script>
<_-.XholonClass>
<GlycolysisSystem/>
<Cytoplasm superClass="GridOwner"/>
<Enzyme superClass="TransitionPN">
<GlycolysisEnzyme>
<Hexokinase/>
<PhosphoGlucoIsomerase/>
<PhosphoFructokinase/>
<Aldolase/>
<TriosePhosphateIsomerase/>
<Glyceraldehyde_3_phosphateDehydrogenase/>
<PhosphoGlycerokinase/>
<PhosphoGlyceromutase/>
<Enolase/>
<PyruvateKinase/>
</GlycolysisEnzyme>
</Enzyme>
<SmallMolecule superClass="PlacePN">
<Glucose/>
<Glucose_6_Phosphate/>
<Fructose_6_Phosphate/>
<Fructose_1x6_Biphosphate/>
<DihydroxyacetonePhosphate/>
<Glyceraldehyde_3_Phosphate/>
<X1x3_BisphosphoGlycerate/>
<X3_PhosphoGlycerate/>
<X2_PhosphoGlycerate/>
<PhosphoEnolPyruvate/>
<Pyruvate/>
<!-- other small molecules -->
<Adp/>
<Atp/>
</SmallMolecule>
</_-.XholonClass>
<xholonClassDetails>
<Cytoplasm>
<port name="petriNet" connector="#xpointer(ancestor::GlycolysisSystem/PetriNet)"/>
</Cytoplasm>
</xholonClassDetails>
<GlycolysisSystem xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- kineticsType
1 = Basic place/transition net kinetics (default)
2 = Mass action kinetics
3 = Grid
-->
<PetriNet roleName="gly" kineticsType="2" k="0.010" p="0.5" timeStepMultiplier="4">
<QueueTransitions shouldAct="true"/>
<Places>
<Glucose token="500"/>
<Glucose_6_Phosphate token="0"/>
<Fructose_6_Phosphate/>
<Fructose_1x6_Biphosphate/>
<DihydroxyacetonePhosphate/>
<Glyceraldehyde_3_Phosphate/>
<X1x3_BisphosphoGlycerate/>
<X3_PhosphoGlycerate/>
<X2_PhosphoGlycerate/>
<PhosphoEnolPyruvate/>
<Pyruvate/>
<!-- other small molecules -->
<Adp/>
<Atp token="500"/>
<Plot mode="new" dataPlotterParams="Glycolysis,Time (timesteps),Amount,./statistics/,stats,1,WRITE_AS_LONG"/>
</Places>
<Transitions>
<Hexokinase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Glucose"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Glucose_6_Phosphate"/>
<!--<OutputArc weight="2" connector="ancestor::PetriNet/Places/Pyruvate"/> TEST -->
</OutputArcs>
</Hexokinase>
<PhosphoGlucoIsomerase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Glucose_6_Phosphate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Fructose_6_Phosphate"/>
</OutputArcs>
</PhosphoGlucoIsomerase>
<PhosphoFructokinase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Fructose_6_Phosphate"/>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Atp"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Fructose_1x6_Biphosphate"/>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Adp"/>
</OutputArcs>
</PhosphoFructokinase>
<!-- Aldolase produces either of two products -->
<Aldolase roleName="AldolaseA" count="10">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Fructose_1x6_Biphosphate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Glyceraldehyde_3_Phosphate"/>
</OutputArcs>
</Aldolase>
<Aldolase roleName="AldolaseB" count="10">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Fructose_1x6_Biphosphate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/DihydroxyacetonePhosphate"/>
</OutputArcs>
</Aldolase>
<TriosePhosphateIsomerase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/DihydroxyacetonePhosphate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Glyceraldehyde_3_Phosphate"/>
</OutputArcs>
</TriosePhosphateIsomerase>
<Glyceraldehyde_3_phosphateDehydrogenase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Glyceraldehyde_3_Phosphate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/X1x3_BisphosphoGlycerate"/>
</OutputArcs>
</Glyceraldehyde_3_phosphateDehydrogenase>
<PhosphoGlycerokinase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/X1x3_BisphosphoGlycerate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/X3_PhosphoGlycerate"/>
</OutputArcs>
</PhosphoGlycerokinase>
<PhosphoGlyceromutase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/X3_PhosphoGlycerate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/X2_PhosphoGlycerate"/>
</OutputArcs>
</PhosphoGlyceromutase>
<Enolase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/X2_PhosphoGlycerate"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/PhosphoEnolPyruvate"/>
</OutputArcs>
</Enolase>
<PyruvateKinase count="20">
<InputArcs>
<InputArc weight="1" connector="ancestor::PetriNet/Places/PhosphoEnolPyruvate"/>
<InputArc weight="1" connector="ancestor::PetriNet/Places/Adp"/>
</InputArcs>
<OutputArcs>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Pyruvate"/>
<OutputArc weight="1" connector="ancestor::PetriNet/Places/Atp"/>
</OutputArcs>
</PyruvateKinase>
</Transitions>
</PetriNet>
<!-- grid owner -->
<!--<Cytoplasm rows="80" cols="120" gridCellColor="000030" shouldPlacesMove="true"/>-->
<!--<Cytoplasm rows="50" cols="50" gridCellColor="000020" shouldPlacesMove="true"/>-->
<Cytoplasm rows="20" cols="20" gridCellColor="000020" shouldPlacesMove="true"/>
</GlycolysisSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:webEditionjs:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
]]></Blockbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Glycolysis</title>
<rect id="Glycolysis" fill="#98FB98" height="50" width="50" x="25" y="0"/>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment