Skip to main content

Differentiable models of enzyme-catalysed reaction networks

Project description

Enzax

Tests Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Supported Python versions: 3.12 and newer Documentation Status

Enzax is a library of automatically differentiable equations and solvers for modelling networks of enzyme-catalysed reactions, written in JAX.

Enzax provides straightforward, fast and interoperable access to the gradients of realistic metabolic network models, allowing you to incorporate these models in your MCMC and machine learning algorithms when you want to, for example, predict the effect of down-regulating an enzyme on the yield of a fermentation experiment.

Installation

pip install enzax

Usage

Find a kinetic model's steady state

from enzax.examples import methionine
from enzax.steady_state import get_kinetic_model_steady_state
from jax import numpy as jnp

guess = jnp.full((5,) 0.01)

steady_state = get_steady_state(methionine.model, guess, methionine.parameters)

Find a steady state's Jacobian with respect to all parameters

import jax
from enzax.examples.methionine import model, parameters
from enzax.steady_state import get_steady_state
from jax import numpy as jnp

guess = jnp.full((5,), 0.01)

jacobian = jax.jacrev(get_steady_state, argnums=2)(model, guess, parameters)
jacobian["log_kcat"]["GNMT1"]
Array([-3.83561770e-07, -9.66801636e-06,  3.38183140e-10,  3.15564928e-09,
        5.28588273e-08], dtype=float64, weak_type=True)

Load a kinetic model from an sbml file

from enzax.sbml import load_libsbml_model_from_url, sbml_to_enzax

url = "https://raw.githubusercontent.com/dtu-qmcm/enzax/refs/heads/main/tests/data/exampleode.xml"

libsbml_model = load_libsbml_model_from_url(url)
# or to load an sbml file from your computer:
# libsbml_model = load_libsbml_model_from_file(path_to_file)

model, parameters = sbml_to_enzax(libsbml_model)

[!NOTE] The parameters in the sbml file have to have unique identifiers. In CopasiUI it is possible to make Global Quantities as assignments and odes. Enzax currently does not support this.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enzax-0.2.3.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enzax-0.2.3-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

Details for the file enzax-0.2.3.tar.gz.

File metadata

  • Download URL: enzax-0.2.3.tar.gz
  • Upload date:
  • Size: 76.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enzax-0.2.3.tar.gz
Algorithm Hash digest
SHA256 26dd40b4976def254061decfff8676e2727345c8dbf7b0e460812c35ad26afcb
MD5 d2088c11a30e9dc950d32dc0e668ec03
BLAKE2b-256 b74e771690a23e60e090b6c10fab716ac93b4d8101c07b10f877b2530ed5b7d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for enzax-0.2.3.tar.gz:

Publisher: release.yml on dtu-qmcm/enzax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enzax-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: enzax-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enzax-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 16f09a369d67da6cf4166d736575b46c1e4e111f2ac13152ebc4a031ee3621bb
MD5 423434f31203447f4f9ec22d7745a0f5
BLAKE2b-256 2c9dc0d256aba8721d40973b4feb6c0e9c6bd71093e895ca5b16d32dd8e4334b

See more details on using hashes here.

Provenance

The following attestation bundles were made for enzax-0.2.3-py3-none-any.whl:

Publisher: release.yml on dtu-qmcm/enzax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page