amici.pysb_import

PySB Import

This module provides all necessary functionality to import a model specified in the pysb.core.Model format.

Functions Summary

extract_monomers(complex_patterns)

Constructs a list of monomer names contained in complex patterns.

has_fixed_parameter_ic(specie, pysb_model, …)

Wrapper to interface ode_export.ODEModel.state_has_fixed_parameter_initial_condition() from a pysb specie/model arguments

ode_model_from_pysb_importer(model[, …])

Creates an amici.ODEModel instance from a pysb.Model instance.

pysb2amici(model[, output_dir, observables, …])

Generate AMICI C++ files for the provided model.

pysb_model_from_path(pysb_model_file)

Load a pysb model module and return the pysb.Model instance

Functions

amici.pysb_import.extract_monomers(complex_patterns)[source]

Constructs a list of monomer names contained in complex patterns. Multiplicity of names corresponds to the stoichiometry in the complex.

Parameters

complex_patterns (typing.Union[pysb.core.ComplexPattern, typing.List[pysb.core.ComplexPattern]]) – (list of) complex pattern(s)

Return type

typing.List[str]

Returns

list of monomer names

amici.pysb_import.has_fixed_parameter_ic(specie, pysb_model, ode_model)[source]

Wrapper to interface ode_export.ODEModel.state_has_fixed_parameter_initial_condition() from a pysb specie/model arguments

Parameters
Return type

bool

Returns

False if the species does not have an initial condition at all. Otherwise the return value of ode_export.ODEModel.state_has_fixed_parameter_initial_condition()

amici.pysb_import.ode_model_from_pysb_importer(model, constant_parameters=None, observables=None, sigmas=None, noise_distributions=None, compute_conservation_laws=True, simplify=<function powsimp>, verbose=False)[source]

Creates an amici.ODEModel instance from a pysb.Model instance.

Parameters
Return type

amici.ode_export.ODEModel

Returns

New ODEModel instance according to pysbModel

amici.pysb_import.pysb2amici(model, output_dir=None, observables=None, constant_parameters=None, sigmas=None, noise_distributions=None, verbose=False, assume_pow_positivity=False, compiler=None, compute_conservation_laws=True, compile=True, simplify=<function <lambda>>, generate_sensitivity_code=True)[source]

Generate AMICI C++ files for the provided model.

Warning

PySB models with Compartments

When importing a PySB model with pysb.Compartments, BioNetGen scales reaction fluxes with the compartment size. Instead of using the respective symbols, the compartment size Parameter or Expression is evaluated when generating equations. This may lead to unexpected results if the compartment size parameter is changed for AMICI simulations.

Parameters
amici.pysb_import.pysb_model_from_path(pysb_model_file)[source]

Load a pysb model module and return the pysb.Model instance

Parameters

pysb_model_file (str) – Full or relative path to the PySB model module

Return type

pysb.core.Model

Returns

The pysb Model instance