Modigliani  2.0
A stochastic simulator for axons, neurons, and networks
Classes | Enumerations | Functions | Variables
modigliani_core Namespace Reference

Core classes for Modigliani. More...

Classes

class  Custom_cylindrical_compartment
 This class is used to take concentrations into account. More...
 
class  Cylindrical_compartment
 Cylindrical membrane compartment. More...
 
class  File_based_stochastic_voltage_gated_channel
 Voltage gated ion channel with transition probabilities stored in a file. More...
 
class  Ion_channels
 Base class for all ion channels. More...
 
class  Leak_current
 Simulates a leak current. More...
 
class  Lua_based_deterministic_voltage_gated_channel
 This class reads a lua script and interpret it to simualte a population of ion channels deterministically. More...
 
class  Lua_based_stochastic_voltage_gated_channel
 Stochastic ion channel with transition probabilities read from a lua script. More...
 
class  Membrane
 Membrane class. More...
 
class  Membrane_compartment
 Membrane_compartment class acts as a "container + glue" for the various Membrane_current classes that can be attached to it. More...
 
class  Membrane_compartment_sequence
 Sequence of cylindrical membrane compartments, basically an axon/dendrite. More...
 
class  Membrane_current
 Membrane_current class. More...
 
class  Membrane_patch
 Membrane_patch class. More...
 
class  Network_synapse
 This class acts as a simplified synapse for use in neuronal network simulations. More...
 
class  Object
 Base class for all objects in modigliani_core. More...
 
class  Spherical_compartment
 This class simulates a spherical Hodgkin-Huxley neuron. More...
 
class  Synaptic_background
 This class represents a synaptic background current. More...
 
class  Transition_rate_matrix
 Holds voltage dependent transition rates for a Markov chain. More...
 
class  Voltage_gated_ion_channel_current
 Base class for voltage gated ion channels. More...
 

Enumerations

enum  KineticFunctionType
 Common kinetic function types. More...
 
enum  CurrentType
 Current types.
 
enum  StochasticType
 Stochastic simulation algortihms. More...
 

Functions

modigliani_base::Real CorrectedChannelDensity (modigliani_base::Real chDensity, modigliani_base::Real compArea)
 Returns a random channel density calculated so that the average is preserved. More...
 
string CreateOutputFolder (string outputFolder)
 Creates a new folder in the output directory and puts a timestamp in its name. More...
 
Cylindrical_compartmentCreateCompartment (boost::property_tree::ptree config_root, boost::property_tree::ptree simulation_parameters, boost::property_tree::ptree compartment_parameters, modigliani_base::Size force_alg)
 Creates a cylindrical compartment using the parameters supplied in the parameters structs supplied. More...
 
void AttachCurrent (modigliani_core::Membrane_compartment *compartment, const boost::property_tree::ptree currents, boost::property_tree::ptree config_root, bool randomise_densities, modigliani_base::Size force_alg)
 Creates current objects and adds them to the given compartment. More...
 
void OpenOutputFile (string outputFolder, string prefix, ofstream &outStream, string extension=".txt")
 Opens a new file in write mode. More...
 
ofstream * OpenOutputFile (string outputFolder, string prefix, int counter, string extension=".txt")
 Opens a new file in write mode, postfixing the name with the given number. More...
 
modigliani_core::Membrane_compartment_sequenceCreateAxon (boost::property_tree::ptree config_root, ofstream &TypePerCompartmentFile, ofstream &LengthPerCompartmentFile, modigliani_base::Size force_alg)
 Creates an axon based on parameters given. More...
 
boost::property_tree::ptree ReadConfig (string fileName)
 Reads the parameters in the file given as argument. More...
 
std::vector
< modigliani_base::Size > 
GetElectrods (boost::property_tree::ptree root_config)
 Returns the compartments from which data will be recorded. More...
 
int SetLuaPath (lua_State *L, const string path)
 Adds a folder to the path variable of the given Lua interpreter instance. More...
 
modigliani_base::Real TemperatureRateRelation (modigliani_base::Real temp, modigliani_base::Real baseTemp, modigliani_base::Real q10)
 Converts kinetics to be used at a different temperature than the one at which they were recorded. More...
 
modigliani_base::Real LengthConstantPassiveCable (modigliani_base::Real diameter, modigliani_base::Real rAxoplasmic, modigliani_base::Real gLeak)
 Compute length constant of a passive cable. More...
 

Variables

const modigliani_base::Real TIMESTEP = 0.001
 Base timestep in [ $\si{\milli\second}$].
 
const modigliani_base::Real STD_TEMPERATURE = 6.3
 Base temperature in [ $\si{celsius}$].
 

Detailed Description

Core classes for Modigliani.

This namespace contains classes directly used for simulations. Notably, it contains ion channels and membrane classes. This is the core of modigliani.

Enumeration Type Documentation

Common kinetic function types.

Deprecated:

Stochastic simulation algortihms.

Warning
Not all are actually implemented and well tested. Stick to BINOMIALPOPULATION or DETERMINISTIC.

Function Documentation

void modigliani_core::AttachCurrent ( modigliani_core::Membrane_compartment compartment,
const boost::property_tree::ptree  currents,
boost::property_tree::ptree  config_root,
bool  randomise_densities,
modigliani_base::Size  force_alg 
)

Creates current objects and adds them to the given compartment.

Parameters
compartmentPointer to the target membrane compartment.
currentsList of ptrees containing current parameters. Each member of the list is expected to contain the following parameters :
  • string type. This parameters can have 3 different values. According to this value, further parameters are necessary :
    1. type == "leak" For a leak current . double GLeak . double eLeak [mV]
    2. type == "file" For reading transition probabilities from a JSON file. This option is rarely used.
      • double chDen
      • double chCond
      • double chRevPot
      • string chModel Name of the JSON file
      • int chAlg
    3. type == "lua" For using a lua script to generate transition probabilities, as well as deterministic simulations.
      • double chDen
      • double chCond
      • double chRevPot
      • string chModel Name of the JSON file
      • int chAlg
config_rootptree containing general parameters. Usually this is the root of the ptree generated by parsing a JSON file. The following parameters are expected :
  • double temperature [C]
randomise_densitiesWhether to use stochastic repartition of channels
force_algIf this is set to 0, the algorithms are read from the compartment_parameters. Otherwise, all simulation algorithms are forced to be equal to this value. Implemented values so far are :
  • 1 Deterministic
  • 4 Binomial population
modigliani_base::Real modigliani_core::CorrectedChannelDensity ( modigliani_base::Real  chDensity,
modigliani_base::Real  compArea 
)

Returns a random channel density calculated so that the average is preserved.

This function generates a binomial random number used to determine the number of channels is a compartment. In stochastic simulations, it can be usefull to study the effects of the random distribution of ion channels over the membrane.

Parameters
chDensityAverage density [ $\si{\per\micro\meter\squared}$]
compAreaThe membrane area of the target compartment in [ $\si{\micro\meter\squared}$]
Returns
Density in [ $\si{\per\micro\meter\squared} $]
Membrane_compartment_sequence * modigliani_core::CreateAxon ( boost::property_tree::ptree  config_root,
ofstream &  TypePerCompartmentFile,
ofstream &  LengthPerCompartmentFile,
modigliani_base::Size  force_alg 
)

Creates an axon based on parameters given.

The axon is an instance of Membrane_Compartment_Sequence. The parameters 'anatomy_lua' of config_root is executed in a lua interpreter. The variable 'compartments' is then read from the interpreter memory. 'compartments' is assumed to contain an array of integers. This integers are used to index the 'compartments_parameters' array, again in 'config_root', whose members contain the necessary parameters to construct a compartment.

See Also
The documentation for CreateCompartment() for the list of parameters each member of 'compartments_parameters' must provide.
Parameters
config_rootptree containing general parameters. Usually this is the root of the ptree generated by parsing a JSON file. The following parameters are expected :
  • string anatomy_lua A lua script which, once executed, yields an array of indexes. Each index determines the type of the compartment to be inserted.
  • ptree compartments_parameters A ptree array of ptrees, providing the necessary parameters to construct a membrane compartment.
  • double simulation_parameters.timeStep Simulation timestep
TypePerCompartmentFileReference to an ofstream where compartment types are saved.
LengthPerCompartmentFileReference to an ofstream where compartment lengths are saved.
force_algIf this is set to 0, the algorithms are read from the compartment_parameters. Otherwise, all simulation algorithms are forced to be equal to this value. Implemented values so far are :
  • 1 Deterministic
  • 4 Binomial population
Returns
Pointer to the constructed axon.
Cylindrical_compartment * modigliani_core::CreateCompartment ( boost::property_tree::ptree  config_root,
boost::property_tree::ptree  simulation_parameters,
boost::property_tree::ptree  compartment_parameters,
modigliani_base::Size  force_alg 
)

Creates a cylindrical compartment using the parameters supplied in the parameters structs supplied.

The cylindriacl compartment object is created using the parameters contained in the ptrees given to this function. This function the calls AttachCurrent() to attach different currents to the generated compartment.

See Also
AttachCurrent() for more details.
Parameters
config_rootptree containing general parameters. Usually this is the root of the ptree generated by parsing a JSON file. The following parameters are expected :
  • double diameter in [ $\si{\micro\meter}$]
  • double temperature [C]
simulation_parametersParameter governing the current run of the simulation. The following parameters are expected :
  • double timeStep [ms]
  • bool randomize_densities Whether to use stochastic repartition of channels
compartment_parametersList of parameter for building compartments. The following parameters are expected :
  • double length [ $\si{\micro\meter}$]
  • double Cm [ $\si{\micro\farad\per\centi\meter\squared}$]
  • double Ra [ $\si{\ohm\centi\meter}$]
  • ptree currents A list of ptree, each one for one type of membrane current to be attached to some compartments.
force_algIf this is set to 0, the algorithms are read from the compartment_parameters. Otherwise, all simulation algorithms are forced to be equal to this value. Implemented values so far are :
  • 1 Deterministic
  • 4 Binomial population
Returns
Pointer to the constructed compartment.
Warning
Check the list of required parameters for AttachCurrent().
string modigliani_core::CreateOutputFolder ( string  outputFolder)

Creates a new folder in the output directory and puts a timestamp in its name.

This function creates a folder using the current date and time in the "%b%d_%H%M%S" format. The name of the created folder is returned.

Parameters
outputFolderContaining folder
Returns
Name of the newly created folder
std::vector< modigliani_base::Size > modigliani_core::GetElectrods ( boost::property_tree::ptree  root_config)

Returns the compartments from which data will be recorded.

Parameters
root_configptree containing general parameters. Usually this is the root of the ptree generated by parsing a JSON file. The following parameters are expected :
  • string electrods_lua A lua script which, once executed, yields an array of indexes. Data from the compartments indexed by this array will then be recorded.
Returns
Vector of compartment indexes
modigliani_base::Real modigliani_core::LengthConstantPassiveCable ( modigliani_base::Real  diameter,
modigliani_base::Real  rAxoplasmic,
modigliani_base::Real  gLeak 
)

Compute length constant of a passive cable.

Parameters
diameterDiameter in [ $\si{\micro\meter}$]
rAxoplasmicAxoplasmic resistance in [ $\si{\ohm\centi\meter}$]
gLeakLeak conductance in [ $\si{\milli\siemens\per\centi\meter\squared}$]
Returns
Length constant in [ $\si{\micro\meter}$]
void modigliani_core::OpenOutputFile ( string  outputFolder,
string  prefix,
ofstream &  outStream,
string  extension = ".txt" 
)

Opens a new file in write mode.

The file will be named prefix+extension

Parameters
outputFolderThe folder in which to create the new file.
prefixString to be prefixed to the file name.
outStreamReference to ofstream to the opened file.
extensionFile extension
ofstream * modigliani_core::OpenOutputFile ( string  outputFolder,
string  prefix,
int  counter,
string  extension = ".txt" 
)

Opens a new file in write mode, postfixing the name with the given number.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
outputFolderThe folder in which to create the new file.
prefixFile name prefix
counterNumber postfix
extensionFile extension
Returns
Pointer to ofstream pointing to the file the newly created file.
boost::property_tree::ptree modigliani_core::ReadConfig ( string  fileName)

Reads the parameters in the file given as argument.

Parameters
fileNameInput file.
Returns
A ptree structure containing the parameters
int modigliani_core::SetLuaPath ( lua_State *  L,
const string  path 
)

Adds a folder to the path variable of the given Lua interpreter instance.

Parameters
LLua interpreter instance
pathFolder to add to path
Returns
0 if successful
modigliani_base::Real modigliani_core::TemperatureRateRelation ( modigliani_base::Real  temp,
modigliani_base::Real  baseTemp,
modigliani_base::Real  q10 
)

Converts kinetics to be used at a different temperature than the one at which they were recorded.

Parameters
tempSimulation temperature in [ $\si{\celsius}$]
baseTempRecording temperature in [ $\si{\celsius}$]
q10The Q10 factor
Returns
Factor by which to multiply the kinetics