Protocols¶
Protocols control what happens to the cell(s) throughout the simulation. There are currently 3 types of protocols:
Current Clamp: stimulates the cell at a given frequency
Voltage Clamp: fixes the transmembrane voltage for specific lengths of time
Grid: for 1D fiber, and 2D grid simulations stimulating as in Current Clamp
-
class
PyLongQt.Protocols.
ClampView
¶ Interface for voltages clamps. Access through clamps in Voltage Clamp Protocol
-
__delitem__
(self: PyLongQt._PyLongQt.Protocols.ClampView, index: int) → None¶ - Delete a clamp from the list of clamps
- index
That clamp’s index in the ordered list of clamps
-
__getitem__
(self: PyLongQt._PyLongQt.Protocols.ClampView, index: int) → Tuple[float, float]¶ - Retrieves the clamps start time (ms) and voltage (mV)
- index
That clamp’s index in the ordered list of clamps
-
__iter__
(self: PyLongQt._PyLongQt.Protocols.ClampView) → iterator¶ Iterate over clamps
-
fromList
(self: PyLongQt._PyLongQt.Protocols.ClampView, voltageList: List[Tuple[float, float]]) → None¶ Import clamps from a list
-
insert
(*args, **kwargs)¶ Overloaded function.
insert(self: PyLongQt._PyLongQt.Protocols.ClampView, pair: Tuple[float, float]) -> int
- Insert a new clamp into the list of clamps
- pair
The clamp’s start time (ms) and voltage (mV)
insert(self: PyLongQt._PyLongQt.Protocols.ClampView, time: float, voltage: float) -> None
- Insert a new clamp into the list of clamps
- time
The clamp’s start time (ms)
- voltage
The clamp’s voltage (mV)
-
setVoltage
(self: PyLongQt._PyLongQt.Protocols.ClampView, index: int, voltage: float) → None¶ - Change the voltage of a clamp
- index
That clamp’s index in the ordered list of clamps
- voltage
The clamp’s voltage (mV)
-
-
class
PyLongQt.Protocols.
CurrentClamp
¶ -
property
bcl
¶ The basic cycle length (ms). After stimt the cell will be stimulated every bcl miliseconds.
-
property
numstims
¶ The total number of times the stimulus should be applied in the simulation
-
property
paceflag
¶ If the cell should be stimulated. When this is falce no other stimulus related parameters have an effect
-
property
stimdur
¶ The duration of each stimulus (ms)
-
property
stimt
¶ The time (ms) at which the first stimulus should be applied
-
property
stimval
¶ The current at which the cell should be stimulated
-
property
-
class
PyLongQt.Protocols.
GridProtocol
¶ This protocol is for 1D fibers or 2D grids of cells. It allows for current clamp like” “simulations with the groups of cells rather than just individual cells as in Voltage Clamp and” “Current Clamp.
-
property
grid
¶ The structure of cells, if this is 1D then it is a fibre simulation, if it’s 2D then it’s a grid simulation.
-
property
stimNodes
¶ The cells which the current stimulus will be applied to. The cells not on this list will not be excited directly but may excited by their neighbors.
-
property
-
class
PyLongQt.Protocols.
ParsVeiw
¶ Interface for working with Protocol variables. Accessable through pars property in each Protocol.
-
__contains__
(self: PyLongQt._PyLongQt.Protocols.ParsVeiw, name: str) → bool¶ - Checks if the protocol has that parameter
- name
The name of the parameter
-
__getitem__
(self: PyLongQt._PyLongQt.Protocols.ParsVeiw, name: str) → str¶ - Retrieves the parameter’s value
- name
The name of the parameter
-
__iter__
(self: PyLongQt._PyLongQt.Protocols.ParsVeiw) → iterator¶ Iterate over parameters
-
__setitem__
(self: PyLongQt._PyLongQt.Protocols.ParsVeiw, name: str, value: str) → None¶ - Sets the parameter to value
- name
The name of the parameter
- value
The new value
-
getType
(self: PyLongQt._PyLongQt.Protocols.ParsVeiw, name: str) → str¶ - Retrieves the parameter’s class type
- name
The name of the parameter
-
-
class
PyLongQt.Protocols.
Protocol
¶ The base class of all protocols
-
property
cell
¶ The cell model used in the simulation
-
cellOptions
(self: PyLongQt._PyLongQt.Protocols.Protocol) → List[str]¶ - The names of the cell models which this protocol can take
-
property
cellStateDir
¶ The directory to read/write the complete state of the cell model. .. Note: this is an expiremental feature and may not work correctly for every cell
-
property
cellStateFile
¶ The file name to of the cell state. See cellStateDir.
-
clone
(self: PyLongQt._PyLongQt.Protocols.Protocol) → PyLongQt._PyLongQt.Protocols.Protocol¶ Create a copy/clone of the protocol
-
property
datadir
¶ The directory where the results of the simulations will be saved.
-
property
firstRun
¶ Time to start running runDurring
-
property
meastime
¶ The time (ms) when the measure manager will begin measuring.
-
property
measureMgr
¶ The manager for cell’s measured variables. Many of the cell model’s internal variables can be tracked throughout the simulation and functions of those variables can be recored, such as the peak, min, etc. The advantage to using this interface rather than computing these measures post simulation is that within LongQt they can be computed using every time step, while usually only a fraction of the timesteps are saved. This reduces the amount of disk space and computational time needed.
-
mkDirs
(self: PyLongQt._PyLongQt.Protocols.Protocol) → None¶ Create datadir (will be called automatically when simulations are run)
-
property
numruns
¶ Number of times to run runDurring
-
property
numtrials
¶ The totoal number of trials (simulations) to be run.
-
property
pars
¶
-
property
pvars
¶ The cell’s properties. These are cell model constants which are not changed throughout the simulation, but may be different from one trial (simulation) to annother
-
property
readCellState
¶ Whether the cell state should be read
-
property
runEvery
¶ Frequency to run runDurring
-
runSim
(self: PyLongQt._PyLongQt.Protocols.Protocol) → bool¶ - Run all the trials consecutively.
-
runTrial
(self: PyLongQt._PyLongQt.Protocols.Protocol) → bool¶ Run the current trial
-
setCellByName
(self: PyLongQt._PyLongQt.Protocols.Protocol, cellName: str) → bool¶ - Set the cell using its name rather than a cell model object
- name
The name of the cell model
-
setDataDir
(self: PyLongQt._PyLongQt.Protocols.Protocol, name: str = '/data', basedir: str = '', appendtxt: str = '', append_date: bool = True) → None¶ - Set the directory where the results of the simulations will be saved.
datadir = basedir + name + datetime + appendtxt + (optional number for uniqueness) :name: the name of the datadir, if this is omitted the standard naming scheme will be used :basedir: the directory where the datadir will be created, if omited basedir will be used (the basedir property will be set) :appendtxt: additional text to be appended to the end :append_date: if datetime will be appended after name
-
setRunAfter
(self: PyLongQt._PyLongQt.Protocols.Protocol, func: Callable[[PyLongQt._PyLongQt.Protocols.Protocol], None]) → None¶ This takes a function which will be called after the simulation is finished. The function must take a the protocol class which will be run as an arguement, and it should not return anything.
-
setRunBefore
(self: PyLongQt._PyLongQt.Protocols.Protocol, func: Callable[[PyLongQt._PyLongQt.Protocols.Protocol], None]) → None¶ This takes a function which will be called before the simulation is started but after the simulation has been setup. The function must take a the protocol class which will be run as an arguement, and it should not return anything.
-
setRunDuring
(self: PyLongQt._PyLongQt.Protocols.Protocol, func: Callable[[PyLongQt._PyLongQt.Protocols.Protocol], None], firstRun: float = -1, runEvery: float = -1, numruns: int = -1) → None¶ This takes a function which will be called durring the simulation at time firstRun, and then every runEvery after that until the end of the simulation or func has been run numruns number of times.The function must take a the protocol class which will be run as an arguement, and it should not return anything.
-
property
simvarfile
¶ The file where the simulation settings will be written. The settings include the protocol configuration, the cell, the cell’s properties, the measures, as well as the structure: in short almost everything. The directory will be datadir.
-
property
tMax
¶ The maxium length of each simulation (ms)
-
property
trial
¶ The current trial number. Different trials with have cell parameters. See pvars for more detial.
-
property
type
¶ The name of the protocol class
-
property
writeCellState
¶ Whether the cell state should be written
-
property
writeint
¶ How often the cell’s variable traces should be recored. Every writeint number of simulation timesteps the traces will be recorded.
-
property
writetime
¶ The time (ms) when traces will begin being recorded
-
property
-
class
PyLongQt.Protocols.
VoltageClamp
¶ This protocol fixes the cell model’s transmembrane voltage to different values throughout the course of the simulation as defined by the clamp list
-
property
clamps
¶ The list of clamps which fix the cells transmembrane voltage to a specfic value (mv) starting at a time (ms). The pairs in the list are (time, voltage), and are ordered by time.
-
property