sbmltoodejax.utils

sbmltoodejax.utils#

sbmltoodejax.utils.generate_biomodel(model_idx, model_fp='jax_model.py', vary_constant_reactants=False, vary_boundary_reactants=False, deltaT=0.1, atol=1e-06, rtol=1e-12, mxstep=5000000)[source]#

Calls the sbmltoodejax.modulegeneration.GenerateModel for a SBML model hosted on the BioModel website and indexed by the provided model_idx.

Parameters:
  • model_idx – either an integer, or a valid model id

  • model_fp (str) – filepath for the generated file

  • deltaT (float, optional) – parameter passed to sbmltoodejax.modulegeneration.GenerateModel. Default to 0.1.

  • atol (float, optional) – parameter passed to sbmltoodejax.modulegeneration.GenerateModel. Default to 1e-6.

  • rtol (float, optional) – parameter passed to sbmltoodejax.modulegeneration.GenerateModel. Default to 1e-12.

  • mxstep (int, optional) – parameter passed to sbmltoodejax.modulegeneration.GenerateModel. Default to 5000000.

Returns:

the filepath containing the generated python file

Return type:

model_fp (str)

sbmltoodejax.utils.load_biomodel(model_idx, model_fp='jax_model.py', vary_constant_reactants=False, vary_boundary_reactants=False, deltaT=0.1, atol=1e-06, rtol=1e-12, mxstep=5000000)[source]#

Calls the generate_biomodel function for a SBML model hosted on the BioModel website and indexed by the provided model_idx, then loads and returns the generated model module and y0, w0, c variables.

Parameters:
  • model_idx – either an integer, or a valid model id

  • model_fp (str) – filepath for the generated file

  • deltaT (float, optional) – parameter passed to generate_biomodel. Default to 0.1.

  • atol (float, optional) – parameter passed to generate_biomodel. Default to 1e-6.

  • rtol (float, optional) – parameter passed to generate_biomodel. Default to 1e-12.

  • mxstep (int, optional) – parameter passed to generate_biomodel. Default to 5000000.

Returns:

tuple containing

  • model (ModelRollout): generated model rollout module

  • y0 (jax.numpy.Array): default initial state of y variable(as provided in the SBML file)

  • w0 (jax.numpy.Array): default initial state of w variable (as provided in the SBML file)

  • c (jax.numpy.Array): default values of constant kinematic parameters c (as provided in the SBML file)