miv_simulator.clamps.cell#

Functions

cell_clamps(config_file, erev, population, ...)

fit_membrane_time_constant(t, v, t0, t1[, ...])

Fit an exponential to estimate membrane time constant between start and end

init_biophys_cell(env, pop_name, gid[, ...])

Instantiates a BiophysCell instance and all its synapses.

measure_ap(gid, pop_name, v_init, env[, ...])

measure_ap_rate(gid, pop_name, v_init, env)

measure_deflection(t, v, t0, t1[, stim_amp])

Measure voltage deflection (min or max, between start and end).

measure_fi(gid, pop_name, v_init, env[, ...])

measure_gap_junction_coupling(gid, ...)

measure_passive(gid, pop_name, v_init, env)

measure_psc(gid, pop_name, presyn_name, env, ...)

measure_psp(gid, pop_name, presyn_name, ...)

measure_time_constant(t, v, t0, t1, stim_amp)

Calculate the membrane time constant by fitting the voltage response with a single exponential.

miv_simulator.clamps.cell.init_biophys_cell(env, pop_name, gid, load_weights=True, load_connections=True, register_cell=True, write_cell=False, validate_tree=True, cell_dict={})[source]#

Instantiates a BiophysCell instance and all its synapses.

Parameters:
  • env (AbstractEnv) – an instance of env.Env

  • pop_name (str) – population name

  • gid (int) – gid

  • load_connections (bool) – bool

  • register_cell (bool) – bool

  • validate_tree (bool) – bool

  • write_cell (bool) – bool

  • cell_dict (Dict[str, Union[Dict[str, Union[ndarray, Dict[str, Union[int, Dict[int, ndarray], ndarray]]]], Dict[str, ndarray], Tuple[Dict[str, Dict[str, List[Tuple[int, Tuple[ndarray, Dict[str, List[ndarray]]]]]]], Dict[str, Dict[str, Dict[str, Dict[str, int]]]]], None]]) – dict

Return type:

BiophysCell

Environment can be instantiated as: env = Env(config_file, template_paths, dataset_prefix) :param template_paths: str; colon-separated list of paths to directories containing hoc cell templates :param dataset_prefix: str; path to directory containing required neuroh5 data files

miv_simulator.clamps.cell.measure_deflection(t, v, t0, t1, stim_amp=None)[source]#

Measure voltage deflection (min or max, between start and end).

miv_simulator.clamps.cell.fit_membrane_time_constant(t, v, t0, t1, rmse_max_tol=1.0)[source]#

Fit an exponential to estimate membrane time constant between start and end

Parameters:
vnumpy array of voltages in mV
tnumpy array of times in ms
t0start of time window for exponential fit
t1end of time window for exponential fit
rsme_max_tol: minimal acceptable root mean square error (default 1e-4)
Returns:
a, inv_tau, y0Coefficients of equation y0 + a * exp(-inv_tau * x)
returns np.nan for values if fit fails
miv_simulator.clamps.cell.measure_time_constant(t, v, t0, t1, stim_amp, frac=0.1, baseline_interval=100.0, min_snr=20.0)[source]#

Calculate the membrane time constant by fitting the voltage response with a single exponential.

Parameters:
vnumpy array of voltages in mV
tnumpy array of times in ms
t0start of stimulus interval in ms
t1end of stimulus interval in ms
stim_ampstimulus amplitude
fracfraction of peak deflection to find to determine start of fit window. (default 0.1)
baseline_intervalduration before start for baseline Vm calculation
min_snrminimum signal-to-noise ratio (SNR) to allow calculation of time constant.

If SNR is too low, np.nan will be returned. (default 20)

Returns:
taumembrane time constant in ms