emodelrunner.synplas_analysis

Analysis tools for synapse plasticity.

Functions

epsp_slope(vtrace)

Returns slope between points at [0.3, 0.75] * peak of given trace.

get_epsp_vector(t, v, spikes, window)

Extract EPSPs at time spikes from voltage trace v.

Classes

Experiment(data[, c01duration, c02duration, ...])

A full STDP induction experiment.

class emodelrunner.synplas_analysis.Experiment(data, c01duration=40.0, c02duration=40.0, period=10.0, c01period=None, c02period=None)[source]

Bases: object

A full STDP induction experiment.

The experiment consists of two connectivity tests (C01 and C02), separed by the induction protocol.

t

Time vector (ms)

Type

numpy.ndarray

v

Soma voltage trace (ms)

Type

numpy.ndarray

spikes

Pre-synaptic spike times (ms)

Type

numpy.ndarray

duration

Duration of C01 and C02 phases (ms)

Type

dict

period

The Cx period (ms)

Type

float

c01period

The C01 period (ms)

Type

float

c02period

The C02 period (ms)

Type

float

epspwindow

Size of EPS detection window (ms)

Type

float

cxs

Names of the Cx tests. These names are used as keys in the dictionaries (cxspikes, duration, epsp, cxtrace)

Type

list

cxspikes

Pre-synaptic spikes times (ms) occuring during each test (C01 & C02)

Type

dict

compute_epsp_interval(interval)[source]

Compute mean EPSP amplitude at regular intervals.

Parameters

interval (float) – The interval in minutes.

Returns

A dictionary of interval statistics for each Cx in Experiment.

Return type

dict

compute_epsp_ratio(n, method='amplitude', full=False)[source]

Compute mean EPSP change.

Parameters
  • n (int) – Number of sweeps in Cx to be considered for mean EPSP calculation

  • method (str) – Method used to compute EPSP ratio (amplitude or slope)

  • full (bool) – whether to return the mean value and std of epsp before and after cell stimulus in addition to the epsp ratio

Returns

if full is False, returns

  • ratio_epsp (float): Mean EPSP change

if full is True, returns a tuple containing

  • epsp_before (float): mean value of EPSP or slope of mean EPSP trace in test C01

  • epsp_after (float): mean value of EPSP or slope of mean EPSP trace in test C02

  • ratio_epsp (float): Mean EPSP change

  • epsp_before_std (float): std of EPSP in test C01 if method is amplitude, else 0

  • epsp_after_std (float): std of EPSP in test C02 if method is amplitude, else 0

Raises

ValueError – if method is neither ‘amplitude’ nor ‘slope’

property cxtrace

Returns time and interpolated trace of each EPSP as dict.

property epsp

Returns dict containing EPSP vectors for each test (mV).

normalize_time(t)[source]

Normalize time vector t.

Convert milliseconds to minutes and shift t = 0 to beginning of induction phase.

Parameters

t (numpy.ndarray) – Time vector (ms)

Results:

tnorm (numpy.ndarray): Normalized time vector (mn)

emodelrunner.synplas_analysis.epsp_slope(vtrace)[source]

Returns slope between points at [0.3, 0.75] * peak of given trace.

Attention! This function expects that the trace is sampled (or interpolated) at a single timestep, since time is not taken into account during calculations.

Parameters

vtrace (numpy.ndarray) – interpolated voltage trace of one EPSP (mV)

Returns

slope of the EPSP (mV)

Return type

float

emodelrunner.synplas_analysis.get_epsp_vector(t, v, spikes, window)[source]

Extract EPSPs at time spikes from voltage trace v.

Parameters
  • t (numpy.ndarray) – Time vector (ms).

  • v (numpy.ndarray) – Soma voltage trace. Must have the same size of t (mV).

  • spikes (numpy.ndarray) – Time of presynaptic spikes. Every value in spikes must be in the interval [min(t), max(t)] (ms).

  • window (float) – Size of EPS detection window in ms.

Returns

Vector of EPSPs (mV).

Return type

numpy.ndarray

Raises
  • RuntimeError – if a postsynaptic cell spike is found during a connectivity test

  • RuntimeError – if the detection window can have multiple EPSPs in it