Class Neuroml2GENESIS

java.lang.Object
  |
  +--Neuroml2GENESIS

public class Neuroml2GENESIS
extends java.lang.Object

Class to hold the method neuroml2genesis, used to convert a neuroml (xml) string into a string that holds a GENESIS script to create a channel.


Field Summary
private static double Erest
          Optional parameter (default value = 0.0) for the resting potential of the cell containing the channel.
private static java.lang.String errorMsg
           
private static java.lang.String tab4
           
private static java.lang.String tab8
           
 
Constructor Summary
Neuroml2GENESIS()
           
 
Method Summary
private static java.lang.String convertConditional(java.lang.String inString)
           
private static double[] equation2array(double xmin, double xmax, int xpts, java.lang.String eqn)
          Given an equation that is a function of the variable x, parse it with the Java Expression Parser (JEP from http://jep.sourceforge.net/).
private static java.lang.String getParamList(java.lang.String gateName, ParameterizedHHRate rate)
          Creates a space-separated list of parameters to be used by the GENESIS setupalpha or setuptau functions.
private static java.lang.String getRates(java.lang.Object go)
          Generate the code to fill the tabchannel rate tables
static java.lang.String neuroml2genesis(java.lang.String xmlString)
          Parse the xml to get a model object, convert to GENESIS script
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Erest

private static double Erest
Optional parameter (default value = 0.0) for the resting potential of the cell containing the channel. It may be used to shift the voltage dependence of the gate rate parameters, by changing its value, or it may be used as a parameter in the equation string of an EquationHHRate object. In GENESIS, it corresponds to the global script variable EREST_ACT. If it isn't initialized in the DBChannel object, it will be ignored.


tab4

private static java.lang.String tab4

tab8

private static java.lang.String tab8

errorMsg

private static java.lang.String errorMsg
Constructor Detail

Neuroml2GENESIS

public Neuroml2GENESIS()
Method Detail

neuroml2genesis

public static java.lang.String neuroml2genesis(java.lang.String xmlString)
Parse the xml to get a model object, convert to GENESIS script

Parameters:
xmlString - The NeuroML channel description
Returns:
GENESIS script for a function that creates the channel

getRates

private static java.lang.String getRates(java.lang.Object go)
Generate the code to fill the tabchannel rate tables


getParamList

private static java.lang.String getParamList(java.lang.String gateName,
                                             ParameterizedHHRate rate)
Creates a space-separated list of parameters to be used by the GENESIS setupalpha or setuptau functions. The NeuroML ParameterizedHHRate expression is: rate = (A + BV) / (C + D exp((E + V)/F)), which corresponds to the parameters used by the GENESIS setupalpha form when D = 1.0.


equation2array

private static double[] equation2array(double xmin,
                                       double xmax,
                                       int xpts,
                                       java.lang.String eqn)
Given an equation that is a function of the variable x, parse it with the Java Expression Parser (JEP from http://jep.sourceforge.net/). Evaluate it at xpts points from x = min to xmax and return the values as an array of doubles.
Notes on the EquationHHRate rateExpression: In principle, rateExpression can be any String expression. In practice, it should conform to the the equation syntax defined for the Modelers Workspace (http://www.genesis-sim.org/hbp/mws-rep/mws-rep.html), in order to allow it to be parsed by any conforming equation parser. The syntax is similar to that used in C and Java, with the compact version of the "if" statement that is used in Java, e.g.
(x > Erest) ? 5*exp(-50*(x - Erest)) : 5.0
where the expression following "?" is executed if the condition is true, and the expression after ":" is executed if the condition is false. However, this syntax, and any other one using "<" to denote "less than", presents problems for the JDOM xml parser, unless "<" is encoded as "<". For this reason, it is best to change the order of the expressions to allow the use of ">" or ">=". Another assumption made here is that the independent variable for a voltage or concentration is "x", and that an optional constant "Erest" is allowed in equations.


convertConditional

private static java.lang.String convertConditional(java.lang.String inString)