Skip to content

About

Julia Importer for Heta models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

55 Commits

Folders and files

Repository files navigation

HetaImporter

Build Status Documentation

HetaImporter.jl is a Julia package for importing Heta models into Julia. Internally HetaImporter uses Heta-compiler, a CLI tool that converts Systems Biology/QSP models written in the Heta modeling language into various formats suitable for simulation, calibration, and analysis (e.g., SBML, SimBiology, mrgsolve, and Julia code).

The package supports two ways to use Heta models from Julia:

  • HetaImporter.build_julia_file(): call heta-compiler's Julia exporter to generate Julia source file model.jl.
  • import_heta(): call heta-compiler's DynMS exporter, parse the resulting JSON, and construct a native HetaODESystem, which can be passed to SciMLBase.ODEProblem.

The generated Julia file is intended to be loaded by simulation and parameter estimation packages such as HetaSimulator.

Current interface

Get the default :nameless model as a HetaODESystem.

system = import_heta("path/to/heta-project")

Get model :my_model as HetaODESystem from a Heta project.

system = import_heta("path/to/heta-project", :my_model)

import_heta stores compiler output in a temporary directory and removes it after import. Set build_dir explicitly to retain that output in a chosen directory.

Import a DynMS JSON file directly as HetaODESystem.

system = import_dynms("path/to/output.dynms.json", :my_model)

Both import functions default to :nameless. If the selected model does not exist, they throw an error, even if another model is the only one available.

The processing stages can also be called separately:

data = HetaImporter.parse_dynms("path/to/output.dynms.json") # unvalidated dictionary
# For a Heta project, first create the file with build_dynms_file("path/to/heta-project").
HetaImporter.validate_dynms(data)
model_set = HetaImporter.convert_dynms(data) # DynMSModelSet
model = HetaImporter.convert_dynms_model(data["models"][1]) # DynMSModel

build_dynms_file compiles a Heta project and returns the DynMS file path; parse_dynms reads that file into an unvalidated dictionary. Dictionary conversion uses convert_dynms and convert_dynms_model instead of parse_dynms and

Get all models as OrderedDict{Symbol,HetaODESystem} from a Heta project.

systems = import_heta_all("path/to/heta-project")

Compile a Heta project to a Julia source file and get its path.

julia_file = HetaImporter.build_julia_file("path/to/heta-project")

Compile a Heta project to a DynMS JSON file and get its path.

dynms_file = build_dynms_file("path/to/heta-project")

Version maintenance

Support for a heta-compiler release and its DynMS format is defined in four places that must be kept in sync:

  • src/HetaImporter.jl: HETA_COMPILER_VERSION and DYNMS_SUPPORTED_VERSIONS define the runtime compatibility contract.
  • artifacts/generate_artifacts.jl: HETA_COMPILER_RELEASE selects the compiler binaries, and DYNMS_SCHEMAS maps each supported DynMS version to its schema archive.

After changing the artifact sources, regenerate Artifacts.toml from the repository root:

julia --project=artifacts artifacts\generate_artifacts.jl

About

Julia Importer for Heta models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages