npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

heta-compiler

v0.9.1

Published

Programming platform for Quantitative Systems Pharmacology modeling in NodeJS

Downloads

110

Readme

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:

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)

sudo wget -O /usr/local/bin/heta https://github.com/hetalang/heta-compiler/releases/latest/download/heta-compiler-linux-x64 && sudo chmod +x /usr/local/bin/heta

For single user without sudo previleges

mkdir -p ~/bin
wget -O ~/bin/heta https://github.com/hetalang/heta-compiler/releases/latest/download/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)

sudo wget -O /usr/local/bin/heta https://github.com/hetalang/heta-compiler/releases/latest/download/heta-compiler-macos-x64 && sudo chmod +x /usr/local/bin/heta

For single user without sudo previleges

mkdir -p ~/bin
wget -O ~/bin/heta https://github.com/hetalang/heta-compiler/releases/latest/download/heta-compiler-macos-x64
chmod +x ~/bin/heta
echo "export PATH=$PATH:~/bin" >> ~/.bashrc
source ~/.bashrc

Troubleshooting:

In some cases you may need to install Rosetta to run the tool on MacOS. To install Rosetta, run the following command in the terminal:

softwareupdate --install-rosetta

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 { 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: 'r1', actors: 's1 =>', 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());

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