SemBioProcess / SemGen

A tool for semantics-based annotation and composition of biosimulation models
18 stars 3 forks source link

Develop SemSim-to-MATLAB converter #67

Open maxneal opened 9 years ago

maxneal commented 9 years ago

I took this off the to-do list for SG 3.0. While I was able to create a MATLABwriter that works for the CellML models we've annotated, there are a couple major issues that should be addressed before we deploy it for use.

1) Supporting the use of expressions, rather than just numbers, for the initial conditions of ODE state variables in MATLAB will require substantial development of the MMLreader. The right way to do this would be to update the JSim .jar packages to the latest version (we currently use packages that are a few versions back) which would provide some improved support for processing these initial conditions. That is, the XMML output is formatted a bit differently. We could look into getting updated packages, but with Erik Butterworth working elsewhere now, not sure whether someone at NSR could supply us with them. Erik previously sent the packages directly to me because he hadn't gotten around to releasing a proper JSim API. The alternative would be to use the existing packages; but in any event, it looks like it would still require some substantial development of the MMLreader and possibly the SemSim object model.

2) If we import a CellML model into SG then output in MATLAB, there's no guarantee that the MATLAB equations will include the required unit conversion factors in the equations. Both OpenCOR and JSim apply unit conversion factors under the hood after importing CellML code. We can't currently do the same. Although we don't need to worry about this for MML models that are imported (we read in the code that includes the unit conversion factors along with the original mathML representation), we would need to worry about it for both CellML and SBML models that are imported into SG.

I think there would be a substantial amount of development for both of these tasks, and because we don't have an immediate need for a MATLAB writer, I removed the SG 3.0 tag, but will keep the issue open.