MathSBML

MathSBML Home Page MathSBML Site Map

MathSBML Model Builder: eventToSBML


eventToSBML[options] returns an SBML <event.../> definition

eventToSBML[{{options},{options},...}] returns a <listOfEvents.../> where each option list corresponds to the options for single event definition.

eventToSymbolicSBML[arguments] returns Symbolic SBML for a single <event.../> definition

New in version 2.1.5. Revised in 2.6.0.

Options

Option Default Description
id Assigned* Value of SBML id. If not provided, eventn, where n is an integer, is generated.
name Value of id SBML name field value.
trigger none Formula to use for provide SBML event <trigger>. Must evaluate to a boolean value.
delay 0 Optional expression that evaluates to a time delay before <eventAssignment> is performed.
timeUnits none Optional units for time, used for value of timeUnits field of event.
eventAssignment none Required list of rules of the form {var1→expr1, var2→expr2,...} where each vari is a variable that should be assigned the value of expression expri when the event is triggered.
sboTerm No default sboTerm for this event
metaid No default metaid for this event
notes No default notes for this event
annotation No default annotation for this event

Example 1: Single event definition:

eventToSBML[
     id->"foo", 
     name->"A basic event", 
     timeUnits->"hours",
     trigger->(x>5), 
     eventAssignment->{x->y+x, y->0}]
returns the string
<event id"foo" name="A basic event" timeUnits="hours">
 <trigger>
  <math xmlns="http://www.w3.org/1998/Math/MathML">
   <apply>
    <gt/>
    <ci>x</ci>
    <cn>5</cn>
   </apply>
  </math>
 </trigger>
 <listOfEventAssignments>
  <eventAssignment variable="x">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <apply>
     <plus/>
     <ci>x</ci>
     <ci>y</ci>
    </apply>
   </math>
  </eventAssignment>
  <eventAssignment variable="y">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <cn>0</cn>
   </math>
  </eventAssignment>
 </listOfEventAssignments>
</event>

Example 2: list of events:

The input string:
eventToSBML[{
    {id-> "yon",
     name-> "y turned on",
     trigger-> x>17, 
     eventAssignment->{y-> 0,z-> 100}
     },
    {id-> "yoff", 
     name-> "y turned off", 
     trigger-> x>20, 
     eventAssignment->{y-> 100, z-> 0}}
     }]
returns
<listOfEvents>
 <event id="yon" name="y turned on">
  <trigger>
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <apply>
     <gt/>
     <ci>x</ci>
     <cn>17</cn>
    </apply>
   </math>
  </trigger>
  <listOfEventAssignments>
   <eventAssignment variable="y">
    <math xmlns="http://www.w3.org/1998/Math/MathML">
     <cn>0</cn>
    </math>
   </eventAssignment>
   <eventAssignment variable="z">
    <math xmlns="http://www.w3.org/1998/Math/MathML">
     <cn>100</cn>
    </math>
   </eventAssignment>
  </listOfEventAssignments>
 </event>
 <event id="yoff" name="y turned off">
  <trigger>
   <math xmlns="http://www.w3.org/1998/Math/MathML">
    <apply>
     <gt/>
     <ci>x</ci>
     <cn>20</cn>
    </apply>
   </math>
  </trigger>
  <listOfEventAssignments>
   <eventAssignment variable="y">
    <math xmlns="http://www.w3.org/1998/Math/MathML">
     <cn>100</cn>
    </math>
   </eventAssignment>
   <eventAssignment variable="z">
    <math xmlns="http://www.w3.org/1998/Math/MathML">
     <cn>0</cn>
    </math>
   </eventAssignment>
  </listOfEventAssignments>
 </event>
</listOfEvents>
Go to the top of this page