Heta compiler
Heta compiler is a tool for building QSP modeling platforms and compiling Heta models into different simulation formats.
See also Heta online - a web application based on Heta compiler
What it does
- checks syntax and semantics of Heta code
- combines model modules from multiple formats
- resolves dependencies and builds a complete model
- exports models to multiple simulation formats
- integrates with development workflows and CI pipelines
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
Quick start
Create platform in directory "/path/to/my-platform" (target directory)
Create Heta file: index.heta in the target directory with the content:
hetacomp1 @Compartment; s1 @Species { compartment: comp1 }; r1 @Reaction { actors: s1 => }; comp1 .= 1; s1 .= 10; r1 := k1*s1*comp1; k1 @Const = 1e-2;Compile the code into SBML format using the command line tool:
bashheta build --export=SBMLThe compiled model will appear in directory: /path/to/my-platform/dist.
Supported export formats
- SBML L2/L3 link
- Simbiology link
- DBSolveOptimum link
- mrgsolve link
- Matlab link
- Julia link
- DOT / Graphviz link
- JSON / YAML
- XLSX / CSV / TSV
- Model summary reports
How to use
- Installation
- Console commands
- Platform declaration file
- Export formats
- qsp-units.heta file
- qsp-functions.heta file
JavaScript API
Heta compiler has been written in Node.js environment and can be used as a package for browser or server-side tools.
const { Builder } = require('./src');
let builder = new Builder();
// 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: 'k1', num: 1e-2 }
];
// compilation
builder.container
.loadMany(qArr)
.knitMany();
// export to SBML
let sbmlExport = new builder.exportClasses.SBML();
let sbmlOutput = sbmlExport.makeText();
console.log(sbmlOutput[0].content);
// check errors
console.log(builder.container.hetaErrors());Support and contributing
- Use Issue Tracker
- Heta project documentation: https://hetalang.github.io/
- Source Code
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 a specific tool that allows writing model code in unified formats and transforming them depending on the user's needs: to database-like format or ODEs. Working with large models should be as easy as with 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 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-2026, Heta project