vivarium-collective / vivarium-biosimulators

A Vivarium wrapper for BioSimulators
1 stars 0 forks source link

chore: introduced model changes and observables #4

Closed jonrkarr closed 3 years ago

jonrkarr commented 3 years ago

Introduces preprocess_sed_task methods which separate

eagmon commented 3 years ago

@jonrkarr -- does Model include an initial state? The Vivarium Process has an optional initial_state() method that could be used to initialize the model. When composed with other models, it calls this method and merges all of individual initial states into a composite initial state. Alternatively, the initial state could just be passed directly into the engine as a dictionary that mirrors the store hierarchy, but this requires more manual work for the user.

jonrkarr commented 3 years ago

The initial state is stored in the model source files (Model.source).

These initial conditions can be read out with biosimulators_utils.sedml.model_utils.get_parameters_variables_for_simulation, which is already being called in tellurium_process.py. The first element of the return is a list of "parameters". This is intended to be a list of the possible parameters that an investigator could change to create a variant of a model. This includes initial conditions and their values. Due to SED-ML conventions, the values are stored as strings. We could add option to return the intended data type.

Note, SBML parameters and species don't correspond to constants and non-constant variables. That is controlled by the constant=true/false attribute of parameters and species. The biosimulators_utils methods take this into account. These methods consider "parameters" to be all constant components. They consider "variables" to be non-constant components. biosimulators_utils also deals with the SBML packages for other types of models, particularly fbc and qual, as well as all of the other model languages that we have simulation tools for.