petab.v1.models.pysb_model
Functions for handling PySB models
Functions
|
Parse a PySB species name |
|
Convert a pattern string to a Pattern instance |
Classes
|
PEtab wrapper for PySB models |
- class petab.v1.models.pysb_model.PySBModel(model: Model, model_id: str | None = None)[source]
Bases:
Model
PEtab wrapper for PySB models
- static from_file(filepath_or_buffer, model_id: str | None = None)[source]
Load the model from the given path/URL
- Parameters:
filepath_or_buffer – URL or path of the model
model_id – Model ID
- Returns:
A
Model
instance holding the given model
- get_free_parameter_ids_with_values() Iterable[tuple[str, float]] [source]
Get free model parameters along with their values
- Returns:
Iterator over tuples of (parameter_id, parameter_value)
- get_parameter_ids() Iterable[str] [source]
Get all parameter IDs from this model
- Returns:
Iterator over model parameter IDs
- get_parameter_value(id_: str) float [source]
Get a parameter value
- Parameters:
id – ID of the parameter whose value is to be returned
- Raises:
ValueError – If no parameter with the given ID exists
- Returns:
The value of the given parameter as specified in the model
- get_valid_ids_for_condition_table() Iterable[str] [source]
Get IDs of all model entities that are allowed to occur as columns in the PEtab conditions table.
- Returns:
Iterator over model entity IDs
- get_valid_parameters_for_parameter_table() Iterable[str] [source]
Get IDs of all parameters that are allowed to occur in the PEtab parameters table
- Returns:
Iterator over parameter IDs
- has_entity_with_id(entity_id) bool [source]
Check if there is a model entity with the given ID
- Parameters:
entity_id – ID to check for
- Returns:
True
, if there is an entity with the given ID,False
otherwise
- is_state_variable(id_: str) bool [source]
Check whether the given ID corresponds to a model state variable
- is_valid() bool [source]
Validate this model
- Returns:
True if the model is valid, False if there are errors in this model
- petab.v1.models.pysb_model.parse_species_name(name: str) list[tuple[str, str | None, dict[str, Any]]] [source]
Parse a PySB species name
- Parameters:
name – Species name to parse
- Returns:
List of species, representing complex constituents, each as a tuple of the monomer name, the compartment name, and a dict of sites mapping to site states.
- Raises:
ValueError – In case this is not a valid ID