Create SBML file with R

50 views
Skip to first unread message

fabien chambodut

unread,
Jul 27, 2015, 11:13:16 AM7/27/15
to sbml-interoperability
Hi everybody,
I have a R matrix and I want to create an SBML file from this matrix. 
To do it I have n species. The name of each parameters are the line names and the name of each reactants are in column name. 
I know that I will have n series of n+3 parameters. 

here is the matrix 

                   X1       X2        X3
Omega1  1.00      1.00       0.00
Omega2  0.00      0.00       1.00
Omega3  -1.00     0.00       0.00
Alpha       0.50      0.25       0.50
Gamma   1.00      0.75       -0.50
Beta         0.75     0.50       1.00

I want to have the next list of species 

<listOfSpecies>
   <species id="X1"  initialConcentration="2"  compartment="cell" boundaryCondition="false"/>
   <species id="X2"  initialConcentration="2"  compartment="cell" boundaryCondition="false"/>
   <species id="X3"  initialConcentration="2"  compartment="cell" boundaryCondition="false"/>
</listOfSpecies>

And a list of parameters for each species like this:

<listOfParameters>
      <parameter id = "Alpha" value = "0.50"/>
      <parameter id = "Gamma" value = "1.00"/>
      <parameter id = "Omega1" value = "1.00"/>
      <parameter id = "Omega2" value = "0.00"/>
      <parameter id = "Omega3" value = "-1.00"/>
      <parameter id = "Beta" value = "0.75"/>
    </listOfParameters>

How can I create an SBML file that contains these informations ? 

Cordially,

Fabien
 Omega1
1.00
1.00
0.0
Omega1
1.00
1.00
0.0
Omega1
1.00
1.00
0.0
Omega1
1.00
1.00
0.0

Frank T. Bergmann

unread,
Aug 3, 2015, 4:09:20 AM8/3/15
to sbml-interoperability
Hello Fabien, 

while the documentation for the R bindings is not yet complete, we have constructed a page containing examples of the most commonly used functionality under: 


You will find an example createExampleSBML.R there that shows how these elements can be constructed. 

However, in your specific case, I believe it might be better to use species and reactions to encode that information. All the parameters in your table would be reactions and the values the stoichiometries on the species references. 

best
Frank








Andrei Kramer

unread,
Jun 5, 2020, 9:00:48 AM6/5/20
to sbml-interoperability
Hi,
 in those examples, there is this: library(libSBML)

I have libsbml installed

libsbml5/focal,now 5.18.0+dfsg-1build1 amd64 [installed]
 
System Biology Markup Language library


libsbml5
-dev/focal,now 5.18.0+dfsg-1build1 amd64 [installed]
 
System Biology Markup Language library - development files



But, the library loading command above fails. Do I need anything else to be installed? I tried the packages sbmlr and RSBML, but both failed to read example sbml files I downloaded from databases. 

Frank T. Bergmann

unread,
Jun 5, 2020, 9:04:36 AM6/5/20
to sbml-interoperability
Hello Andrei, 

we made it quite a bit easier to install libSBML for R, by creating a standalone source package. So if you grab: 


and run R CMD install on the tar.gz it will install nicely. 

You can also run it directly from install_url. 

I hope this helps, 
best
Frank

Andrei Kramer

unread,
Jun 8, 2020, 12:15:42 PM6/8/20
to sbml-interoperability
Hello Frank,
 thanks, that did work as you said, very nice.
Best,
Andrei
Reply all
Reply to author
Forward
0 new messages