Skip to content

sbmlteam/moccasin

Repository files navigation

MOCCASIN

MOCCASIN stands for "Model ODE Converter for Creating Automated SBML INteroperability". MOCCASIN is designed to convert certain basic forms of ODE simulation models written in MATLAB or Octave and translate them into SBML format. It thereby enables researchers to convert MATLAB models into an open and widely-used format in systems biology.

License Latest version DOI Build Status Coverage Status

Authors: Michael Hucka, Sarah Keating, and Harold Gómez.
License: This code is licensed under the LGPL version 2.1. Please see the file ../LICENSE.txt for details.
Code repository: https://github.com/sbmlteam/moccasin
Developers' discussion group: https://groups.google.com/forum/#!forum/moccasin-dev

🏁 Recent news and activities

June 2018: With version 1.3.0, we now distribute MOCCASIN as a self-contained program—users do not even need to install Python to run MOCCASIN. In addition, the previous release 1.2.0 included a fix for a critical performance bug, with the consequence that MOCCASIN should run an order of magnitude faster than the last release. Additional changes include several important bug fixes, improvements to the installation instructions, a change to keyboard shortcuts, and improved diagnostics in the GUI interface. Please see the NEWS.md file for more details.

Table of Contents

♥️ Please cite the MOCCASIN paper and the version you use

Article citations are critical for us to be able to continue support for MOCCASIN. If you use MOCCASIN and you publish papers about work that uses MOCCASIN, we ask that you please cite the MOCCASIN paper:

Harold F. Gómez, Michael Hucka, Sarah M. Keating, German Nudelman, Dagmar Iber and Stuart C. Sealfon. MOCCASIN: converting MATLAB ODE models to SBML. Bioinformatics (2016), 32(12): 1905-1906.

Please also use the DOI to indicate the specific version you use, to improve other people's ability to reproduce your results:

☀ Background and introduction

Computational modeling has become a crucial aspect of biological research, and SBML (the Systems Biology Markup Language) has become the de facto standard open format for exchanging models between software tools in systems biology. MATLAB and Octave are popular numerical computing environments used by modelers in biology, but while toolboxes for using SBML exist, many researchers either have legacy models or do not learn about the toolboxes before starting their work and then find it discouragingly difficult to export their MATLAB/Octave models to SBML.

The goal of this project is to develop software that uses a combination of heuristics and user assistance to help researchers export models written as ordinary MATLAB and Octave scripts. MOCCASIN ("Model ODE Converter for Creating Automated SBML INteroperability") helps researchers take ODE (ordinary differential equation) models written in MATLAB and Octave and export them as SBML files. Although its scope is limited to MATLAB written with certain assumptions, and general conversion of MATLAB models is impossible, MOCCASIN nevertheless can translate some common forms of models into SBML.

MOCCASIN is written in Python and does not require MATLAB to run.

✺ How it works

MOCCASIN parses MATLAB files using a novel MATLAB parser developed by the authors and written entirely in Python. It applies post-processing operations in order to interpret the MATLAB contents, then uses a network service provided by the Biochemical Abstract Machine (BIOCHAM) to invoke an algorithm developed by Fages, Gay and Soliman described in their 2015 paper titled Inferring reaction systems from ordinary differential equations. (A free technical report explaining the algorithm is available from INRIA.) Finally, it applies some post-processing to the results returned by BIOCHAM to produce the completed SBML output.

Currently, MOCCASIN is limited to MATLAB inputs in which a model is contained in a single file. The file must set up a system of differential equations as a function defined in the file, and make a call to one of the MATLAB odeNN family of solvers (e.g., ode45, ode15s, etc.). The following is a simple but complete example:

% Various parameter settings.  The specifics here are unimportant; this
% is just an example of a real input file.
%
tspan  = [0 300];
xinit  = [0; 0];
a      = 0.01 * 60;
b      = 0.0058 * 60;
c      = 0.006 * 60;
d      = 0.000192 * 60;

% A call to a MATLAB ODE solver
%
[t, x] = ode45(@f, tspan, xinit);

% A function that defines the ODEs of the model.
%
function dx = f(t, x)
  dx = [a - b * x(1); c * x(1) - d * x(2)];
end

You can view the SBML output for this example in a separate file. MOCCASIN assumes that the second parameter in the ODE function definition determines the variables that identify the SBML species; thus, the output generated by MOCCASIN will have SBML species named x_1 and x_2 by default. (The use of suffixes is necessary because plain SBML does not support arrays or vectors.) The output will also not capture any information about the particular ODE solver or the start/stop/configuration parameters used in the file, because that kind of information is not meant to be stored in SBML files anyway. (A future version of MOCCASIN will hopefully translate the additional run information into SED-ML format.)

Because MOCCASIN does not currently implement the Fages, Gay and Soliman algorithm internally, it requires a network connection during operation so that it can contact the (BIOCHAM) service.

☛ Installation and configuration

As of version 1.3, MOCCASIN is distributed as a standalone self-contained program. Users no longer need to install Python (although running MOCCASIN as a Python program still remains an option).

Preferred approach: download and install the self-contained program

To obtain a copy of MOCCASIN, please select the appropriate version from the following table. If you do not see your operating listed below, please contact us and we may be able to create an appropriate version for you.

Operating System Download Post-download instructions Note
macOS 10.13 (High Sierra) MOCCASIN-1.3.0-macos-10.13.pkg Double-click the .pkg file (a)
macOS 10.12 (Sierra) MOCCASIN-1.3.0-macos-10.12.pkg Double-click the .pkg file (a)
Ubuntu Linux 18.x MOCCASIN-1.3.0-ubuntu-18.04.tar.gz Uncompress & untar the .tar.gz (b)
Ubuntu Linux 16.x MOCCASIN-1.3.0-ubuntu-16.04.tar.gz Uncompress & untar the .tar.gz (b)
CentOS Linux 7.5 MOCCASIN-1.3.0-centos-7.5.tar.gz Uncompress & untar the .tar.gz (b)
CentOS Linux 7.4 MOCCASIN-1.3.0-centos-7.4.tar.gz Uncompress & untar the .tar.gz (b)
Windows 10 64-bit MOCCASIN-1.3.0-win-10-x64.zip Double-click the .exe (c)

Notes:

(a) The installer will create a folder in /Applications where it will place the MOCCASIN graphical application; it will also put a command-line program named moccasin in /usr/local/bin/.

(b) There is no MOCCASIN installer program for Linux. The .tar.gz archive simply contains a single program, moccasin, that can be used both to start the graphical interface and to use MOCCASIN via the command line. Move moccasin to a suitable bin directory on your computer and run it from there.

(c) The installer is a typical Windows installer program. Save the file somewhere on your computer, double-click the file to run the installer, and follow the directions.

After installation, please proceed to the section below titled Using MOCCASIN for further instructions.

Alternative approach: run MOCCASIN as a typical Python program

MOCCASIN requires Python version 3.4 or higher, and depends on other Python packages such as wxPython. Installing the necessary dependencies can be a difficult process. We provide instructions in the wiki.

After you have installed the third-party libraries that MOCCASIN depends upon, proceed to install MOCCASIN. The following is probably the simplest and most direct way:

sudo python3 -m pip install git+https://github.com/sbmlteam/moccasin.git

Alternatively, you can clone this GitHub repository to a location on your computer's file system and then run setup.py:

git clone https://github.com/sbmlteam/moccasin.git
cd moccasin
sudo python3 -m pip install .

► Using MOCCASIN

You can use MOCCASIN either via the command line or via a graphical user interface (GUI). (Note that in both cases, as mentioned above, MOCCASIN needs a network connection to perform its work.)

The graphical user interface

To run the GUI version, you typically start MOCCASIN like most ordinary programs on your computer (e.g., by double-clicking the icon). Once the GUI window opens, the first thing you will probably want to do is click the Browse button in the upper right of the window, to find the MATLAB file you want to convert on your computer. Once you do this, you can select a few options, and click the Convert button. After some time (depending on the size of the file), you should eventually get SBML output in the lowest panel of the GUI. The animation below illustrates the whole process:

MOCCASIN GUI

MOCCASIN offers a few conversion options:

  • It can generate equation-based SBML output instead of the default, which is reaction-based SBML. The former uses no reactions, and instead writes out everything in terms of SBML "rate rules".

  • It can encode variables as SBML parameters instead of the default, to encode them as SBML species. Depending on your application and what you do with the output, this may or may not be useful.

  • It can generate XPP .ode file output, instead of SBML format.

The command-line interface

The MOCCASIN installer should also place a new command-line program on your shell's search path, so that you can start MOCCASIN with a simple shell command:

moccasin

To use the command-line interface, supply one or more MATLAB files on the command line; MOCCASIN will read and convert the file(s):

moccasin matlabfile.m

It also accepts additional command-line arguments. To get information about the other options, use the -h argument (or /h on Windows):

moccasin -h

⁇ Getting help and support

MOCCASIN is under active development by a distributed team. If you have any questions, please feel free to post or email on the developer's discussion group (https://groups.google.com/forum/#!forum/moccasin-dev) or contact the main developers directly.

★ Do you like it?

If you like this software, don't forget to give this repo a star on GitHub to show your support!

♬ Contributing — info for developers

A lot remains to be done on MOCCASIN in many areas, from improving the interpretation of MATLAB to adding support for SED-ML. We would be happy to receive your help and participation if you are interested. Please feel free to contact the developers.

A quick way to find out what is currently on people's plates and our near-term plans is to look at the GitHub issue tracker for this project.

Everyone is asked to read and respect the code of conduct when participating in this project.

☺︎ Acknowledgments

Continuing work on MOCCASIN is made possible thanks to funding from the National Institutes of Health (NIH) via NIGMS grant number GM070923 (principal investigator: Michael Hucka). This software was originally developed thanks in part to funding from the Icahn School of Medicine at Mount Sinai, provided as part of the NIH-funded project Modeling Immunity for Biodefense (contract number HHSN266200500021C, Principal Investigator: Stuart Sealfon), and in part to funding from the School of Medicine at Boston University, provided as part of the NIH-funded project Modeling Immunity for Biodefense (contract number HHSN272201000053C, Principal Investigators: Thomas B. Kepler and Garnett H. Kelsoe).

We also acknowledge the contributions made by Dr. Dagmar Iber from the Department of Biosystems Science and Engineering (D-BSSE), and Dr. Bernd Rinn from the Scientific IT Services (SIS) division from ETH Zurich.

The MOCCASIN logo was created by Randy Carlton (rcarlton@rancar2.com).

MOCCASIN was makes use of numerous open-source packages, without which it would have been effectively impossible to develop MOCCASIN with the resources we had. We want to acknowledge this debt. In alphabetical order, the packages are:

  • colorama – makes ANSI escape character sequences work under MS Windows terminals
  • coverage – a tool for measuring code coverage of Python programs
  • halo – busy-spinners for Python command-line programs
  • ipdb – the IPython debugger
  • Markdown – a Python implementation of a Markdown converter
  • natsort – a natural sorting library for Python
  • plac – a command line argument parser
  • Pygments – a syntax highlighter for displaying source code
  • pyparsing – a library for creating grammars and parsers
  • pytest – a testing framework for Python
  • pytest-xdist – an extension for py.test for parallelized distributed testing
  • libSBML – a library for working with SBML
  • requests – an HTTP library for Python
  • setuptools
  • six
  • termcolor
  • tox
  • virtualenv
  • wxPython

☮︎ Copyright and license

Copyright (C) 2014-2018 jointly by the California Institute of Technology (Pasadena, California, USA), the Icahn School of Medicine at Mount Sinai (New York, New York, USA), and Boston University (Boston, Massachusetts, USA).

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder is on an "as is" basis, and the California Institute of Technology has no obligations to provide maintenance, support, updates, enhancements or modifications. In no event shall the California Institute of Technology be liable to any party for direct, indirect, special, incidental or consequential damages, including lost profits, arising out of the use of this software and its documentation, even if the California Institute of Technology has been advised of the possibility of such damage. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library in the file named "COPYING.txt" included with the software distribution.