ipfx package

Subpackages

Submodules

ipfx.chirp module

ipfx.chirp.chirp_amp_phase(sweep_set, start=0.6, end=20.6, down_rate=2000, min_freq=0.2, max_freq=40.0)[source]

Calculate amplitude and phase of chirp responses

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/chirp.py:docstring of ipfx.chirp.chirp_amp_phase, line 4)

Unexpected section title.

Parameters
----------
sweep_set: SweepSet
Set of chirp sweeps
start: float (optional, default 0.6)
Start of chirp stimulus in seconds
end: float (optional, default 20.6)
End of chirp stimulus in seconds
down_rate: int (optional, default 2000)
Sampling rate for downsampling before FFT
min_freq: float (optional, default 0.2)
Minimum frequency for output to contain
max_freq: float (optional, default 40)
Maximum frequency for output to contain

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/chirp.py:docstring of ipfx.chirp.chirp_amp_phase, line 19)

Unexpected section title.

Returns
-------
amplitude: array
Aka resistance
phase: array
Aka reactance
freq: array
Frequencies for amplitude and phase results
ipfx.chirp.divide_chirps_by_stimulus(sweep_set)[source]
ipfx.chirp.extract_chirp_feature_vector(data_set, chirp_sweep_numbers)[source]
ipfx.chirp.feature_vectors_chirp(chirp_sweeps, min_freq=0.2, max_freq=40.0)[source]

ipfx.data_set_features module

ipfx.data_set_features.detection_parameters(stimulus_name)[source]
ipfx.data_set_features.extract_cell_features(data_set, ramp_sweep_numbers, short_square_sweep_numbers, long_square_sweep_numbers, subthresh_min_amp)[source]
ipfx.data_set_features.extract_data_set_features(data_set, subthresh_min_amp=None)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.extract_data_set_features, line 2)

Unexpected section title.

Parameters
----------
data_set : EphysDataSet
data set

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.extract_data_set_features, line 5)

Definition list ends without a blank line; unexpected unindent.

subthresh_min_amp

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.extract_data_set_features, line 8)

Unexpected section title.

Returns
-------

cell_features :

sweep_features :

cell_record :

sweep_records :

ipfx.data_set_features.extract_sweep_features(data_set, sweep_table)[source]
ipfx.data_set_features.extractors_for_sweeps(sweep_set, dv_cutoff=20.0, thresh_frac=0.05, reject_at_stim_start_interval=0, min_peak=-30, thresh_frac_floor=None, est_window=None, start=None, end=None)[source]

Extract data from sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.extractors_for_sweeps, line 4)

Unexpected section title.

Parameters
----------

sweep_set : SweepSet object

dv_cutoff : float thresh_frac : reject_at_stim_start_interval : thresh_frac_floor est_window : start : end :

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.extractors_for_sweeps, line 16)

Unexpected section title.

Returns
-------

spx : SpikeExtractor object spfx : SpikeTrainFeatureExtractor object

ipfx.data_set_features.select_subthreshold_min_amplitude(stim_amps, decimals=0)[source]

Find the min delta between amplitudes of coarse long square sweeps. Includes failed sweeps.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.select_subthreshold_min_amplitude, line 4)

Unexpected section title.

Parameters
----------

stim_amps: list of stimulus amplitudes decimals: int of decimals to keep

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/data_set_features.py:docstring of ipfx.data_set_features.select_subthreshold_min_amplitude, line 9)

Unexpected section title.

Returns
-------

subthresh_min_amp: float min amplitude min_amp_delta: min increment in the stimulus amplitude

ipfx.data_set_utils module

A shim for backwards compatible imports of create_data_set

ipfx.ephys_data_set module

A shim for backwards compatible imports of EphysDataSet

ipfx.epochs module

ipfx.epochs.get_experiment_epoch(i, hz, test_pulse=True)[source]

Find index range for the experiment epoch. The start index of the experiment epoch is defined as stim_start_idx - PRESTIM_DURATION*sampling_rate The end index of the experiment epoch is defined as stim_end_idx + POSTSTIM_DURATION*sampling_rate

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_experiment_epoch, line 6)

Unexpected section title.

Parameters
----------

i : float np.array of current hz : float sampling rate test_pulse: bool True if present, False otherwise

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_experiment_epoch, line 12)

Unexpected section title.

Returns
-------

(expt_start_idx,expt_end_idx): int tuple with start, end indices of the epoch

ipfx.epochs.get_first_noise_epoch(idx, hz)[source]
ipfx.epochs.get_first_stability_epoch(stim_start_idx, hz)[source]
ipfx.epochs.get_last_noise_epoch(idx1, hz)[source]
ipfx.epochs.get_last_stability_epoch(idx1, hz)[source]

Get epoch lasting LAST_STABILITY_EPOCH before idx1

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_last_stability_epoch, line 4)

Unexpected section title.

Parameters
----------

idx1 : int last index of the epoch hz : float sampling rate

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_last_stability_epoch, line 9)

Unexpected section title.

Returns
-------

(idx0,idx1) : int tuple of epoch indices

ipfx.epochs.get_recording_epoch(response)[source]

Detect response epoch defined as interval from start to the last non-nan value of the response

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_recording_epoch, line 4)

Unexpected section title.

Parameters
----------

response: float np.array

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_recording_epoch, line 8)

Unexpected section title.

Returns
-------
start,end: int
indices of the epoch
ipfx.epochs.get_stim_epoch(i, test_pulse=True)[source]

Determine the start index, and end index of a general stimulus.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_stim_epoch, line 4)

Unexpected section title.

Parameters
----------
i : numpy array
current
test_pulse: bool
True if test pulse is assumed

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_stim_epoch, line 12)

Unexpected section title.

Returns
-------

start,end: int tuple

ipfx.epochs.get_sweep_epoch(response)[source]

Defined as interval including entire sweep

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_sweep_epoch, line 4)

Unexpected section title.

Parameters
----------

response: float np.array

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_sweep_epoch, line 8)

Unexpected section title.

Returns
-------
(start_index,end_index): int tuple
with start,end indices of the epoch
ipfx.epochs.get_test_epoch(i, hz)[source]

Find index range of the test epoch

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_test_epoch, line 4)

Unexpected section title.

Parameters
----------
i : float np.array
current trace

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/epochs.py:docstring of ipfx.epochs.get_test_epoch, line 9)

Unexpected section title.

Returns
-------
start_idx,end_idx: int tuple
start,end indices of the epoch
hz: float
sampling rate

ipfx.error module

exception ipfx.error.FeatureError[source]

Bases: Exception

Generic Python-exception-derived object raised by feature detection functions.

ipfx.feature_extractor module

class ipfx.feature_extractor.SpikeFeatureExtractor(start=None, end=None, filter=10.0, dv_cutoff=20.0, max_interval=0.005, min_height=2.0, min_peak=-30.0, thresh_frac=0.05, reject_at_stim_start_interval=0)[source]

Bases: object

AFFECTED_BY_CLIPPING = ['trough_t', 'trough_v', 'trough_i', 'trough_index', 'downstroke', 'downstroke_t', 'downstroke_v', 'downstroke_index', 'fast_trough_t', 'fast_trough_v', 'fast_trough_i', 'fast_trough_indexadp_t', 'adp_v', 'adp_i', 'adp_index', 'slow_trough_t', 'slow_trough_v', 'slow_trough_i', 'slow_trough_index', 'isi_type', 'width', 'upstroke_downstroke_ratio']

Feature calculation for a sweep (voltage and/or current time series).

is_spike_feature_affected_by_clipping(key)[source]
process(t, v, i)[source]
spike_feature(spikes_df, key, include_clipped=False, force_exclude_clipped=False)[source]

Get specified feature for every spike.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_extractor.py:docstring of ipfx.feature_extractor.SpikeFeatureExtractor.spike_feature, line 4)

Unexpected section title.

Parameters
----------

key : feature name include_clipped: return values for every identified spike, even when clipping means they will be incorrect/undefined

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_extractor.py:docstring of ipfx.feature_extractor.SpikeFeatureExtractor.spike_feature, line 9)

Unexpected section title.

Returns
-------

spike_feature_values : ndarray of features for each spike

spike_feature_keys(spikes_df)[source]

Get list of every available spike feature.

spikes(spikes_df)[source]

Get all features for each spike as a list of records.

class ipfx.feature_extractor.SpikeTrainFeatureExtractor(start, end, burst_tol=0.5, pause_cost=1.0, deflect_type=None, stim_amp_fn=None, baseline_interval=0.1, filter_frequency=1.0, sag_baseline_interval=0.03, peak_width=0.005)[source]

Bases: object

process(t, v, i, spikes_df, extra_features=None, exclude_clipped=False)[source]

ipfx.feature_record module

ipfx.feature_record.add_features_to_record(feature_names, feature_data, cell_record, postfix=None)[source]
ipfx.feature_record.build_cell_feature_record(cell_features)[source]
ipfx.feature_record.build_sweep_feature_record(sweep_table, sweep_features)[source]
ipfx.feature_record.convert_units(cell_record)[source]
ipfx.feature_record.nan_get(obj, key)[source]

Return a value from a dictionary. If it does not exist, return None. If it is NaN, return None

ipfx.feature_vectors module

ipfx.feature_vectors.first_ap_vectors(sweeps_list, spike_info_list, target_sampling_rate=50000, window_length=0.003, skip_clipped=False)[source]

Average waveforms of first APs from sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.first_ap_vectors, line 4)

Unexpected section title.

Parameters
----------
sweeps_list: list
List of Sweep objects
spike_info_list: list
List of spike info DataFrames
target_sampling_rate: float (optional, default 50000)
Desired sampling rate of output (Hz)
window_length: float (optional, default 0.003)
Length of AP waveform (seconds)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.first_ap_vectors, line 15)

Unexpected section title.

Returns
-------
ap_v: array of shape (target_sampling_rate * window_length)
Waveform of average AP
ap_dv: array of shape (target_sampling_rate * window_length - 1)
Waveform of first derivative of ap_v
ipfx.feature_vectors.first_ap_waveform(sweep, spikes, length_in_points)[source]

Waveform of first AP with length_in_points time samples

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.first_ap_waveform, line 4)

Unexpected section title.

Parameters
----------
sweep: Sweep
Sweep object with spikes
spikes: DataFrame
Spike info dataframe with “threshold_index” column
length_in_points: int
Length of returned AP waveform

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.first_ap_waveform, line 13)

Unexpected section title.

Returns
-------

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.first_ap_waveform, line 14)

Block quote ends without a blank line; unexpected unindent.
first_ap_v: array of shape (length_in_points)
The waveform of the first AP in sweep
ipfx.feature_vectors.identify_subthreshold_depol_with_amplitudes(features, sweeps)[source]

Identify subthreshold responses from depolarizing steps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_subthreshold_depol_with_amplitudes, line 4)

Unexpected section title.

Parameters
----------
features: dict
Output of LongSquareAnalysis.analyze()
sweeps: SweepSet
Long square sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_subthreshold_depol_with_amplitudes, line 11)

Unexpected section title.

Returns
-------
amp_sweep_dict: dict
Amplitude-sweep pairs
deflect_dict: dict
Dictionary of (base, deflect) tuples with amplitudes as keys
ipfx.feature_vectors.identify_subthreshold_hyperpol_with_amplitudes(features, sweeps)[source]

Identify subthreshold responses from hyperpolarizing steps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_subthreshold_hyperpol_with_amplitudes, line 4)

Unexpected section title.

Parameters
----------
features: dict
Output of LongSquareAnalysis.analyze()
sweeps: SweepSet
Long square sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_subthreshold_hyperpol_with_amplitudes, line 11)

Unexpected section title.

Returns
-------
amp_sweep_dict: dict
Amplitude-sweep pairs
deflect_dict: dict
Dictionary of (base, deflect) tuples with amplitudes as keys
ipfx.feature_vectors.identify_suprathreshold_spike_info(features, target_amplitudes, shift=None, amp_tolerance=0)[source]

Find spike information for sweeps matching desired amplitudes relative to rheobase

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_suprathreshold_spike_info, line 4)

Unexpected section title.

Parameters
----------
features: dict
Output of LongSquareAnalysis.analyze()
target_amplitudes: array
Amplitudes (relative to rheobase) for each desired step
shift: float (optional, default None)
Amount to consider shifting “rheobase” to identify more matching sweeps if only a single sweep matches. A value of None means that no shift is attempted.
amp_tolerance: float (optional, default 0)
Tolerance for matching amplitude (pA)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_suprathreshold_spike_info, line 17)

Unexpected section title.

Returns
-------
info_list: list
Spike info in order of desired amplitudes. If a given amplitude cannot be found, the list has None at that location
ipfx.feature_vectors.identify_suprathreshold_sweeps(sweeps, features, target_amplitudes, shift=None, amp_tolerance=0)[source]

Find spike information for sweeps matching desired amplitudes relative to rheobase

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_suprathreshold_sweeps, line 4)

Unexpected section title.

Parameters
----------
sweeps: Sweep set
Long square sweeps
features: dict
Output of LongSquareAnalysis.analyze()
target_amplitudes: array
Amplitudes (relative to rheobase) for each desired step
shift: float (optional, default None)
Amount to consider shifting “rheobase” to identify more matching sweeps if only a single sweep matches. A value of None means that no shift is attempted.
amp_tolerance: float (optional, default 0)
Tolerance for matching amplitude (pA)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_suprathreshold_sweeps, line 19)

Unexpected section title.

Returns
-------
sweeps: list
Sweeps in order of desired amplitudes. If a given amplitude cannot be found, the list has None at that location
ipfx.feature_vectors.identify_sweep_for_isi_shape(sweeps, features, duration, min_spike=5)[source]

Find lowest-amplitude spiking sweep that has at least min_spike or else sweep with most spikes

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_sweep_for_isi_shape, line 5)

Unexpected section title.

Parameters
----------
sweeps: SweepSet
Sweeps to consider for ISI shape calculation
features: dict
Output of LongSquareAnalysis.analyze()
duration: float
Length of stimulus interval (seconds)
min_spike: int (optional, default 5)
Minimum number of spikes for first preference sweep (default 5)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.identify_sweep_for_isi_shape, line 16)

Unexpected section title.

Returns
-------
selected_sweep: Sweep
Sweep object for ISI shape calculation
selected_spike_info: DataFrame
Spike info for selected sweep
ipfx.feature_vectors.inst_freq_vector(spike_info_list, start, end, width=20)[source]
Create binned instantaneous frequency feature vector,
concatenated across sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.inst_freq_vector, line 5)

Unexpected section title.

Parameters
----------
spike_info_list: list
Spike info DataFrames for each sweep
start: float
Start of stimulus interval (seconds)
end: float
End of stimulus interval (seconds)
width: float (optional, default 20)
Bin width in ms

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.inst_freq_vector, line 17)

Unexpected section title.

Returns
-------
output: array
Concatenated vector of binned instantaneous firing rates (spikes/s)
ipfx.feature_vectors.isi_shape(sweep, spike_info, end, n_points=100, steady_state_interval=0.1, single_return_tolerance=1.0, single_max_duration=0.1)[source]

Average interspike voltage trajectory with normalized duration, aligned to threshold

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.isi_shape, line 4)

Unexpected section title.

Parameters
----------
sweep: Sweep
Sweep object with at least one action potential
spike_info: DataFrame
Spike info for sweep
end: float
End of stimulus interval (seconds)
n_points: int (optional, default 100)
Number of points in output
steady_state_interval: float (optional, default 0.1)
Interval for calculating steady-state for sweeps with only one spike (seconds)
single_return_tolerance: float (optional, default 1)
Allowable difference from steady-state for determining end of “ISI” if only one spike is in sweep (mV)
single_max_duration: float (optional, default 0.1)
Allowable max duration for finding end of “ISI” if only one spike is in sweep (seconds)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.isi_shape, line 24)

Unexpected section title.

Returns
-------
isi_norm: array of shape (n_points)
Averaged, threshold-aligned, duration-normalized voltage trace
ipfx.feature_vectors.noise_ap_features(noise_sweeps, stim_interval_list=[(2.02, 5.02), (10.02, 13.02), (18.02, 21.02)], target_sampling_rate=50000, window_length=0.003, skip_first_n=1)[source]

Average AP waveforms in noise sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.noise_ap_features, line 4)

Unexpected section title.

Parameters
----------
noise_sweeps: SweepSet
Noise sweeps
stim_interval_list: list
Tuples of start and end times (in seconds) of analysis intervals
target_sampling_rate: float (optional, default 50000)
Desired sampling rate of output (Hz)
window_length: float (optional, default 0.003)
Length of AP waveform (seconds)
skip_first_n: int (optional, default 1)
Number of initial APs to exclude from average (default 1)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.noise_ap_features, line 17)

Unexpected section title.

Returns
-------
ap_v: array of shape (target_sampling_rate * window_length)
Waveform of average AP
ap_dv: array of shape (target_sampling_rate * window_length - 1)
Waveform of first derivative of ap_v
ipfx.feature_vectors.psth_vector(spike_info_list, start, end, width=50)[source]
Create binned “PSTH”-like feature vector based on spike times, concatenated
across sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.psth_vector, line 5)

Unexpected section title.

Parameters
----------
spike_info_list: list
Spike info DataFrames for each sweep
start: float
Start of stimulus interval (seconds)
end: float
End of stimulus interval (seconds)
width: float (optional, default 50)
Bin width in ms

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.psth_vector, line 16)

Unexpected section title.

Returns
-------
output: array
Concatenated vector of binned spike rates (spikes/s)
ipfx.feature_vectors.spike_feature_vector(feature, spike_info_list, start, end, width=20)[source]
Create binned feature vector for specified features,
concatenated across sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.spike_feature_vector, line 5)

Unexpected section title.

Parameters
----------
feature: string
Name of feature found in members of spike_info_list
spike_info_list: list
Spike info DataFrames for each sweep
start: float
Start of stimulus interval (seconds)
end: float
End of stimulus interval (seconds)
width: float (optional, default 20)
Bin width in ms

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.spike_feature_vector, line 18)

Unexpected section title.

Returns
-------
output: array
Concatenated vector of binned spike features
ipfx.feature_vectors.step_subthreshold(amp_sweep_dict, target_amps, start, end, extend_duration=0.2, subsample_interval=0.01, amp_tolerance=0.0)[source]

Subsample set of subthreshold step responses including regions before and after step

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.step_subthreshold, line 4)

Unexpected section title.

Parameters
----------
amp_sweep_dict : dict
Amplitude-sweep pairs
target_amps: list
Desired amplitudes for output vector
start: float
start stimulus interval (seconds)
end: float
end of stimulus interval (seconds)
extend_duration: float (optional, default 0.2)
Duration to extend sweep before and after stimulus interval (seconds)
subsample_interval: float (optional, default 0.01)
Size of subsampled bins (seconds)
amp_tolerance: float (optional, default 0)
Tolerance for finding matching amplitudes

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.step_subthreshold, line 21)

Unexpected section title.

Returns
-------

output_vector: subsampled, concatenated voltage trace

ipfx.feature_vectors.subthresh_depol_norm(amp_sweep_dict, deflect_dict, start, end, extend_duration=0.2, subsample_interval=0.01, steady_state_interval=0.1)[source]

Largest positive-going subthreshold step response that does not evoke spikes, normalized to baseline and steady-state at end of step

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.subthresh_depol_norm, line 5)

Unexpected section title.

Parameters
----------
amp_sweep_dict: dict
Amplitude-sweep pairs
deflect_dict:
Dictionary of (baseline, deflect) tuples with amplitude keys
start: float
start stimulus interval (seconds)
end: float
end of stimulus interval (seconds)
extend_duration: float (optional, default 0.2)
Duration to extend sweep on each side of stimulus interval (seconds)
subsample_interval: float (optional, default 0.01)
Size of subsampled bins (seconds)
steady_state_interval: float (optional, default 0.1)
Interval before end for normalization (seconds)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.subthresh_depol_norm, line 22)

Unexpected section title.

Returns
-------
subsampled_v: array
Subsampled, normalized voltage trace
ipfx.feature_vectors.subthresh_norm(amp_sweep_dict, deflect_dict, start, end, target_amp=-101.0, extend_duration=0.2, subsample_interval=0.01)[source]

Subthreshold step response closest to target amplitude normalized to baseline and peak deflection

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.subthresh_norm, line 4)

Unexpected section title.

Parameters
----------
amp_sweep_dict: dict
Amplitude-sweep pairs
deflect_dict:
Dictionary of (baseline, deflect) tuples with amplitude keys
start: float
start stimulus interval (seconds)
end: float
end of stimulus interval (seconds)
target_amp: float (optional, default=-101)
Search target for amplitude (pA)
extend_duration: float (optional, default 0.2)
Duration to extend sweep on each side of stimulus interval (seconds)
subsample_interval: float (optional, default 0.01)
Size of subsampled bins (seconds)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/feature_vectors.py:docstring of ipfx.feature_vectors.subthresh_norm, line 21)

Unexpected section title.

Returns
-------
subsampled_v: array
Subsampled, normalized voltage trace

ipfx.lab_notebook_reader module

A shim for backwards compatible imports of lab_notebook_reader

ipfx.lims_queries module

ipfx.lims_queries.able_to_connect_to_lims()[source]
ipfx.lims_queries.get_igorh5_path_from_lims(ephys_roi_result)[source]
ipfx.lims_queries.get_input_h5_file(specimen_id)[source]
ipfx.lims_queries.get_input_nwb_file(specimen_id)[source]
ipfx.lims_queries.get_nwb_path_from_lims(ephys_roi_result)[source]

Try to find NWBIgor file preferentially If not found, look for a processed NWB file

well known file type ID for NWB files is 475137571 well known file type ID for NWBIgor files is 570280085

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/lims_queries.py:docstring of ipfx.lims_queries.get_nwb_path_from_lims, line 9)

Unexpected section title.

Parameters
----------

ephys_roi_result: int

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/lims_queries.py:docstring of ipfx.lims_queries.get_nwb_path_from_lims, line 13)

Unexpected section title.

Returns
-------

full path of the nwb file

ipfx.lims_queries.get_specimen_info_from_lims_by_id(specimen_id)[source]
ipfx.lims_queries.get_stimuli_description()[source]
ipfx.lims_queries.get_sweep_states(specimen_id)[source]
ipfx.lims_queries.project_specimen_ids(project, passed_only=True)[source]
ipfx.lims_queries.query(query, parameters=None)[source]

ipfx.logging_utils module

ipfx.logging_utils.configure_logger(cell_dir)[source]
ipfx.logging_utils.log_pretty_header(header, level=1, top_line_break=True, bottom_line_break=True)[source]

Decorate logging message to make logging output more human readable

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/logging_utils.py:docstring of ipfx.logging_utils.log_pretty_header, line 4)

Unexpected section title.

Parameters
----------
header: str
header message
level: int
1 or 2 as in markdown
top_line_break: bool (True)
add a blank line at the top
bottom_line_break: bool (True)
add a blank line at the bottom

ipfx.nwb_append module

ipfx.nwb_append.append_spike_times(input_nwb_path: Union[str, pathlib.Path], sweep_spike_times: Dict[int, List[float]], output_nwb_path: Union[str, pathlib.Path, None] = None)[source]

Appends spiketimes to an nwb2 file

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/nwb_append.py:docstring of ipfx.nwb_append.append_spike_times, line 4)

Unexpected section title.

Paramters
---------

input_nwb_path: location of input nwb file without spiketimes

spike_times: Dict of sweep_num: spiketimes

output_nwb_path: optional location to write new nwb file with
spiketimes, otherwise appends spiketimes to input file

ipfx.plot_qc_figures module

ipfx.plot_qc_figures.display_features(qc_fig_dir, data_set, feature_data)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/plot_qc_figures.py:docstring of ipfx.plot_qc_figures.display_features, line 2)

Unexpected section title.

Parameters
----------
qc_fig_dir: str
directory name for storing html pages

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/plot_qc_figures.py:docstring of ipfx.plot_qc_figures.display_features, line 5)

Definition list ends without a blank line; unexpected unindent.

data_set: NWB data set feature_data: dict

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/plot_qc_figures.py:docstring of ipfx.plot_qc_figures.display_features, line 7)

Unexpected indentation.
cell and sweep features

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/plot_qc_figures.py:docstring of ipfx.plot_qc_figures.display_features, line 10)

Unexpected section title.

Returns
-------
ipfx.plot_qc_figures.exp_curve(x, a, inv_tau, y0)[source]

Function used for tau curve fitting

ipfx.plot_qc_figures.get_features(sweep_features, sweep_number)[source]
ipfx.plot_qc_figures.get_spikes(sweep_features, sweep_number)[source]
ipfx.plot_qc_figures.get_time_string()[source]
ipfx.plot_qc_figures.load_sweep(data_set, sweep_number)[source]
ipfx.plot_qc_figures.make_cell_html(image_files, metadata, file_name, img_sub_dir, required_fields=('electrode_0_pa', 'seal_gohm', 'initial_access_resistance_mohm', 'input_resistance_mohm'))[source]
ipfx.plot_qc_figures.make_cell_page(data_set, feature_data, working_dir, save_cell_plots=True)[source]
ipfx.plot_qc_figures.make_sweep_html(sweep_files, file_name, img_sub_dir)[source]
ipfx.plot_qc_figures.make_sweep_page(data_set, working_dir)[source]
ipfx.plot_qc_figures.mask_nulls(data)[source]
ipfx.plot_qc_figures.plot_cell_figures(data_set, figure_data, image_dir, sizes)[source]
ipfx.plot_qc_figures.plot_fi_curve_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_hero_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_images(image_dir, sizes, image_sets)[source]
ipfx.plot_qc_figures.plot_instantaneous_threshold_thumbnail(data_set, sweep_numbers, cell_features, lims_features, sweep_features, color='red')[source]
ipfx.plot_qc_figures.plot_long_square_summary(data_set, cell_features, lims_features)[source]
ipfx.plot_qc_figures.plot_ramp_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_rheo_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_sag_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_short_square_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_single_ap_values(data_set, sweep_numbers, lims_features, sweep_features, cell_features, type_name)[source]
ipfx.plot_qc_figures.plot_subthreshold_long_square_figures(data_set, cell_features, lims_features, sweep_features, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.plot_sweep_figures(data_set, image_dir, sizes)[source]
ipfx.plot_qc_figures.plot_sweep_set_summary(data_set, highlight_sweep_number, sweep_numbers, highlight_color='#0779BE', background_color='#dddddd')[source]
ipfx.plot_qc_figures.plot_sweep_value_figures(sweeps, image_dir, sizes, cell_image_files)[source]
ipfx.plot_qc_figures.save_figure(fig, image_name, image_set_name, image_dir, sizes, image_sets, scalew=1, scaleh=1, ext='png')[source]

ipfx.py2to3 module

ipfx.py2to3.to_bytes(bytes_or_str)[source]
ipfx.py2to3.to_str(bytes_or_str)[source]

ipfx.qc_feature_evaluator module

ipfx.qc_feature_evaluator.evaluate_blowout(blowout_mv, blowout_mv_min, blowout_mv_max, fail_tags)[source]
ipfx.qc_feature_evaluator.evaluate_electrode_0(electrode_0_pa, electrode_0_pa_max, fail_tags)[source]
ipfx.qc_feature_evaluator.evaluate_input_and_access_resistance(input_access_resistance_ratio, input_vs_access_resistance_max, initial_access_resistance_mohm, access_resistance_mohm_min, access_resistance_mohm_max, fail_tags)[source]
ipfx.qc_feature_evaluator.evaluate_seal(seal_gohm, seal_gohm_min, fail_tags)[source]
ipfx.qc_feature_evaluator.load_default_qc_criteria()[source]
ipfx.qc_feature_evaluator.qc_cell(cell_data, qc_criteria=None)[source]

Evaluate cell state across different types of stimuli

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_cell, line 4)

Unexpected section title.

Parameters
----------
cell_data : dict
cell features
qc_criteria : dict
qc criteria

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_cell, line 11)

Unexpected section title.

Returns
-------
cell_state : dict
cell state including qc features
ipfx.qc_feature_evaluator.qc_current_clamp_sweep(sweep, is_ramp, qc_criteria=None)[source]

QC for the current-clamp sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_current_clamp_sweep, line 4)

Unexpected section title.

Parameters
----------
is_ramp: bool
True for Ramp otherwise False
sweep : dict
features of a sweep
qc_criteria : dict
qc criteria

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_current_clamp_sweep, line 13)

Unexpected section title.

Returns
-------
fails : int
number of fails
fail_tags : list of str
tags of the failed sweeps
ipfx.qc_feature_evaluator.qc_experiment(ontology, cell_features, sweep_features, qc_criteria=None)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_experiment, line 2)

Unexpected section title.

Parameters
----------
ontology: StimulusOntology object
stimulus ontology
cell_features : dict
cell features
sweep_features: list of dicts
sweep features
qc_criteria : dict
qc criteria

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_evaluator.py:docstring of ipfx.qc_feature_evaluator.qc_experiment, line 13)

Unexpected section title.

Returns
-------
cell_state : list sweep_states : list
ipfx.qc_feature_evaluator.qc_sweeps(ontology, sweep_features, qc_criteria)[source]

ipfx.qc_feature_extractor module

ipfx.qc_feature_extractor.cell_qc_features(data_set, manual_values=None)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.cell_qc_features, line 2)

Unexpected section title.

Parameters
----------
data_set : EphysDataSet
dataset
manual_values : dict
default (manual) values that can be passed in through input.json.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.cell_qc_features, line 10)

Unexpected section title.

Returns
-------
features : dict
cell qc features
tags : list
warning tags
ipfx.qc_feature_extractor.check_sweep_integrity(sweep, is_ramp)[source]
ipfx.qc_feature_extractor.compute_input_access_resistance_ratio(ir, sr)[source]
ipfx.qc_feature_extractor.current_clamp_sweep_qc_features(sweep, is_ramp)[source]
ipfx.qc_feature_extractor.current_clamp_sweep_stim_features(sweep)[source]
ipfx.qc_feature_extractor.extract_blowout(data_set, tags)[source]

Measure blowout voltage

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_blowout, line 4)

Unexpected section title.

Parameters
----------

data_set: EphysDataSet tags: list

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_blowout, line 7)

Unexpected indentation.
warning tags

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_blowout, line 10)

Unexpected section title.

Returns
-------
blowout_mv: float
blowout voltage in mV
ipfx.qc_feature_extractor.extract_clamp_seal(data_set, tags, manual_values=None)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_clamp_seal, line 2)

Unexpected section title.

Parameters
----------

data_set: EphysDataSet tags: list

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_clamp_seal, line 5)

Unexpected indentation.
warning tags

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_clamp_seal, line 6)

Block quote ends without a blank line; unexpected unindent.

manual_values

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_clamp_seal, line 9)

Unexpected section title.

Returns
-------
ipfx.qc_feature_extractor.extract_electrode_0(data_set, tags)[source]

Measure electrode zero

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_electrode_0, line 4)

Unexpected section title.

Parameters
----------

data_set: EphysDataSet tags: list

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_electrode_0, line 7)

Unexpected indentation.
warning tags

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_electrode_0, line 10)

Unexpected section title.

Returns
-------

e0: float

ipfx.qc_feature_extractor.extract_initial_access_resistance(breakin_sweep, tags, manual_values)[source]
ipfx.qc_feature_extractor.extract_input_and_access_resistance(data_set, tags, manual_values=None)[source]
Measure input and series (access) resistance in two steps:
  1. finding the breakin sweep
  2. and then analyzing it

if the value is unavailable then check to see if it was set manually

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_input_and_access_resistance, line 9)

Unexpected section title.

Parameters
----------

data_set: EphysDataSet tags: list

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_input_and_access_resistance, line 12)

Unexpected indentation.
warning tags
manual_values: dict
manual/default values

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_feature_extractor.py:docstring of ipfx.qc_feature_extractor.extract_input_and_access_resistance, line 18)

Unexpected section title.

Returns
-------
ir: float
input resistance
sr: float
access resistance
ipfx.qc_feature_extractor.extract_input_resistance(breakin_sweep, tags, manual_values)[source]
ipfx.qc_feature_extractor.extract_recording_date(data_set, tags)[source]
ipfx.qc_feature_extractor.sweep_qc_features(data_set)[source]

ipfx.qc_features module

ipfx.qc_features.get_r_from_peak_pulse_response(v, i, t)[source]
ipfx.qc_features.get_r_from_stable_pulse_response(v, i, t)[source]

Compute input resistance from the stable pulse response

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_features.py:docstring of ipfx.qc_features.get_r_from_stable_pulse_response, line 4)

Unexpected section title.

Parameters
----------

v : float membrane voltage (V) i : float input current (A) t : time (s)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_features.py:docstring of ipfx.qc_features.get_r_from_stable_pulse_response, line 10)

Unexpected section title.

Returns
-------

ir: float input resistance

ipfx.qc_features.get_square_pulse_idx(v)[source]

Get up and down indices of the square pulse(s). Skipping the very first pulse (test pulse)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_features.py:docstring of ipfx.qc_features.get_square_pulse_idx, line 5)

Unexpected section title.

Parameters
----------
v: float
pulse trace

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/qc_features.py:docstring of ipfx.qc_features.get_square_pulse_idx, line 10)

Unexpected section title.

Returns
-------
up_idx, down_idx: list, list
up, down indices
ipfx.qc_features.measure_blowout(v, idx0)[source]
ipfx.qc_features.measure_electrode_0(curr, hz, t=0.005)[source]
ipfx.qc_features.measure_initial_access_resistance(v, curr, t)[source]
ipfx.qc_features.measure_input_resistance(v, curr, t)[source]
ipfx.qc_features.measure_seal(v, curr, t)[source]
ipfx.qc_features.measure_vm(vals)[source]
ipfx.qc_features.measure_vm_delta(mean_start, mean_end)[source]

ipfx.script_utils module

ipfx.script_utils.categorize_iclamp_sweeps(data_set, stimuli_names, sweep_qc_option='none', specimen_id=None)[source]
ipfx.script_utils.dataset_for_specimen_id(specimen_id, data_source, ontology, file_list=None)[source]
ipfx.script_utils.filter_results(specimen_ids, results)[source]
ipfx.script_utils.lims_nwb_information(specimen_id)[source]
ipfx.script_utils.organize_results(specimen_ids, results)[source]

Build dictionary of results, filling data from cells with appropriate-length nan arrays where needed

ipfx.script_utils.preprocess_long_square_sweeps(data_set, sweep_numbers, extra_dur=0.2, subthresh_min_amp=-100.0)[source]
ipfx.script_utils.preprocess_ramp_sweeps(data_set, sweep_numbers)[source]
ipfx.script_utils.preprocess_short_square_sweeps(data_set, sweep_numbers, extra_dur=0.2, spike_window=0.05)[source]
ipfx.script_utils.save_errors_to_json(error_set, output_dir, output_code)[source]
ipfx.script_utils.save_results_to_h5(specimen_ids, results_dict, output_dir, output_code)[source]
ipfx.script_utils.save_results_to_npy(specimen_ids, results_dict, output_dir, output_code)[source]
ipfx.script_utils.sdk_nwb_information(specimen_id)[source]
ipfx.script_utils.validate_sweeps(data_set, sweep_numbers, extra_dur=0.2)[source]

ipfx.spike_detector module

ipfx.spike_detector.check_thresholds_and_peaks(v, t, spike_indexes, peak_indexes, upstroke_indexes, start=None, end=None, max_interval=0.005, thresh_frac=0.05, filter=10.0, dvdt=None, tol=1.0, reject_at_stim_start_interval=0.0)[source]

Validate thresholds and peaks for set of spikes

Check that peaks and thresholds for consecutive spikes do not overlap Spikes with overlapping thresholds and peaks will be merged.

Check that peaks and thresholds for a given spike are not too far apart.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.check_thresholds_and_peaks, line 9)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of spike indexes peak_indexes : numpy array of indexes of spike peaks upstroke_indexes : numpy array of indexes of spike upstrokes start : start of time window for feature analysis (optional) end : end of time window for feature analysis (optional) max_interval : maximum allowed time between start of spike and time of peak in sec (default 0.005) thresh_frac : fraction of average upstroke for threshold calculation (optional, default 0.05) filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dvdt : pre-calculated time-derivative of voltage (optional) tol : tolerance for returning to threshold in mV (optional, default 1) reject_at_stim_start_interval : duration of window after start to reject potential spikes (optional, default 0)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.check_thresholds_and_peaks, line 25)

Unexpected section title.

Returns
-------

spike_indexes : numpy array of modified spike indexes peak_indexes : numpy array of modified spike peak indexes upstroke_indexes : numpy array of modified spike upstroke indexes clipped : numpy array of clipped status of spikes

ipfx.spike_detector.detect_putative_spikes(v, t, start=None, end=None, filter=10.0, dv_cutoff=20.0, dvdt=None)[source]

Perform initial detection of spikes and return their indexes.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.detect_putative_spikes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds start : start of time window for spike detection (optional) end : end of time window for spike detection (optional) filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dv_cutoff : minimum dV/dt to qualify as a spike in V/s (optional, default 20) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.detect_putative_spikes, line 14)

Unexpected section title.

Returns
-------

putative_spikes : numpy array of preliminary spike indexes

ipfx.spike_detector.filter_putative_spikes(v, t, spike_indexes, peak_indexes, min_height=2.0, min_peak=-30.0, filter=10.0, dvdt=None)[source]
Filter out events that are unlikely to be spikes based on:
  • Height (threshold to peak)
  • Absolute peak level

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.filter_putative_spikes, line 6)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of preliminary spike indexes peak_indexes : numpy array of indexes of spike peaks min_height : minimum acceptable height from threshold to peak in mV (optional, default 2) min_peak : minimum acceptable absolute peak level in mV (optional, default -30) filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.filter_putative_spikes, line 17)

Unexpected section title.

Returns
-------

spike_indexes : numpy array of threshold indexes peak_indexes : numpy array of peak indexes

ipfx.spike_detector.find_clipped_spikes(v, t, spike_indexes, peak_indexes, end_index, tol)[source]

Check that last spike was not cut off too early by end of stimulus by checking that the membrane potential returned to at least the threshold voltage - otherwise, drop it

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_clipped_spikes, line 6)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of spike indexes peak_indexes : numpy array of indexes of spike peaks end_index: int index of the end of time window for feature analysis

tol: float tolerance to returning to threshold

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_clipped_spikes, line 16)

Unexpected section title.

Returns
-------

clipped: Boolean np.array

ipfx.spike_detector.find_downstroke_indexes(v, t, peak_indexes, trough_indexes, clipped=None, filter=10.0, dvdt=None)[source]

Find indexes of minimum voltage (troughs) between spikes.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_downstroke_indexes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds peak_indexes : numpy array of spike peak indexes trough_indexes : numpy array of threshold indexes clipped: boolean array - False if spike not clipped by edge of window filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_downstroke_indexes, line 14)

Unexpected section title.

Returns
-------

downstroke_indexes : numpy array of downstroke indexes

ipfx.spike_detector.find_peak_indexes(v, t, spike_indexes, end=None)[source]

Find indexes of spike peaks.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_peak_indexes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of preliminary spike indexes end : end of time window for spike detection (optional)

ipfx.spike_detector.find_trough_indexes(v, t, spike_indexes, peak_indexes, clipped=None, end=None)[source]

Find indexes of minimum voltage (trough) between spikes.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_trough_indexes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of spike indexes peak_indexes : numpy array of spike peak indexes end : end of time window (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_trough_indexes, line 12)

Unexpected section title.

Returns
-------

trough_indexes : numpy array of threshold indexes

ipfx.spike_detector.find_upstroke_indexes(v, t, spike_indexes, peak_indexes, filter=10.0, dvdt=None)[source]

Find indexes of maximum upstroke of spike.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_upstroke_indexes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of preliminary spike indexes peak_indexes : numpy array of indexes of spike peaks filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.find_upstroke_indexes, line 13)

Unexpected section title.

Returns
-------

upstroke_indexes : numpy array of upstroke indexes

ipfx.spike_detector.refine_threshold_indexes(v, t, upstroke_indexes, thresh_frac=0.05, filter=10.0, dvdt=None)[source]

Refine threshold detection of previously-found spikes.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.refine_threshold_indexes, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds upstroke_indexes : numpy array of indexes of spike upstrokes (for threshold target calculation) thresh_frac : fraction of average upstroke for threshold calculation (optional, default 0.05) filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default 10) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_detector.py:docstring of ipfx.spike_detector.refine_threshold_indexes, line 13)

Unexpected section title.

Returns
-------

threshold_indexes : numpy array of threshold indexes

ipfx.spike_features module

ipfx.spike_features.analyze_trough_details(v, t, spike_indexes, peak_indexes, clipped=None, end=None, filter=10.0, heavy_filter=1.0, term_frac=0.01, adp_thresh=0.5, tol=0.5, flat_interval=0.002, adp_max_delta_t=0.005, adp_max_delta_v=10.0, dvdt=None)[source]

Analyze trough to determine if an ADP exists and whether the reset is a ‘detour’ or ‘direct’

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.analyze_trough_details, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of spike indexes peak_indexes : numpy array of spike peak indexes end : end of time window (optional) filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (default 1) heavy_filter : lower cutoff frequency for 4-pole low-pass Bessel filter in kHz (default 1) thresh_frac : fraction of average upstroke for threshold calculation (optional, default 0.05) adp_thresh: minimum dV/dt in V/s to exceed to be considered to have an ADP (optional, default 1.5) tol : tolerance for evaluating whether Vm drops appreciably further after end of spike (default 1.0 mV) flat_interval: if the trace is flat for this duration, stop looking for an ADP (default 0.002 s) adp_max_delta_t: max possible ADP delta t (default 0.005 s) adp_max_delta_v: max possible ADP delta v (default 10 mV) dvdt : pre-calculated time-derivative of voltage (optional)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.analyze_trough_details, line 21)

Unexpected section title.

Returns
-------

isi_types : numpy array of isi reset types (direct or detour) fast_trough_indexes : numpy array of indexes at the start of the trough (i.e. end of the spike) adp_indexes : numpy array of adp indexes (np.nan if there was no ADP in that ISI slow_trough_indexes : numpy array of indexes at the minimum of the slow phase of the trough

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.analyze_trough_details, line 26)

Unexpected indentation.
(if there wasn’t just a fast phase)
ipfx.spike_features.estimate_adjusted_detection_parameters(v_set, t_set, interval_start, interval_end, filter=10)[source]

Estimate adjusted values for spike detection by analyzing a period when the voltage changes quickly but passively (due to strong current stimulation), which can result in spurious spike detection results.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.estimate_adjusted_detection_parameters, line 6)

Unexpected section title.

Parameters
----------

v_set : list of numpy arrays of voltage time series in mV t_set : list of numpy arrays of times in seconds interval_start : start of analysis interval (sec) interval_end : end of analysis interval (sec)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.estimate_adjusted_detection_parameters, line 13)

Unexpected section title.

Returns
-------

new_dv_cutoff : adjusted dv/dt cutoff (V/s) new_thresh_frac : adjusted fraction of avg upstroke to find threshold

ipfx.spike_features.find_widths(v, t, spike_indexes, peak_indexes, trough_indexes, clipped=None)[source]

Find widths at half-height for spikes.

Widths are only returned when heights are defined

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.find_widths, line 6)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds spike_indexes : numpy array of spike indexes peak_indexes : numpy array of spike peak indexes trough_indexes : numpy array of trough indexes

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.find_widths, line 14)

Unexpected section title.

Returns
-------

widths : numpy array of spike widths in sec

ipfx.spike_features.fit_prespike_time_constant(t, v, start, spike_time, dv_limit=-0.001, tau_limit=0.3)[source]

Finds the dominant time constant of the pre-spike rise in voltage

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.fit_prespike_time_constant, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds start : start of voltage rise (seconds) spike_time : time of first spike (seconds) dv_limit : dV/dt cutoff (default -0.001)

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.fit_prespike_time_constant, line 10)

Unexpected indentation.
Shortens fit window if rate of voltage drop exceeds this limit

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.fit_prespike_time_constant, line 11)

Block quote ends without a blank line; unexpected unindent.
tau_limit : upper bound for slow time constant (seconds, default 0.3)
If the slower time constant of a double-exponential fit is twice that of the faster and exceeds this limit, the faster one will be considered the dominant one

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_features.py:docstring of ipfx.spike_features.fit_prespike_time_constant, line 16)

Unexpected section title.

Returns
-------

tau : dominant time constant (seconds)

ipfx.spike_train_features module

ipfx.spike_train_features.adaptation_index(isis)[source]

Calculate adaptation index of isis.

ipfx.spike_train_features.average_rate(t, spikes, start, end)[source]

Calculate average firing rate during interval between start and end.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.average_rate, line 4)

Unexpected section title.

Parameters
----------

t : numpy array of times in seconds spikes : numpy array of spike indexes start : start of time window for spike detection end : end of time window for spike detection

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.average_rate, line 11)

Unexpected section title.

Returns
-------

avg_rate : average firing rate in spikes/sec

ipfx.spike_train_features.basic_spike_train_features(t, spikes_df, start, end, exclude_clipped=False)[source]
ipfx.spike_train_features.burst(t, spikes_df, tol=0.5, pause_cost=1.0)[source]

Find bursts and return max “burstiness” index (normalized max rate in burst vs out).

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.burst, line 4)

Unexpected section title.

Returns
-------

max_burstiness_index : max “burstiness” index across detected bursts num_bursts : number of bursts detected

ipfx.spike_train_features.delay(t, v, spikes_df, start, end)[source]

Calculates ratio of latency to dominant time constant of rise before spike

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.delay, line 4)

Unexpected section title.

Returns
-------

delay_ratio : ratio of latency to tau (higher means more delay) tau : dominant time constant of rise before spike

ipfx.spike_train_features.detect_bursts(isis, isi_types, fast_tr_v, fast_tr_t, slow_tr_v, slow_tr_t, thr_v, tol=0.5, pause_cost=1.0)[source]

Detect bursts in spike train.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_bursts, line 4)

Unexpected section title.

Parameters
----------

isis : numpy array of n interspike intervals isi_types : numpy array of n interspike interval types fast_tr_v : numpy array of fast trough voltages for the n + 1 spikes of the train fast_tr_t : numpy array of fast trough times for the n + 1 spikes of the train slow_tr_v : numpy array of slow trough voltages for the n + 1 spikes of the train slow_tr_t : numpy array of slow trough times for the n + 1 spikes of the train thr_v : numpy array of threshold voltages for the n + 1 spikes of the train tol : tolerance for the difference in slow trough voltages and thresholds (default 0.5 mV)

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_bursts, line 13)

Unexpected indentation.
Used to identify “delay” interspike intervals that occur within a burst

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_bursts, line 16)

Unexpected section title.

Returns
-------
bursts : list of bursts
Each item in list is a tuple of the form (burst_index, start, end) where burst_index is a comparison index between the highest instantaneous rate within the burst vs the highest instantaneous rate outside the burst. start is the index of the first ISI of the burst, and end is the ISI index immediately following the burst.
ipfx.spike_train_features.detect_pauses(isis, isi_types, cost_weight=1.0)[source]

Determine which ISIs are “pauses” in ongoing firing.

Pauses are unusually long ISIs with a “detour reset” among “direct resets”.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_pauses, line 6)

Unexpected section title.

Parameters
----------

isis : numpy array of interspike intervals isi_types : numpy array of interspike interval types (‘direct’ or ‘detour’) cost_weight : weight for cost function for calling an ISI a pause

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_pauses, line 10)

Unexpected indentation.
Higher cost weights lead to fewer ISIs identified as pauses. The cost function also depends on the difference between the duration of the “pause” ISIs and the average duration and standard deviation of “non-pause” ISIs.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.detect_pauses, line 15)

Unexpected section title.

Returns
-------

pauses : numpy array of indices corresponding to pauses in isis

ipfx.spike_train_features.fit_fi_slope(stim_amps, avg_rates)[source]

Fit the rate and stimulus amplitude to a line and return the slope of the fit.

ipfx.spike_train_features.get_isis(t, spikes)[source]

Find interspike intervals in sec between spikes (as indexes).

ipfx.spike_train_features.latency(t, spikes, start)[source]

Calculate time to the first spike.

ipfx.spike_train_features.norm_diff(a)[source]

Calculate average of (a[i] - a[i+1]) / (a[i] + a[i+1]).

ipfx.spike_train_features.norm_sq_diff(a)[source]

Calculate average of (a[i] - a[i+1])^2 / (a[i] + a[i+1])^2.

ipfx.spike_train_features.pause(t, spikes_df, start, end, cost_weight=1.0)[source]

Estimate average number of pauses and average fraction of time spent in a pause

Attempts to detect pauses with a variety of conditions and averages results together.

Pauses that are consistently detected contribute more to estimates.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/spike_train_features.py:docstring of ipfx.spike_train_features.pause, line 8)

Unexpected section title.

Returns
-------

avg_n_pauses : average number of pauses detected across conditions avg_pause_frac : average fraction of interval (between start and end) spent in a pause max_reliability : max fraction of times most reliable pause was detected given weights tested n_max_rel_pauses : number of pauses detected with max_reliability

ipfx.stim_features module

ipfx.stim_features.find_stim_interval(idx0, stim, hz)[source]
ipfx.stim_features.get_stim_characteristics(i, t, test_pulse=True)[source]

Identify the start time, duration, amplitude, start index, and end index of a general stimulus.

ipfx.stimulus module

class ipfx.stimulus.Stimulus(tag_sets)[source]

Bases: object

has_tag(tag, tag_type=None)[source]
tags(tag_type=None, flat=False)[source]
class ipfx.stimulus.StimulusOntology(stim_ontology_tags=None)[source]

Bases: object

DEFAULT_STIMULUS_ONTOLOGY_FILE = '/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/defaults/stimulus_ontology.json'
classmethod default()[source]

Construct an ontology object using default tags

find(tag, tag_type=None)[source]

Find stimuli matching a given tag Parameters ———- tag: str tag_type: str

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/stimulus.py:docstring of ipfx.stimulus.StimulusOntology.find, line 8)

Unexpected section title.

Returns
-------

matching_stims: list of Stimuli objects

find_one(tag, tag_type=None)[source]
stimulus_has_all_tags(stim, tags, tag_type=None)[source]
stimulus_has_any_tags(stim, tags, tag_type=None)[source]

Find stimulus based on a tag stim and then check if it has any tags Parameters ———- stim: str

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/stimulus.py:docstring of ipfx.stimulus.StimulusOntology.stimulus_has_any_tags, line 5)

Unexpected indentation.
tag to find stimulus

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/stimulus.py:docstring of ipfx.stimulus.StimulusOntology.stimulus_has_any_tags, line 6)

Block quote ends without a blank line; unexpected unindent.
tags: str
tags to check in any belong to the stimulus

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/stimulus.py:docstring of ipfx.stimulus.StimulusOntology.stimulus_has_any_tags, line 8)

Definition list ends without a blank line; unexpected unindent.

tag_type

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/stimulus.py:docstring of ipfx.stimulus.StimulusOntology.stimulus_has_any_tags, line 11)

Unexpected section title.

Returns
-------

bool: True if any tags match, otherwise False

ipfx.stimulus_protocol_analysis module

class ipfx.stimulus_protocol_analysis.LongSquareAnalysis(spx, sptx, subthresh_min_amp, tau_frac=0.1, require_subthreshold=True, require_suprathreshold=True)[source]

Bases: ipfx.stimulus_protocol_analysis.StimulusProtocolAnalysis

HERO_MAX_AMP_OFFSET = 61.0
HERO_MIN_AMP_OFFSET = 39.0
SAG_TARGET = -100.0
SUBTHRESH_MAX_AMP = 0
analyze(sweep_set)[source]
analyze_subthreshold(sweep_set)[source]
analyze_suprathreshold(sweep_set)[source]
as_dict(features, extra_params=None)[source]
find_hero_sweep(rheo_amp, spiking_features, min_offset=39.0, max_offset=61.0)[source]
find_rheobase_sweep(spiking_features)[source]
class ipfx.stimulus_protocol_analysis.RampAnalysis(spx, sptx)[source]

Bases: ipfx.stimulus_protocol_analysis.StimulusProtocolAnalysis

analyze(sweep_set)[source]
as_dict(features, extra_params=None)[source]
class ipfx.stimulus_protocol_analysis.ShortSquareAnalysis(spx, sptx)[source]

Bases: ipfx.stimulus_protocol_analysis.StimulusProtocolAnalysis

analyze(sweep_set)[source]
as_dict(features, extra_params=None)[source]
class ipfx.stimulus_protocol_analysis.StimulusProtocolAnalysis(spx, sptx)[source]

Bases: object

MEAN_FEATURES = ['upstroke_downstroke_ratio', 'peak_v', 'peak_t', 'trough_v', 'trough_t', 'fast_trough_v', 'fast_trough_t', 'slow_trough_v', 'slow_trough_t', 'threshold_v', 'threshold_i', 'threshold_t', 'peak_v', 'peak_t']
all_sweep_features()[source]
analyze(sweep_set, extra_sweep_features=None, exclude_clipped=False)[source]
analyze_basic_features(sweep_set, extra_sweep_features=None, exclude_clipped=False)[source]
as_dict(features, extra_params=None)[source]
mean_features_first_spike(spikes_set, features_list=None)[source]

Compute mean feature values for the first spike in list of extractors

reset_basic_features()[source]
subthreshold_sweep_features(sweep_features=None)[source]
suprathreshold_sweep_features(sweep_features=None)[source]

ipfx.subthresh_features module

ipfx.subthresh_features.baseline_voltage(t, v, start, baseline_interval=0.1, baseline_detect_thresh=0.3, filter_frequency=1.0)[source]
ipfx.subthresh_features.fit_membrane_time_constant(t, v, start, end, rmse_max_tol=1.0)[source]

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

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.fit_membrane_time_constant, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltages in mV t : numpy array of times in seconds start : start of time window for exponential fit end : end of time window for exponential fit rsme_max_tol: minimal acceptable root mean square error (default 1e-4)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.fit_membrane_time_constant, line 12)

Unexpected section title.

Returns
-------

a, inv_tau, y0 : Coefficients of equation y0 + a * exp(-inv_tau * x)

returns np.nan for values if fit fails

ipfx.subthresh_features.input_resistance(t_set, i_set, v_set, start, end, baseline_interval=0.1)[source]

Estimate input resistance in MOhms, assuming all sweeps in passed extractor are hyperpolarizing responses.

ipfx.subthresh_features.sag(t, v, i, start, end, peak_width=0.005, baseline_interval=0.03)[source]

Calculate the sag in a hyperpolarizing voltage response.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.sag, line 4)

Unexpected section title.

Parameters
----------

peak_width : window width to get more robust peak estimate in sec (default 0.005)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.sag, line 8)

Unexpected section title.

Returns
-------

sag : fraction that membrane potential relaxes back to baseline

ipfx.subthresh_features.time_constant(t, v, i, start, end, max_fit_end=None, frac=0.1, baseline_interval=0.1, min_snr=20.0)[source]

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

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 5)

Unexpected section title.

Parameters
----------

v : numpy array of voltages in mV t : numpy array of times in seconds start : start of stimulus interval in seconds end : end of stimulus interval in seconds max_fit_end : maximum end of exponential fit window. If None, end of fit

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 11)

Unexpected indentation.
window will always be the time of the peak hyperpolarizing deflection. If set, end of fit window will be max_fit_end if it is earlier than the time of peak deflection (default None)

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 14)

Block quote ends without a blank line; unexpected unindent.
frac : fraction of peak deflection (or deflection at present_fit_end if used)
to find to determine start of fit window. (default 0.1)

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 16)

Definition list ends without a blank line; unexpected unindent.

baseline_interval : duration before start for baseline Vm calculation min_snr : minimum signal-to-noise ratio (SNR) to allow calculation of time constant.

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 18)

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

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.time_constant, line 21)

Unexpected section title.

Returns
-------

tau : membrane time constant in seconds

ipfx.subthresh_features.voltage_deflection(t, v, i, start, end, deflect_type=None)[source]

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

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.voltage_deflection, line 4)

Unexpected section title.

Parameters
----------
deflect_type : measure minimal (‘min’) or maximal (‘max’) voltage deflection
If not specified, it will check to see if the current (i) is positive or negative between start and end, then choose ‘max’ or ‘min’, respectively If the current is not defined, it will default to ‘min’.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/subthresh_features.py:docstring of ipfx.subthresh_features.voltage_deflection, line 11)

Unexpected section title.

Returns
-------

deflect_v : peak deflect_index : index of peak deflection

ipfx.sweep module

class ipfx.sweep.Sweep(t, v, i, clamp_mode, sampling_rate, sweep_number=None, epochs=None)[source]

Bases: object

detect_epochs()[source]

Detect epochs if they are not provided in the constructor

i
select_epoch(epoch_name)[source]
set_time_zero_to_index(time_step)[source]
t
v
class ipfx.sweep.SweepSet(sweeps)[source]

Bases: object

align_to_start_of_epoch(epoch_name)[source]
i
sampling_rate
select_epoch(epoch_name)[source]
sweep_number
t
v

ipfx.sweep_props module

ipfx.sweep_props.assign_sweep_states(sweep_states, sweep_features)[source]

Assign sweep state to all sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.assign_sweep_states, line 4)

Unexpected section title.

Parameters
----------

sweep_states: dict of sweep states sweep_features: list of dics of sweep features

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.assign_sweep_states, line 9)

Unexpected section title.

Returns
-------
ipfx.sweep_props.count_sweep_states(sweep_states)[source]

Count passed and total sweeps

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.count_sweep_states, line 4)

Unexpected section title.

Parameters
----------
sweep_states: list of dicts
Sweep state dict has keys:
“reason”: list of strings “sweep_number”: int “passed”: True/False

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.count_sweep_states, line 10)

Definition list ends without a blank line; unexpected unindent.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.count_sweep_states, line 11)

Unexpected section title.

Returns
-------
num_passed_sweeps: int
number of sweeps passed QC
num_sweeps: int
number of sweeps QCed
ipfx.sweep_props.create_sweep_state(sweep_number, fail_tags)[source]
ipfx.sweep_props.drop_failed_sweeps(sweep_features)[source]
ipfx.sweep_props.drop_tagged_sweeps(sweep_features)[source]
ipfx.sweep_props.extract_sweep_features_subset(feature_names, sweep_features)[source]

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.extract_sweep_features_subset, line 2)

Unexpected section title.

Parameters
----------

sweep_features: list of dicts of sweep features feature_names: list of features to select

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/sweep_props.py:docstring of ipfx.sweep_props.extract_sweep_features_subset, line 7)

Unexpected section title.

Returns
-------

sweep_features_subset: list of dicts including only a subset of features from feature_names

ipfx.sweep_props.modify_sweep_info_keys(sweep_list)[source]
ipfx.sweep_props.override_auto_sweep_states(manual_sweep_states, sweep_states)[source]
ipfx.sweep_props.remove_sweep_feature(feature_name, sweep_features)[source]

ipfx.time_series_utils module

ipfx.time_series_utils.average_voltage(v, t, start=None, end=None)[source]

Calculate average voltage between start and end.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.average_voltage, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds start : start of time window for spike detection (optional, default None) end : end of time window for spike detection (optional, default None)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.average_voltage, line 11)

Unexpected section title.

Returns
-------

v_avg : average voltage

ipfx.time_series_utils.calculate_dvdt(v, t, filter=None)[source]

Low-pass filters (if requested) and differentiates voltage by time.

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.calculate_dvdt, line 4)

Unexpected section title.

Parameters
----------

v : numpy array of voltage time series in mV t : numpy array of times in seconds filter : cutoff frequency for 4-pole low-pass Bessel filter in kHz (optional, default None)

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.calculate_dvdt, line 10)

Unexpected section title.

Returns
-------

dvdt : numpy array of time-derivative of voltage (V/s = mV/ms)

ipfx.time_series_utils.find_time_index(t, t_0)[source]

Find the index value of a given time (t_0) in a time series (t).

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.find_time_index, line 5)

Unexpected section title.

Parameters
----------

t : time array t_0 : time point to find an index

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.find_time_index, line 10)

Unexpected section title.

Returns
-------

idx: index of t closest to t_0

ipfx.time_series_utils.flatnotnan(a)[source]

Returns indices that are non nan in a flattened version of a

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.flatnotnan, line 4)

Unexpected section title.

Parameters
----------

a: np.array

System Message: SEVERE/4 (/home/docs/checkouts/readthedocs.org/user_builds/ipfx/checkouts/v1.0.0.2/ipfx/time_series_utils.py:docstring of ipfx.time_series_utils.flatnotnan, line 8)

Unexpected section title.

Returns
-------
res: np.array
Output array containing indices of an array that are not nan
ipfx.time_series_utils.has_fixed_dt(t)[source]

Check that all time intervals are identical.

ipfx.utilities module

Module contents

Top-level package for ipfx.