| convertToSBML | Reference Home |
convertToSBML[network, ic, rates, id, name, compartment] converts an xlr8r model into SBML Level 2 Version 1
Requires xlr8r 0.25, MathSBML 2.5.25, xlr8r2SBML.m
network is any xlr8r model that is compatable with interpret.
ic is any list of xlr8r initial conditions such as {x1->a1, x2->a2,...}.
rates is any list of replacement rules that will be converted to SBML parameter values, as in {a->27, b->3, ...}
id is the desired SBML model id.
name is the desired SBML model name.
compartment is the desired SBML compartment id.
The output of is an XML string.
Example
<<xlr8r.m;
<<mathsbml.m;
<<xlr8r2SBML.m;
...
(* define the model *)
m={{A+En->X, k1},{X->A+En, k2}, {X->B+En, k3}};
r={k1->0.01, k2->0.05, k3->1};
ic={A->1, En->1, B->0};
...
(* do stuff in xlr8r with the model *)
...
interpret[m]
{{A'[t]==-k1 A[t] En[t] + k2 X[t],
B'[t]==k3 X[t],
En'[t]= ...}
{A, B, En, X}
...
(* generate SBML for the model *)
sbml=convertToSBML[m, ic, rates, "enzmod",
"Simple Enzymatic Reaction", "cell"];
...
(* Save the sbml to an xml file *)
Export["myfile.xml", sbml];
Implementation Notes
- Models are converted to SBML Level 2 Version 1.