sbmlsim.model
¶
Package for encoding models.
Submodules¶
Package Contents¶
Classes¶
Abstract base class to store a model in sbmlsim. |
|
ModelChange. |
|
Roadrunner model wrapper. |
- class sbmlsim.model.AbstractModel(source, sid=None, name=None, language=None, language_type=LanguageType.SBML, base_path=None, changes=None, selections=None)[source]¶
Bases:
object
Abstract base class to store a model in sbmlsim.
Depending on the model language different subclasses are implemented.
- Parameters
source (Union[str, pathlib.Path]) –
sid (Optional[str]) –
name (Optional[str]) –
language (Optional[str]) –
language_type (LanguageType) –
base_path (Optional[pathlib.Path]) –
changes (Dict) –
selections (List[str]) –
- __repr__(self)¶
Get string representation.
- Return type
str
- normalize(self, uinfo)¶
Normalize values to model units for all changes.
- Parameters
uinfo (sbmlsim.units.UnitsInformation) –
- to_dict(self)¶
Convert to dictionary.
- class sbmlsim.model.ModelChange[source]¶
Bases:
object
ModelChange.
Structural change to a model.
- CLAMP_SPECIES = clamp_species¶
- static clamp_species(r, species_id, formula=True, speed=10000.0)¶
Clamp/free species to certain value or formula.
This is only an approximative clamp, i.e. not working instantenious. Depending on the model kinetics different speed settings are required. FIXME: time cannot be used in formula due to https://github.com/sys-bio/roadrunner/issues/601 FIXME: concentrations and amounts are not handled (uses native species setting
i.e., amount or concentration definition.
- Parameters
r (roadrunner.RoadRunner) –
- class sbmlsim.model.RoadrunnerSBMLModel(source, base_path=None, changes=None, sid=None, name=None, selections=None, ureg=None, settings=None)[source]¶
Bases:
sbmlsim.model.AbstractModel
Roadrunner model wrapper.
- Parameters
source (Union[str, pathlib.Path, sbmlsim.model.AbstractModel]) –
base_path (pathlib.Path) –
changes (Dict) –
sid (str) –
name (str) –
selections (List[str]) –
ureg (sbmlsim.units.UnitRegistry) –
settings (Dict) –
- IntegratorSettingKeys¶
- property Q_(self)¶
Quantity to create quantities for model changes.
- Return type
sbmlsim.units.Quantity
- property r(self)¶
Roadrunner instance.
- Return type
roadrunner.RoadRunner
- get_state_path(self)¶
Get path of the state file.
The state file is a binary file which allows fast model loading.
- Return type
Optional[pathlib.Path]
- classmethod load_roadrunner_model(cls, source, state_path=None)¶
Load model from given source.
- Parameters
source (sbmlsim.model.model_resources.Source) – path to SBML model or SBML string
state_path (pathlib.Path) – path to rr state
- Returns
roadrunner instance
- Return type
roadrunner.RoadRunner
- classmethod copy_roadrunner_model(cls, r)¶
Copy roadrunner model by using the state.
- Parameters
r (roadrunner.RoadRunner) –
- Returns
- Return type
roadrunner.RoadRunner
- parse_units(self, ureg)¶
Parse units from SBML model.
- Parameters
ureg (sbmlsim.units.UnitRegistry) –
- Return type
- classmethod set_timecourse_selections(cls, r, selections=None)¶
Set the model selections for timecourse simulation.
- Parameters
r (roadrunner.RoadRunner) –
selections (List[str]) –
- Return type
List[str]
- static set_integrator_settings(r, **kwargs)¶
Set integrator settings.
- Keys are:
variable_step_size [boolean] stiff [boolean] absolute_tolerance [float] relative_tolerance [float]
- Parameters
r (roadrunner.RoadRunner) –
- Return type
roadrunner.Integrator
- static set_default_settings(r, **kwargs)¶
Set default settings of integrator.
- Parameters
r (roadrunner.RoadRunner) –
- static parameter_df(r)¶
Create GlobalParameter DataFrame.
- Returns
pandas DataFrame
- Parameters
r (roadrunner.RoadRunner) –
- Return type
pandas.DataFrame
- static species_df(r)¶
Create FloatingSpecies DataFrame.
- Returns
pandas DataFrame
- Parameters
r (roadrunner.RoadRunner) –
- Return type
pandas.DataFrame