sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.
https://sbml.org/software/libsbml
Other
38 stars 28 forks source link

libSBML R package power function is pow() instead of ^ #353

Open LeonieLorenz opened 9 months ago

LeonieLorenz commented 9 months ago

When reading in an SBML file that contains a rule with the power function (), the R package translates it into pow(x,y) which is not defined in R. Instead you would want the result to be x^y or x**y.


Here is a snippet from the SBML model that I am reading and the resulting R code below.

SBML (from BioModels BIOMD0000000982):

beta_0 1 p time

R (based on libSBML tutorial):

formulaToString( Rule_getMath(Model_getRule(m,5))) [1] "beta_0 * pow(1 - p, time)"