Giter Site home page Giter Site logo

hetalang / heta-compiler Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 4.0 7.01 MB

Software tool for the compilation of Heta-based QSP modeling platform

Home Page: https://hetalang.github.io/#/heta-compiler/

License: Apache License 2.0

JavaScript 97.48% Julia 0.46% C++ 0.14% R 0.30% TeX 1.62%
pharmacokinetics pharmacometrics pharmacodynamics systems-pharmacology systems-biology

heta-compiler's Introduction

Heta project GitHub issues Autotests Coverage Status GitHub npm Documentation status GitHub license

Heta compiler

Heta compiler is a software tool for the compilation of Heta-based QSP modeling platforms. Heta compiler can also be used as a JavaScript/Node package to develop modeling tools.

To read the full documentation, visit the Heta project homepage: https://hetalang.github.io/#/heta-compiler/.

See also Migrate to v0.6, Migrate to 0.7, Migrate to 0.8.

Table of contents

Introduction

Heta compiler is a tool for the development of Quantitative Systems Pharmacology and Systems Biology platforms. It allows combining modules written in different formats like: Heta language code, Excel sheets, JSON/YAML formatted structures, SBML and transforming them into the dynamical model/models of different formats.

Quantitative Systems Pharmacology (QSP) is a discipline that uses mathematical computer models to characterize biological systems, disease processes and drug pharmacology. QSP typically deals with mechanism-based dynamical models described by ODE systems. Sometimes the modeling systems includes hundred or thousand of components and developed by a research group involving people with different expertise.

Heta compiler can be used as the framework for a QSP modeling project of any size and complexity. It can be easily integrated with existed infrastructure, workflows or used as a part of the CI/CD strategy. The pre-formulated requirements of Heta compiler are:

  • storing the QSP models and data in integrated infrastructure;
  • support iterative modeling platform updates (continuous development approach);
  • support of models written in human-readable text and table formats;
  • export models and data to different popular formats on the fly.

How to cite

Metelkin, E., (2021). Heta compiler: a software tool for the development of large-scale QSP models and compilation into simulation formats. Journal of Open Source Software, 6(67), 3708, DOI: 10.21105/joss.03708

Installation

Installation in Windows

Download -win-x64-installer.msi from release page and install.

Installation in Linux

For all users (requires sudo previleges)

# replace [Required version] by value, i.e. v0.8.1
sudo wget -O /usr/local/bin/heta https://github.com/hetalang/heta-compiler/releases/download/[Required version]/heta-compiler-linux-x64 && sudo chmod +x /usr/local/bin/heta

For single user without sudo previleges

# replace [Required version] by value, i.e. v0.8.1
mkdir -p ~/bin
wget -O ~/bin/heta https://github.com/hetalang/heta-compiler/releases/download/[Required version]/heta-compiler-linux-x64
chmod +x ~/bin/heta
echo "export PATH=$PATH:~/bin" >> ~/.bashrc
source ~/.bashrc

Installation in Macos

For all users (requires sudo previleges)

# replace [Required version] by value, i.e. v0.8.1
sudo wget -O /usr/local/bin/heta https://github.com/hetalang/heta-compiler/releases/download/[Required version]/heta-compiler-macos-x64 && sudo chmod +x /usr/local/bin/heta

For single user without sudo previleges

# replace [Required version] by value, i.e. v0.8.1
mkdir -p ~/bin
wget -O ~/bin/heta https://github.com/hetalang/heta-compiler/releases/download/[Required version]/heta-compiler-macos-x64
chmod +x ~/bin/heta
echo "export PATH=$PATH:~/bin" >> ~/.bashrc
source ~/.bashrc

Installation in NodeJS environment

NodeJS must be installed prior to Heta compiler installation. Currently the recommended version is NodeJS v16 and newer, but NodeJS v14 is also supported.

The next steps should be taken using console (shell): cmd, PowerShell, sh, bash depending on your operating system.

  1. Check Node version.

    node -v
    # must be v14.0.0 or newer
  2. The latest stable version of Heta compiler can be installed from npm

    npm i -g heta-compiler

    OR The development version can be installed directly from GitHub

    npm i -g git+https://github.com/hetalang/heta-compiler.git

Supported tools

for more information see export formats

Heta compiler was created to support exporting to different popular modeling formats. One of the main development effort is to extend a list of supporting formats and allow people to have the same results working in different tools. The current version supports the following formats:

  • DBSolveOptimum .SLV files link
  • SBML L2V4 link
  • mrgsolve .CPP files link
  • Simbiology/Matlab .M files link
  • Matlab describing ODEs file link
  • Julia format
  • JSON formatted file
  • YAML formatted file
  • Excel sheets

Usage of command line interface

Heta compiler comes with a built-in CLI which can be used to compile files from the command line.

To learn more about options, see CLI references

The following is the example where we create a Heta module and compile it into SBML format. For example you want to create platform in directory "/path/to/my-platform" (target directory)

  1. Create Heta file: index.heta in the target directory with the content:

    comp1 @Compartment;
    s1 @Species { compartment: comp1 };
    r1 @Reaction { actors: s1 => };
    
    comp1 .= 1;
    s1 .= 10;
    r1 := k1*s1*comp1;
    k1 @Const = 1e-2;
    
    #export {
        format: SBML,
        filepath: model
    };
    
  2. Be sure you are in the target directory, use command cd /path/to/my-platform or similar if not. Compile the platform:

    heta build

    Heta builder takes "index.heta" file (module) as default, reads it and transforms to SBML file as declared in index.heta.

  3. See results of compilation in directory /path/to/my-platform/dist.

If you would like to load the platform form several files using include statement inside "index.heta", see specifications.

Creating a Heta platform template

Platform can be structured using a prepared template of folders and pre-constructed embedded files. Heta compiler provides the heta init tool for creating a such a modeling platform template.

The tool creates a draft platform including supplementary files and directories including the platform.js file, and files for git repository.

For more information see the CLI references documentation.

heta init
$ heta init
Creating a template platform in directory: "Y:\draft"...
? Platform id (template) draft
? Platform id draft
? Platform notes (platform notes)
? Platform notes platform notes
? Platform version (v0.1.0)
? Platform version v0.1.0
? Platform license (UNLICENSED)
? Platform license UNLICENSED
? Set options (y/N)
? Set options No
? Select file types (Use arrow keys)
> heta
  heta+xlsx
  heta+xlsx extended
  xlsx
  json
  yaml

Usage in NodeJS packages

Heta compiler has been written in NodeJS environment and can be used as a package for browser or server-side tools and applications.

To learn more more, see API docs (under development).

const { Container } = require('heta-compiler');

// platform code in Q-array format
let qArr = [
    { class: 'Compartment', id: 'comp1', assignments: {start_: '1'} },
    { class: 'Species', id: 's1', compartment: 'comp1', assignments: {start_: '10'} },
    { class: 'Reaction', id: 'r1', actors: 's1 =>', assignments: {ode_: 'k1*s1*comp1'} },
    { class: 'Const', id: 'r1', actors: 's1 =>', num: 1e-2 },
    { action: 'export', format: 'SBML', filepath: 'model' }
];

// compilation
let c = (new Container)
    .loadMany(qArr)
    .knitMany();
// get export element
let output = c.exportStorage[0]
    .make();

// print sbml code to console
console.log(output[0].content);

// check errors
console.log(c.hetaErrors());

Known issues and limitations

To see a list of the supported format features, go to features support table.

The tool is under active development so there are a lot of features to implement. To help us prioritize them write an issue.

Getting help

Contribute

License

Licensed under the Apache License, Version 2.0. See the LICENSE text.

Authors and history

The original author of the project is Evgeny Metelkin. The tool was inspired by the idea that large scale dynamical systems used in QSP and SB require the specific tool which allows writing model code in unified formats and transforming them depending on one's needs: to database-like format or ODEs. Working with large models should be as easy as with the small ones.

  • The initial prototype 0.1.x was developed in 2017 and named as qs3p (quantitative systems pharmacology programming platform). It was used in several InSysBio LLC projects including IRT and Alzheimer disease consortium.

  • The next versions of qs3p-js used the updated format of platform components and a new approach for storing them. A set of new exporting formats was supported. The current version supports Heta code including actions, modules, namespaces. It was used as the main infrastructure for the development of the large- and middle-scale QSP platforms developed in the framework of InSysBio services.

  • In 2020 the tool was renamed to Heta compiler and published as a Free Open Source project on GitHub under Apache 2.0 license. Since then Heta compiler has been developed in the framework of Heta project.

Copyright 2019-2024, Heta project

heta-compiler's People

Contributors

metelkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

heta-compiler's Issues

Compilation error

Hello!

I am following instructions from this page. I created this file:

comp1 @Compartment;
s1 @Species { compartment: comp1 };
r1 @Reaction { actors: s1 => };

comp1 .= 1;
s1 .= 10;
r1 := k1*s1*comp1;
k1 @Const = 1e-2;

#export {
    format: 'SBML',
    filepath: model
};

And I named it index.heta. After command heta build I got this:

No declaration file, running with defaults...
[info] Builder initialized in directory "/home/alyferryhalo/Documents/code/2021/heta_tests".
[info] Compilation of module "index.heta" of type "heta"...
[info] Reading module of type "heta" from file "/home/alyferryhalo/Documents/code/2021/heta_tests/index.heta"...
[error] Unknown format "'SBML'" in #export action.
[info] Setting references in elements, total length 41
[info] Checking for circular references in Records.
[warn] Units checking and export were skipped because of errors in compilation.
Compilation ERROR! See logs.

Moreover, there is no .log file in my directory.

I use this:

  • Ubuntu 20.04
  • node v14.0.0
  • heta v0.6.5

What is the problem?

Export options location

The issue copied from the paper discussion

openjournals/joss-reviews#3708 (comment)

@martinmodrak wrote

There is also potentially problematic design in the way the definition of export targets is part of the model specification. One could IMHO argue that there should be a separation between model definition and export targets. E.g. if I want to share my model with the community, I probably don't want to prescribe how the community will export it. Conflicting needs of different team members could lead to unnecessary version control conflicts in the export definitionsm etc. The need for --julia-only and --skip-export CLI options shows that you are struggling a bit with this design choice already.

Some (not mutually exclusive) options to consider:

Move export definitions to platform.json (presumably, I won't be sharing platform.json the same way I share model files?, i.e. two team members could share Heta code but have each their own platform?)
Allow full control of exports from the CLI (e.g. allow stuff like heta build --export "{ filepath: model, format: DBSolve }")
Keep the current system, but encourage separating export definitions and models in two files (probably by the export file including the model), codify this as a good practice (e.g. by using it in examples)
Have a make-like system, where the export definitions function as "targets" and one can specify heta build [target-list] to only build specific targets)
Generally, handling exports well seems like an important (but hard) design decision. As with the other stuff, I don't insist on this being resolved for acceptance in JOSS, just wanted to share my concerns.

Reserved words conflict: The jak2stat5 example fails with mrgsolve

I took the model at https://github.com/hetalang/qsp-benchmark/tree/master/jak2stat5/src, compiled it and tried to run it with mrgsolve. Unfortunately, I get an error.

I was able to run the simple example model from readme via mrgsolve, so it presumably isn't just an installation issue.

The error I get is:

> nameless_model <- mrgsolve::mread(model = 'nameless', file = 'model.cpp')
Building nameless ... error.

---:: stderr ::---------------------------------------------
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:25:10: error: expected unqualified-id before 'default'
   double default;
          ^~~~~~~

7:1: error: case label not within a switch statement
 default = 1.0;
 ^~~~~~~
7:8: error: expected ':' before '=' token
 default = 1.0;
        ^~
        :
7:9: error: expected primary-expression before '=' token
 default = 1.0;
         ^

14:37: error: expected primary-expression before 'default'
 EpoRJAK2_amt__0 = (init_EpoRJAK2) * default;
                                     ^~~~~~~
15:24: error: expected primary-expression before 'default'
 SOCS3_amt__0 = (0.0) * default;
                        ^~~~~~~
16:28: error: expected primary-expression before 'default'
 EpoRpJAK2_amt__0 = (0.0) * default;
                            ^~~~~~~
17:26: error: expected primary-expression before 'default'
 SHP1Act_amt__0 = (0.0) * default;
                          ^~~~~~~
18:31: error: expected primary-expression before 'default'
 EpoRJAK2_CIS_amt__0 = (0.0) * default;
                               ^~~~~~~
19:30: error: expected primary-expression before 'default'
 p1EpoRpJAK2_amt__0 = (0.0) * default;
                              ^~~~~~~
20:30: error: expected primary-expression before 'default'
 p2EpoRpJAK2_amt__0 = (0.0) * default;
                              ^~~~~~~
21:31: error: expected primary-expression before 'default'
 p12EpoRpJAK2_amt__0 = (0.0) * default;
                               ^~~~~~~
22:29: error: expected primary-expression before 'default'
 SHP1_amt__0 = (init_SHP1) * default;
                             ^~~~~~~
24:22: error: expected primary-expression before 'default'
 CIS_amt__0 = (0.0) * default;
                      ^~~~~~~
In file included from nameless-mread-source.cpp:3:

nameless-mread-header.h:89:35: error: expected primary-expression before 'default'
 #define EpoRJAK2 (EpoRJAK2_amt_ / default)
                                   ^~~~~~~
44:13: note: in expansion of macro 'EpoRJAK2'
 v1 = (Epo * EpoRJAK2 * JAK2ActEpo) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
             ^~~~~~~~
nameless-mread-header.h:89:35: error: expected ')' before 'default'
 #define EpoRJAK2 (EpoRJAK2_amt_ / default)
                  ~                ^~~~~~~
44:13: note: in expansion of macro 'EpoRJAK2'
 v1 = (Epo * EpoRJAK2 * JAK2ActEpo) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
             ^~~~~~~~
44:75: error: expected ')' before ';' token
 v1 = (Epo * EpoRJAK2 * JAK2ActEpo) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
      ~                                                                    ^
                                                                           )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:90:37: error: expected primary-expression before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                                     ^~~~~~~
45:6: note: in expansion of macro 'EpoRpJAK2'
 v2 = EpoRpJAK2 * (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act;
      ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected ')' before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                   ~                 ^~~~~~~
45:6: note: in expansion of macro 'EpoRpJAK2'
 v2 = EpoRpJAK2 * (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act;
      ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected primary-expression before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                                     ^~~~~~~
46:7: note: in expansion of macro 'EpoRpJAK2'
 v3 = (EpoRpJAK2 * EpoRActJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
       ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected ')' before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                   ~                 ^~~~~~~
46:7: note: in expansion of macro 'EpoRpJAK2'
 v3 = (EpoRpJAK2 * EpoRActJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
       ^~~~~~~~~
46:71: error: expected ')' before ';' token
 v3 = (EpoRpJAK2 * EpoRActJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
      ~                                                                ^
                                                                       )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:90:37: error: expected primary-expression before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                                     ^~~~~~~
47:13: note: in expansion of macro 'EpoRpJAK2'
 v4 = (3.0 * EpoRpJAK2 * EpoRActJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
             ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected ')' before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                   ~                 ^~~~~~~
47:13: note: in expansion of macro 'EpoRpJAK2'
 v4 = (3.0 * EpoRpJAK2 * EpoRActJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
             ^~~~~~~~~
47:115: error: expected ')' before ';' token
 v4 = (3.0 * EpoRpJAK2 * EpoRActJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
      ~                                                                                                            ^
                                                                                                                   )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:91:41: error: expected primary-expression before 'default'
 #define p1EpoRpJAK2 (p1EpoRpJAK2_amt_ / default)
                                         ^~~~~~~
48:27: note: in expansion of macro 'p1EpoRpJAK2'
 v5 = (3.0 * EpoRActJAK2 * p1EpoRpJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
                           ^~~~~~~~~~~
nameless-mread-header.h:91:41: error: expected ')' before 'default'
 #define p1EpoRpJAK2 (p1EpoRpJAK2_amt_ / default)
                     ~                   ^~~~~~~
48:27: note: in expansion of macro 'p1EpoRpJAK2'
 v5 = (3.0 * EpoRActJAK2 * p1EpoRpJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
                           ^~~~~~~~~~~
48:117: error: expected ')' before ';' token
 v5 = (3.0 * EpoRActJAK2 * p1EpoRpJAK2) / ((EpoRCISInh * EpoRJAK2_CIS + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0));
      ~                                                                                                              ^
                                                                                                                     )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:92:41: error: expected primary-expression before 'default'
 #define p2EpoRpJAK2 (p2EpoRpJAK2_amt_ / default)
                                         ^~~~~~~
49:21: note: in expansion of macro 'p2EpoRpJAK2'
 v6 = (EpoRActJAK2 * p2EpoRpJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
                     ^~~~~~~~~~~
nameless-mread-header.h:92:41: error: expected ')' before 'default'
 #define p2EpoRpJAK2 (p2EpoRpJAK2_amt_ / default)
                     ~                   ^~~~~~~
49:21: note: in expansion of macro 'p2EpoRpJAK2'
 v6 = (EpoRActJAK2 * p2EpoRpJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
                     ^~~~~~~~~~~
49:73: error: expected ')' before ';' token
 v6 = (EpoRActJAK2 * p2EpoRpJAK2) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0);
      ~                                                                  ^
                                                                         )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:96:33: error: expected primary-expression before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                                 ^~~~~~~
50:38: note: in expansion of macro 'SHP1Act'
 v7 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p1EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:96:33: error: expected ')' before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                 ~               ^~~~~~~
50:38: note: in expansion of macro 'SHP1Act'
 v7 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p1EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:96:33: error: expected primary-expression before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                                 ^~~~~~~
51:38: note: in expansion of macro 'SHP1Act'
 v8 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p2EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:96:33: error: expected ')' before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                 ~               ^~~~~~~
51:38: note: in expansion of macro 'SHP1Act'
 v8 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p2EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:96:33: error: expected primary-expression before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                                 ^~~~~~~
52:38: note: in expansion of macro 'SHP1Act'
 v9 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p12EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:96:33: error: expected ')' before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                 ~               ^~~~~~~
52:38: note: in expansion of macro 'SHP1Act'
 v9 = (JAK2EpoRDeaSHP1 / init_SHP1) * SHP1Act * p12EpoRpJAK2;
                                      ^~~~~~~
nameless-mread-header.h:94:43: error: expected primary-expression before 'default'
 #define EpoRJAK2_CIS (EpoRJAK2_CIS_amt_ / default)
                                           ^~~~~~~
53:7: note: in expansion of macro 'EpoRJAK2_CIS'
 v10 = EpoRJAK2_CIS * (EpoRCISRemove / init_EpoRJAK2) * (p12EpoRpJAK2 + p1EpoRpJAK2);
       ^~~~~~~~~~~~
nameless-mread-header.h:94:43: error: expected ')' before 'default'
 #define EpoRJAK2_CIS (EpoRJAK2_CIS_amt_ / default)
                      ~                    ^~~~~~~
53:7: note: in expansion of macro 'EpoRJAK2_CIS'
 v10 = EpoRJAK2_CIS * (EpoRCISRemove / init_EpoRJAK2) * (p12EpoRpJAK2 + p1EpoRpJAK2);
       ^~~~~~~~~~~~
nameless-mread-header.h:95:27: error: expected primary-expression before 'default'
 #define SHP1 (SHP1_amt_ / default)
                           ^~~~~~~
54:7: note: in expansion of macro 'SHP1'
 v11 = SHP1 * (SHP1ActEpoR / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2);
       ^~~~
nameless-mread-header.h:95:27: error: expected ')' before 'default'
 #define SHP1 (SHP1_amt_ / default)
              ~            ^~~~~~~
54:7: note: in expansion of macro 'SHP1'
 v11 = SHP1 * (SHP1ActEpoR / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2);
       ^~~~
nameless-mread-header.h:96:33: error: expected primary-expression before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                                 ^~~~~~~
55:17: note: in expansion of macro 'SHP1Act'
 v12 = SHP1Dea * SHP1Act;
                 ^~~~~~~
nameless-mread-header.h:96:33: error: expected ')' before 'default'
 #define SHP1Act (SHP1Act_amt_ / default)
                 ~               ^~~~~~~
55:17: note: in expansion of macro 'SHP1Act'
 v12 = SHP1Dea * SHP1Act;
                 ^~~~~~~
nameless-mread-header.h:90:37: error: expected primary-expression before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                                     ^~~~~~~
56:50: note: in expansion of macro 'EpoRpJAK2'
 v13 = (STAT5 * (STAT5ActJAK2 / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2)) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0) * cyt;
                                                  ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected ')' before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                   ~                 ^~~~~~~
56:50: note: in expansion of macro 'EpoRpJAK2'
 v13 = (STAT5 * (STAT5ActJAK2 / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2)) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0) * cyt;
                                                  ^~~~~~~~~
56:150: error: expected ')' before ';' token
 v13 = (STAT5 * (STAT5ActJAK2 / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2)) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0) * cyt;
                                                 ~                                                                                                    ^
                                                                                                                                                      )
56:150: error: expected ')' before ';' token
 v13 = (STAT5 * (STAT5ActJAK2 / init_EpoRJAK2) * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2)) / (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0) * cyt;
       ~                                                                                                                                              ^
                                                                                                                                                      )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:93:43: error: expected primary-expression before 'default'
 #define p12EpoRpJAK2 (p12EpoRpJAK2_amt_ / default)
                                           ^~~~~~~
57:64: note: in expansion of macro 'p12EpoRpJAK2'
 v14 = (STAT5 * (STAT5ActEpoR / pow(init_EpoRJAK2, 2.0)) * pow((p12EpoRpJAK2 + p1EpoRpJAK2), 2.0)) / ((CIS * (CISInh / CISEqc) + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0)) * cyt;
                                                                ^~~~~~~~~~~~
nameless-mread-header.h:93:43: error: expected ')' before 'default'
 #define p12EpoRpJAK2 (p12EpoRpJAK2_amt_ / default)
                      ~                    ^~~~~~~
57:64: note: in expansion of macro 'p12EpoRpJAK2'
 v14 = (STAT5 * (STAT5ActEpoR / pow(init_EpoRJAK2, 2.0)) * pow((p12EpoRpJAK2 + p1EpoRpJAK2), 2.0)) / ((CIS * (CISInh / CISEqc) + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0)) * cyt;
                                                                ^~~~~~~~~~~~
57:180: error: expected ')' before ';' token
 v14 = (STAT5 * (STAT5ActEpoR / pow(init_EpoRJAK2, 2.0)) * pow((p12EpoRpJAK2 + p1EpoRpJAK2), 2.0)) / ((CIS * (CISInh / CISEqc) + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0)) * cyt;
                                                               ~                                                                                                                    ^
                                                                                                                                                                                    )
57:180: error: expected ')' before ';' token
 v14 = (STAT5 * (STAT5ActEpoR / pow(init_EpoRJAK2, 2.0)) * pow((p12EpoRpJAK2 + p1EpoRpJAK2), 2.0)) / ((CIS * (CISInh / CISEqc) + 1.0) * (SOCS3 * (SOCS3Inh / SOCS3Eqc) + 1.0)) * cyt;
       ~                                                                                                                                                                            ^
                                                                                                                                                                                    )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:106:25: error: expected primary-expression before 'default'
 #define CIS (CIS_amt_ / default)
                         ^~~~~~~
68:7: note: in expansion of macro 'CIS'
 v25 = CIS * CISTurn;
       ^~~
nameless-mread-header.h:106:25: error: expected ')' before 'default'
 #define CIS (CIS_amt_ / default)
             ~           ^~~~~~~
68:7: note: in expansion of macro 'CIS'
 v25 = CIS * CISTurn;
       ^~~
nameless-mread-header.h:113:29: error: expected primary-expression before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
                             ^~~~~~~
78:7: note: in expansion of macro 'SOCS3'
 v35 = SOCS3 * SOCS3Turn;
       ^~~~~
nameless-mread-header.h:113:29: error: expected ')' before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
               ~             ^~~~~~~
78:7: note: in expansion of macro 'SOCS3'
 v35 = SOCS3 * SOCS3Turn;
       ^~~~~
nameless-mread-header.h:90:37: error: expected primary-expression before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                                     ^~~~~~~
81:64: note: in expansion of macro 'EpoRpJAK2'
 pJAK2_au = log10(offset_pJAK2_long + 2.0 * scale_pJAK2_long * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                                ^~~~~~~~~
nameless-mread-header.h:90:37: error: expected ')' before 'default'
 #define EpoRpJAK2 (EpoRpJAK2_amt_ / default)
                   ~                 ^~~~~~~
81:64: note: in expansion of macro 'EpoRpJAK2'
 pJAK2_au = log10(offset_pJAK2_long + 2.0 * scale_pJAK2_long * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                                ^~~~~~~~~
81:134: error: expected ')' before ';' token
 pJAK2_au = log10(offset_pJAK2_long + 2.0 * scale_pJAK2_long * (EpoRpJAK2 + p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                               ~                                                                      ^
                                                                                                                                      )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:93:43: error: expected primary-expression before 'default'
 #define p12EpoRpJAK2 (p12EpoRpJAK2_amt_ / default)
                                           ^~~~~~~
82:65: note: in expansion of macro 'p12EpoRpJAK2'
 pEpoR_au = log10(offset_pEpoR_long + 16.0 * scale_pEpoR_long * (p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                                 ^~~~~~~~~~~~
nameless-mread-header.h:93:43: error: expected ')' before 'default'
 #define p12EpoRpJAK2 (p12EpoRpJAK2_amt_ / default)
                      ~                    ^~~~~~~
82:65: note: in expansion of macro 'p12EpoRpJAK2'
 pEpoR_au = log10(offset_pEpoR_long + 16.0 * scale_pEpoR_long * (p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                                 ^~~~~~~~~~~~
82:123: error: expected ')' before ';' token
 pEpoR_au = log10(offset_pEpoR_long + 16.0 * scale_pEpoR_long * (p12EpoRpJAK2 + p1EpoRpJAK2 + p2EpoRpJAK2) / init_EpoRJAK2);
                                                                ~                                                          ^
                                                                                                                           )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:106:25: error: expected primary-expression before 'default'
 #define CIS (CIS_amt_ / default)
                         ^~~~~~~
83:34: note: in expansion of macro 'CIS'
 CIS_au = log10(offset_CIS_long + CIS * scale_CIS_long / CISEqc);
                                  ^~~
nameless-mread-header.h:106:25: error: expected ')' before 'default'
 #define CIS (CIS_amt_ / default)
             ~           ^~~~~~~
83:34: note: in expansion of macro 'CIS'
 CIS_au = log10(offset_CIS_long + CIS * scale_CIS_long / CISEqc);
                                  ^~~
nameless-mread-header.h:113:29: error: expected primary-expression before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
                             ^~~~~~~
84:43: note: in expansion of macro 'SOCS3'
 SOCS3_au = log10(offset_SOCS3_long + fabs(SOCS3) * scale_SOCS3_long / SOCS3Eqc);
                                           ^~~~~
nameless-mread-header.h:113:29: error: expected ')' before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
               ~             ^~~~~~~
84:43: note: in expansion of macro 'SOCS3'
 SOCS3_au = log10(offset_SOCS3_long + fabs(SOCS3) * scale_SOCS3_long / SOCS3Eqc);
                                           ^~~~~
nameless-mread-header.h:95:27: error: expected primary-expression before 'default'
 #define SHP1 (SHP1_amt_ / default)
                           ^~~~~~~
88:18: note: in expansion of macro 'SHP1'
 SHP1_abs = log10(SHP1 + SHP1Act);
                  ^~~~
nameless-mread-header.h:95:27: error: expected ')' before 'default'
 #define SHP1 (SHP1_amt_ / default)
              ~            ^~~~~~~
88:18: note: in expansion of macro 'SHP1'
 SHP1_abs = log10(SHP1 + SHP1Act);
                  ^~~~
nameless-mread-header.h:106:25: error: expected primary-expression before 'default'
 #define CIS (CIS_amt_ / default)
                         ^~~~~~~
89:22: note: in expansion of macro 'CIS'
 CIS_abs = log10(fabs(CIS));
                      ^~~
nameless-mread-header.h:106:25: error: expected ')' before 'default'
 #define CIS (CIS_amt_ / default)
             ~           ^~~~~~~
89:22: note: in expansion of macro 'CIS'
 CIS_abs = log10(fabs(CIS));
                      ^~~
nameless-mread-header.h:113:29: error: expected primary-expression before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
                             ^~~~~~~
90:24: note: in expansion of macro 'SOCS3'
 SOCS3_abs = log10(fabs(SOCS3));
                        ^~~~~
nameless-mread-header.h:113:29: error: expected ')' before 'default'
 #define SOCS3 (SOCS3_amt_ / default)
               ~             ^~~~~~~
90:24: note: in expansion of macro 'SOCS3'
 SOCS3_abs = log10(fabs(SOCS3));
                        ^~~~~
nameless-mread-header.h:95:27: error: expected primary-expression before 'default'
 #define SHP1 (SHP1_amt_ / default)
                           ^~~~~~~
98:39: note: in expansion of macro 'SHP1'
 tSHP1_au = log10(scale_SHP1_shp1oe * (SHP1 + SHP1Act) / init_SHP1);
                                       ^~~~
nameless-mread-header.h:95:27: error: expected ')' before 'default'
 #define SHP1 (SHP1_amt_ / default)
              ~            ^~~~~~~
98:39: note: in expansion of macro 'SHP1'
 tSHP1_au = log10(scale_SHP1_shp1oe * (SHP1 + SHP1Act) / init_SHP1);
                                       ^~~~
98:67: error: expected ')' before ';' token
 tSHP1_au = log10(scale_SHP1_shp1oe * (SHP1 + SHP1Act) / init_SHP1);
                                      ~                            ^
                                                                   )
In file included from nameless-mread-source.cpp:3:
nameless-mread-header.h:106:25: error: expected primary-expression before 'default'
 #define CIS (CIS_amt_ / default)
                         ^~~~~~~
99:17: note: in expansion of macro 'CIS'
 CIS_au1 = log10(CIS * scale1_CIS_dr90 / CISEqc);
                 ^~~
nameless-mread-header.h:106:25: error: expected ')' before 'default'
 #define CIS (CIS_amt_ / default)
             ~           ^~~~~~~
99:17: note: in expansion of macro 'CIS'
 CIS_au1 = log10(CIS * scale1_CIS_dr90 / CISEqc);
                 ^~~
nameless-mread-header.h:106:25: error: expected primary-expression before 'default'
 #define CIS (CIS_amt_ / default)
                         ^~~~~~~
100:17: note: in expansion of macro 'CIS'
 CIS_au2 = log10(CIS * scale2_CIS_dr90 / CISEqc);
                 ^~~
nameless-mread-header.h:106:25: error: expected ')' before 'default'
 #define CIS (CIS_amt_ / default)
             ~           ^~~~~~~
100:17: note: in expansion of macro 'CIS'
 CIS_au2 = log10(CIS * scale2_CIS_dr90 / CISEqc);
                 ^~~
make: *** [C:/PROGRA~1/R/R-41~1.0/etc/x64/Makeconf:245: nameless-mread-source.o] Error 1
------------------------------------------------------------
Error: the model build step failed.

Mrgsolve to SBML conversion

Colleagues and I at the Dutch National Institute for Public Health and the Environment are working on developing a workflow to automatically convert ODE-models developed in various software environments (e.g. Mrgsolve) to the SBML format. We came across your heta package and were very interested since it already supports the conversion in the opposite direction, from SBML to various software environment. Thus, we were wondering if there are any future plans to extend the heta compiler to also support the conversion from the various software environments, in particular Mrgsolve, to SBML. If not, do you have maybe have any suggestions of existing packages that support the conversion from Mrgsolve to SBML?

Best,
Jordi

ModelingToolkit or Catalyst export?

It's hard for me to tell where it's hitting in the Julia stack, but I just wanted to make a note that it would be nice if this could be exporting directly to ModelingToolkit.jl's ODESystem or ReactionSystem.

CSwitcher is not handled by Mgrsolve, DBSolve, without a warning

I tried running the model under cases/9-c-switcher. I modified it to export also for MgrSolve. The exported SBML model (as run at http://core.fun.bio.keio.ac.jp/SBMLWebApp/) produces results that seem to take the switcher into account:

image

However, the results in MgrSolve appear to ignore the switcher:

image

The same result for DBSolve:

image

However, there was no indication that CSwitcher is unsupported in either MgrSolve or DBSolve, here's the full output from the compilation:

Running compilation with declaration file "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\platform.json"...
[info] Builder initialized in directory "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher".
[info] Platform id: "cs"
[info] Compilation of module "src/index.heta" of type "heta"...
[info] Reading module of type "heta" from file "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\src\index.heta"...
[info] Setting references in elements, total length 51
[info] Checking for circular references in Records.
[warn] Units checking skipped. To turn it on set "unitsCheck: true" in declaration.
[info] Checking unit's terms.
[info] Start exporting to files, total: 7.
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\sbml.xml" of format "SBML"...
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\model" of format "SLV"...
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\model" of format "DBSolve"...
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\julia" of format "Julia"...
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\matlab" of format "Matlab"...
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\simbio" of format "Simbio"...
[warn] Cannot check units consistency for "r1" because no units found for "k1"
[warn] Cannot check units consistency for "r1" because no units found for "x1"
[warn] Cannot check units consistency for "r1" because no units found for "comp1"
[info] Exporting to "C:\Users\modrak_m\Documents\small\heta-review\heta-compiler-master\cases\9-c-switcher\dist\mrgsolve" of format "Mrgsolve"...
Compilation OK!

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.