Coder Social home page Coder Social logo

raim / sbml_odesolver Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 8.0 12.01 MB

a C library for symbolic and numerical analysis of a system of ordinary differential equations (ODEs) derived from a chemical reaction network encoded in the Systems Biology Markup Language (SBML)

Home Page: http://www.tbi.univie.ac.at/~raim/odeSolver/

License: GNU Lesser General Public License v2.1

Perl 0.36% C++ 1.36% C 87.11% Shell 7.35% Makefile 2.08% Fortran 1.05% Awk 0.01% M4 0.70%

sbml_odesolver's Introduction

                              SOSlib
                   The SBML ODE SOLVER LIBRARY

       For more information about the SBML ODE Solver Library,

                               see:
           http://www.tbi.univie.ac.at/~raim/odeSolver/
                         or send email to:
                      [email protected]



INTRODUCTION

The SBML ODE Solver Library (SOSlib) is a simple command-line tool and
programming library for (1) constructing a system of ordinary differential
equations (ODE) from chemical reaction networks and (2) numerically
integrating the time course of concentrations of chemical species and (3)
basic visualization of model structure and integration results. It is based
on SBML, the XML standard for description of biological reaction networks,
the SBML library libSBML for parsing SBML and constructing the ODE system,
and on CVODE for numerical integration of the derived system of
ODEs. Optional data visualization modules allow printing of integration
results directly to Grace and drawing graphs of the reaction network, and a
Jacobian interaction graph of the ODE system via graphviz' graph drawing
library.

The SBML ODE Solver can be used as a programming library, similar in style
to the use of libSBML. Please, see the examples directory for usage within
other programs, and linking issues.

INSTALLATION

The file INSTALL in the main directory gives instructions how to
build SOSlib with GNU Tools autoconf/automake.

The file README.txt in folder Win32 gives instructions how to
build SOSlib as a Visual C++ project.

More detailed information can be accessed online at
http://www.tbi.univie.ac.at/~raim/odeSolver/doc/

USAGE

After installing the program, type

odeSolver <sbmlfile.xml> [options]

Please start the program with option -h/--help (type `odeSolver -h')
for more information on program and output control via command-line options.

Short tutorials on usage of this and other SOSlib applications can be
found online at
http://www.tbi.univie.ac.at/~raim/odeSolver/doc/app.html

ARCHITECTURE

Currently, the SOSlib has been tested on Fedora Linux,
Mac OS X/Darwin and Windows. It is written in pure ISO C and
should thus also run on other systems.
We would highly appreciate any reports!

BUG REPORTS
Please see online at
http://www.tbi.univie.ac.at/~raim/odeSolver/support/

BASIC FUNCTIONALITY

The SOSlib takes a SBML file of level 1 or level 2 (see
http://sbml.org/documents/) as an input. A SBML file describes networks of
chemical reactions and initial amounts/concentrations of the participating
chemicals; additionally it can include predefined events and rules.
The chemical reactions can have a mathemitcal definition of its rate law,
which is represented by a `kinetic law' in SBML. The `kinetic law' differs
from a usual rate law, in that it describes change of amount instead of
concentrations.

The SOSlib then constructs a set of ordinary differential equations (ODEs)
for the rate of change of all chemical species' concentrations (d[x]/dt =
f(x)) from the reactions where the species appear as reactants or
products. ODEs will not be constructed for species concentrations that are
already defined by SBML assignment or rate rules.  A Jacobian matrix of the
resulting ODE system, i.e. the derivatives of the rates towards all other
concentrations (that are defined by an ODE), is constructed, if all
equations are differentiable (i.e. continuous).

The ODE system is constructed as another SBML model, which can also be
printed out when option -o or --printsbml is given.
This SBML can however ignore SBML intentions: the resulting `species'
can also describe parameters or compartments, and not only chemcial
species. Every ODE is represented as an SBML `rate rule'.
Such a pure ODE model, encoded in SBML, could also be directly passed to
the program.

NOTE THAT: the SOSlib can thus also be used as a SOLVER for
ANY ODE SYSTEM, if the user is willing to ignore SBML definitions and
describe her ODE system in (potentially wrong!) SBML.


Then the ODE system is passed to a function that calls CVODE to numerically
integrate the ODEs, i.e. calculate the time development of concentrations.
CVODE uses the generated Jacobian matrix or an internal approximation, if one
or more ODEs contain discontinuous expressions, or the user has chosen so.

The results can be printed to the calling terminal (stdout), to a file or
to XMGRACE, if the optional grace module has been installed.

Additionally the reaction network can be drawn as a bipartite graph, using
the optional module based on GRAPHVIZ graph drawing algorithms and its
graphical output. The dependecies of rates on species concentrations
as given by the Jacobian matrix (if defined), can also be drawn as a graph.
This can sometime be useful to get a quick impression of relevant
interactions, e.g. feedback loops, in the system.

Please await the (upcoming) detailed documentation in the `doc'
directory of one of the next versions of this distribution,
for more details on the procedure and usage. Contact the authors (email
adresses above), if you have further questions.

Have Fun!

sbml_odesolver's People

Contributors

raim avatar tabe avatar xtof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sbml_odesolver's Issues

configure issues with recent libsbml and sundials versions

Hi

I try to install SBML_odeSolver but have issues at the configure step with recent versions of libsbml (5.17.0) and sundials (3.2.0).

About sundials, I managed to pass the configure step by tweaking the configure script a bit. Then the make command fails with this error message:

In file included from ./sbmlsolver/cvodeData.h:51:0,
                 from sbmlsolver/arithmeticCompiler.h:51,
                 from arithmeticCompiler.c:43:
./sbmlsolver/odeModel.h:49:33: fatal error: cvodes/cvodes_dense.h: No such file or directory
 #include <cvodes/cvodes_dense.h>

It looks cvodes/cvodes_dense.h is no longer available in sundials 3.2.0.

About libsbml, headers and libraries are found but the code run to test libsbml is maybe out-dated and does not work with libsbml 5.17.0

checking for SBML Library headers... yes
checking for SBML Library... yes
checking for correct functioning of SBML... no:
                   CPPFLAGS=-I/usr/include 
                   LDFLAGS=-Wl,-rpath,/usr/lib64 -L/usr/lib64 
                   LIBS=-lsbml -lxml2 -ldl

Also I have a general problem with most of my libraries being in /usr/lib64, not in /usr/lib.
The configure step try to guess the library path sometimes wrongly.

Thanks

CVODES error with -t flag on sundials-2.4.0 branch

I'm interested in using SBML_odeSolver to compute sensitivities to help with optimisation and parameter searching. I've managed to get sundials and SBML_odeSolver compiled (which was a bit of a challenge on Scientific Linux 7), but now have the following error:

odeSolver tutorial/Goodwin_SomoS.xml -t

[CVODES ERROR]  CVode
  No integration tolerances for sensitivity variables have been specified.

      Error -22 ???
    Warning 120000  Integration not successful. Results are not complete.
#t dx1/ddefault dx1/ddummy2 dx1/ddummy3 dx1/ddummy1 dx1/dsa3_degraded dx1/dsa2_degraded dx1/dsa1_degraded dx1/dsa13_degraded dx1/dFGF8 dx1/dsa15_degraded dx1/dgene_fgf8 dx1/dp dx1/dk1 dx1/dk2 dx1/dk3 dx1/dk4 dx1/dk9 dx1/dk5 dx1/dk6 dx1/dk7 dx1/dk8 dx1/dk10 dx1/ddfgf8 dx1/dmama dX3/ddefault dX3/ddummy2 dX3/ddummy3 dX3/ddummy1 dX3/dsa3_degraded dX3/dsa2_degraded dX3/dsa1_degraded dX3/dsa13_degraded dX3/dFGF8 dX3/dsa15_degraded dX3/dgene_fgf8 dX3/dp dX3/dk1 dX3/dk2 dX3/dk3 dX3/dk4 dX3/dk9 dX3/dk5 dX3/dk6 dX3/dk7 dX3/dk8 dX3/dk10 dX3/ddfgf8 dX3/dmama dX2/ddefault dX2/ddummy2 dX2/ddummy3 dX2/ddummy1 dX2/dsa3_degraded dX2/dsa2_degraded dX2/dsa1_degraded dX2/dsa13_degraded dX2/dFGF8 dX2/dsa15_degraded dX2/dgene_fgf8 dX2/dp dX2/dk1 dX2/dk2 dX2/dk3 dX2/dk4 dX2/dk9 dX2/dk5 dX2/dk6 dX2/dk7 dX2/dk8 dX2/dk10 dX2/ddfgf8 dX2/dmama dX2bis/ddefault dX2bis/ddummy2 dX2bis/ddummy3 dX2bis/ddummy1 dX2bis/dsa3_degraded dX2bis/dsa2_degraded dX2bis/dsa1_degraded dX2bis/dsa13_degraded dX2bis/dFGF8 dX2bis/dsa15_degraded dX2bis/dgene_fgf8 dX2bis/dp dX2bis/dk1 dX2bis/dk2 dX2bis/dk3 dX2bis/dk4 dX2bis/dk9 dX2bis/dk5 dX2bis/dk6 dX2bis/dk7 dX2bis/dk8 dX2bis/dk10 dX2bis/ddfgf8 dX2bis/dmama dfgf8/ddefault dfgf8/ddummy2 dfgf8/ddummy3 dfgf8/ddummy1 dfgf8/dsa3_degraded dfgf8/dsa2_degraded dfgf8/dsa1_degraded dfgf8/dsa13_degraded dfgf8/dFGF8 dfgf8/dsa15_degraded dfgf8/dgene_fgf8 dfgf8/dp dfgf8/dk1 dfgf8/dk2 dfgf8/dk3 dfgf8/dk4 dfgf8/dk9 dfgf8/dk5 dfgf8/dk6 dfgf8/dk7 dfgf8/dk8 dfgf8/dk10 dfgf8/ddfgf8 dfgf8/dmama 
##SENSITIVITIES
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

##SENSITIVITIES
#t dx1/ddefault dx1/ddummy2 dx1/ddummy3 dx1/ddummy1 dx1/dsa3_degraded dx1/dsa2_degraded dx1/dsa1_degraded dx1/dsa13_degraded dx1/dFGF8 dx1/dsa15_degraded dx1/dgene_fgf8 dx1/dp dx1/dk1 dx1/dk2 dx1/dk3 dx1/dk4 dx1/dk9 dx1/dk5 dx1/dk6 dx1/dk7 dx1/dk8 dx1/dk10 dx1/ddfgf8 dx1/dmama dX3/ddefault dX3/ddummy2 dX3/ddummy3 dX3/ddummy1 dX3/dsa3_degraded dX3/dsa2_degraded dX3/dsa1_degraded dX3/dsa13_degraded dX3/dFGF8 dX3/dsa15_degraded dX3/dgene_fgf8 dX3/dp dX3/dk1 dX3/dk2 dX3/dk3 dX3/dk4 dX3/dk9 dX3/dk5 dX3/dk6 dX3/dk7 dX3/dk8 dX3/dk10 dX3/ddfgf8 dX3/dmama dX2/ddefault dX2/ddummy2 dX2/ddummy3 dX2/ddummy1 dX2/dsa3_degraded dX2/dsa2_degraded dX2/dsa1_degraded dX2/dsa13_degraded dX2/dFGF8 dX2/dsa15_degraded dX2/dgene_fgf8 dX2/dp dX2/dk1 dX2/dk2 dX2/dk3 dX2/dk4 dX2/dk9 dX2/dk5 dX2/dk6 dX2/dk7 dX2/dk8 dX2/dk10 dX2/ddfgf8 dX2/dmama dX2bis/ddefault dX2bis/ddummy2 dX2bis/ddummy3 dX2bis/ddummy1 dX2bis/dsa3_degraded dX2bis/dsa2_degraded dX2bis/dsa1_degraded dX2bis/dsa13_degraded dX2bis/dFGF8 dX2bis/dsa15_degraded dX2bis/dgene_fgf8 dX2bis/dp dX2bis/dk1 dX2bis/dk2 dX2bis/dk3 dX2bis/dk4 dX2bis/dk9 dX2bis/dk5 dX2bis/dk6 dX2bis/dk7 dX2bis/dk8 dX2bis/dk10 dX2bis/ddfgf8 dX2bis/dmama dfgf8/ddefault dfgf8/ddummy2 dfgf8/ddummy3 dfgf8/ddummy1 dfgf8/dsa3_degraded dfgf8/dsa2_degraded dfgf8/dsa1_degraded dfgf8/dsa13_degraded dfgf8/dFGF8 dfgf8/dsa15_degraded dfgf8/dgene_fgf8 dfgf8/dp dfgf8/dk1 dfgf8/dk2 dfgf8/dk3 dfgf8/dk4 dfgf8/dk9 dfgf8/dk5 dfgf8/dk6 dfgf8/dk7 dfgf8/dk8 dfgf8/dk10 dfgf8/ddfgf8 dfgf8/dmama

Unable to build

Hi,
I tried to build SBML_odeSolver under Debian and was running into the same error as it was reported on the sundials list:

In file included from sbmlsolver/processAST.h:44:0,
from arithmeticCompiler.c:46:
./sbmlsolver/odeModel.h:171:3: error: unknown type name ‘CVDenseJacFn’
CVDenseJacFn compiledCVODEJacobianFunction;
^~~~~~~~~~~~
In file included from sbmlsolver/processAST.h:44:0,
from compiler.c:44:
./sbmlsolver/odeModel.h:171:3: error: unknown type name ‘CVDenseJacFn’
CVDenseJacFn compiledCVODEJacobianFunction;
^~~~~~~~~~~~
./sbmlsolver/odeModel.h:185:3: error: unknown type name ‘CVDenseJacFnB’
CVDenseJacFnB compiledCVODEAdjointJacobianFunction;
^~~~~~~~~~~~~
./sbmlsolver/odeModel.h:187:3: error: unknown type name ‘CVDenseJacFnB’
CVDenseJacFnB current_AdjJAC;
^~~~~~~~~~~~~

Any clue how to solve this?
Kind regards, Andreas.

Please add release tags

Hi,
I would consider maintaining this project as Debian package. However, I have no sensible clue what version number to use and I also have no good way to realise new versions that are intended for user consumption. It would be nice if you could add tags to specify releases which would fix this.
Kind regards, Andreas.

Nix

With a lot of help, I managed to get this to build using nix: https://nixos.org. It built for me on macOS using

nix-build --pure sundialsTest.nix -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable-small.tar.gz

I hope to get round to making it part of nixpkgs but just in case I don't, I am leaving the derivation here:

{ pkgs ? import <nixpkgs>
  { overlays = [(self: super: {



sundials = super.sundials.overrideAttrs (o: rec {

    configureFlags = "--enable-shared";
    version = "2.7.0";

    # override sundials version because SBML_odeSolver is unhappy with
    # > 2.7.0
    src = pkgs.fetchurl {
      url = "https://computation.llnl.gov/projects/${o.pname}/download/${o.pname}-${version}.tar.gz";
      sha256 = "01513g0j7nr3rh7hqjld6mw0mcx5j9z9y87bwjc16w2x2z3wm7yk";
    };
});


})]; }}:

with pkgs;

let

  libSBML = stdenv.mkDerivation rec {
  src = pkgs.fetchurl {
    url = https://sourceforge.net/projects/sbml/files/libsbml/5.17.0/stable/libSBML-5.17.0-core-src.tar.gz;
    sha256 = "153l67jb1q888y91kb439bwy6d3vsz4aqgpbcqhskmg842bx4axb";
  };
  version = "5.17.0";
  name = "libSBML-${version}";
  buildInputs = [ libxml2 ];
  NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";

  # these files are refering to /bin/pwd which does not exist in a nix
  # context
  patchPhase = ''
    sed -i 's/\/bin\/pwd/pwd/' config/makefile-common-vars.mk.in
    sed -i 's/\/bin\/pwd/pwd/' src/bindings/matlab/Makefile.in
    sed -i 's/\/bin\/pwd/pwd/' src/bindings/matlab/test/Makefile.in
  '';
};

in

{
  SBML_odeSolver = stdenv.mkDerivation rec {
    src = pkgs.fetchgit {
      url = git://github.com/raim/SBML_odeSolver;
      rev = "0a1aa2becadceb95b2d61a9fdafa9c3cc620748f";
      sha256 = "0mp7nik6hxifxkic8c6pi6kqnnd5vv9s2h06n1z0f8prg6cfg1ly";
    };
    version = "1.9.0.1";
    name = "SBML_odeSolver-${version}";
    buildInputs = [ sundials libSBML pkgconfig autoreconfHook libxml2 ];

    configureFlags = ["--with-libsbml=${libSBML}"
                      "--with-sundials=${sundials}"];
    doCheck = false;

    # fprintf takes a const char * as first argument, or a format
    # string
    patchPhase = ''
      sed -i 's/fprintf(stderr, errors);/fprintf(stderr, "%s", errors);/' examples/ChangingParameterIntegrator.c
      '';

  };
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.