There are several levels on which modeling systems could communicate:
All of these are now in the domain of NeuroML, and the following should be considered as trial experiences and proposals and towards establishing such standards.
For Neuron, the key communications are at leves 2 and 3 above. It performs all its own calculations, but uses the Catacomb channel editor as one way to make kinetic-scheme channels. Since it has access to Catacomb, it is not essential for Neuron to understand the model descriptions: they can be parsed by Catacomb and passed to neuron pre-digested as arrays or objects.
Neuron has a paralled object for each KSChannel object in Catacomb. When the Catacomb channel is changed (typically not at every mouse movement but when it is somewhat fixed, as when the mouse leaves the window) Neuron calls a getData event on the catacomb channel model which exports its data as an Object array: Object[].
The format of this data is as follows, where kSChannel is an instance of catacomb.channel.KSChannel.
All quantities are in units of milliVolts and milliseconds.
Object[] oa = kSChannel.getData()
oa[0]: String[1] {name}
The name of the channel
oa[1]: int[1] {Ngcomp}
The number of gating complexes
oa[2]: String[2] {ion_name, conductance_model}
ion_name is one of "na", "k", "ca", " non specific"
conductance_model is one of "ohmic", "ghk", "nernst"
oa[3]: Object[5] properties of the first gating complex - see below
oa[4], oa[5] etc, if present, are successive gating complexes up to
oa[2+ngcomp];
Each gating complex is an array og[] of arrays as follows:
og[0]: int[3] {Nstate, Ntrans, power}
Nstate = number of states
Ntrans = number of transitions
power = power to which the block should be raised,
the number of identical serial copies on the
channel
og[1]: int[Ntrans][5]
For each transition, {type, i_source, i_target,
i_agent, i_local_agent}
where type is
1 - voltage gated transition
2 - ligand binding reaction, with the binding site outside
3 - ligand binding reaction, binding site inside
i_source and i_target are the indeces of the start
and end states in the state list.
i_agent only applies to binding reactions, and is the
index of the agent in an external agent list.
i_local_agent is like i_agent, but refers to the
local list of agents, supplied as og[5]
og[2]: double[Ntrans][5]
For each transition, either
paraneters of the voltage dependence, (type == 1) or
Kd and the off rate (type = 2 or type = 3)
For voltage dependent transitions the gating parameters, gp,
define the the forwared and reverse rates as follows,
where ebykt is E/kT, or about 0.04 in the mV,ms units
private static double alpha (double[] gp, double v) {
double a = gp[0] * Math.exp (ebykt * gp[2] * gp[3] * v);
a = 1. / (1. / a + 1./gp[4]);
return a;
}
private static double beta (double[] gp, double v) {
double b = gp[1] * Math.exp (-ebykt * gp[2] * (1. - gp[3]) * v);
b = 1. / (1. / b + 1./gp[4]);
return b;
}
for ligand gated transitions, the expressions are:
alpha = [ligand] / (gp[0] * gp[1]);
beta = 1 / gp[1];
where [ligand] refers to the external concentration
(type == 2), or internal concentration (typ == 3)
og[3]: double[Nstate] the normalised conductances of the states
og[4]: String[Nstate] the names of the states
og[5]: String[Nagent] the names of agents acting on this gating
complex, as indexed by itrans[i][5];