MathSBML

MathSBML Home Page MathSBML Site Map

MathSBML Model Builder: add/remove/modifyUnit


addUnit[options] adds a <unitDefinition .../> to the model. Options are the same as unitToSBML.

If the id option is not specified, an id is automatically generated for the unit definition.

If the name option is not specified, the value of the id field is used.

addUnit[x, options] is the same as addUnit[id->x, options] .

modifyUnit[options] modifies a unit definition. Options are the same as unitToSBML.

modifyUnit[x, options] is the same as modifyUnit[id->x, options].

removeUnit[id] removes the specified unit definition from the model.

addUnit, removeUnit, modifyUnit are new in 2.2.0.

Example

Input:  newModel[];
        addUnit[mmlh, name -> "millimoles_per_liter_per_hour", 
                unit -> {mole -> {scale -> -3}, 
                         litre -> {exponent -> -1}, 
                         second -> {scale -> 3600, exponent -> -1}}];
Output: Unit mmlh added.  

Input:  createModel[]
Output: <?xml version="1.0" encoding="UTF-8"?>
        <!-- Generated 1-October-2003 12:45:51.874260 -->
        <!-- Generated by MathSBML 2.1.5b16 (1 Oct 2003) -->
        <sbml xmlns="http://www.sbml.org/sbml/level2"
            level="2"
            version="1">
         <model id="SBMLModel"
             name="SBMLModel">
          <listOfFunctionDefinitions/>
          <listOfUnitDefinitions>
           <unitDefinition id="mmlh"
               name="millimoles_per_liter_per_hour">
            <listOfUnits>
             <unit kind="mole"
                 scale="-3"/>
             <unit kind="litre"
                 exponent="-1"/>
             <unit kind="second"
                 exponent="-1"
                 scale="3600"/>
            </listOfUnits>
           </unitDefinition>
          </listOfUnitDefinitions>
          <listOfCompartments/>
          <listOfSpecies/>
          <listOfParameters/>
          <listOfRules/>
          <listOfReactions/>
          <listOfEvents/>
         </model>
        </sbml>