changed:
-
Some thoughts on the best practices enabling the reuse of models and model components...
Altering existing models
========================
For the case of (cardiac) electrophysiology models, there are generally two modifications that you might wish to make to existing models:
1. the addition of a new current; and
2. a new scale factor for an existing current.
Assume the model encapsulation structure::
model
Na_1
Na_2
K_1
K_2
Ca_1
Ca_2
Ca_3
membrane
ionDynamics
with the Ca, Na, and K current values being available via the ``model`` component and the membrane potential equation ``dV/dt = Itotal/Cm`` and ``ionDynamics`` defining equations like ``d[ion]/dt = ion_flux`` with ion flux defined by some equation involving the total current for each ionic specie.
To add a new current to this hierarchy would involve importing all the existing top level components (under ``model``), adding in the new current definition, rebuilding the encapsulation hierarchy and connections, and updating ``ionDynamics`` to include the new current as appropriate.
An alternative is to define (within the original model) additional ion specific currents which come into the top level ``model`` component (as parameter values) and are incorporated into the membrane potential and ion dynamics equations. By doing this, model authors are free to import the top level ``model`` component, define their new current(s) and connect it to the appropriate ion specific additional current. This is also a good way to define a (potassium) stimulus current without the need to defining a *special* stimulus current variable within the model.
This takes care of case (1) above, but initially doesn't seem to help with case (2). For case (2), you typically might be wanting to add a new dependence to an existing current. For example, you want to add a Hill-type relationship defining the effect of ![ATP]i on the maximal relative conductivity of a particular channel. The trick is to add this scale factor to the original current equation without having to import a bunch of components and redefining connections and equations within those existing models.
One potential solution would be to use the additional current mechanism from above. You import the ``model`` component, which gives you access to the current values. You can then calculate the actual current value you want for the particular case (i.e., ``ICa_1s = ICa_1 * sf``) and then subtract the original current and add the scaled current to the additional current (i.e., ``ICa_additional = ICa_1s - ICa_1``). I (andre) have just started looking at this approach, but it looks like it might work... However, this approach will not work if a particular current is used in some other way within the original model. *(preliminary results suggest this approach at least works fine)*