Skip to content

Commit

Permalink
new example: settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaquier Aurélien Tristan committed Nov 5, 2024
1 parent cf19a84 commit 07f37b8
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 10 deletions.
7 changes: 6 additions & 1 deletion docs/examples_to_rst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ rm docs/source/extrafeats_example.rst
rm docs/source/multiprocessing_example.rst
rm docs/source/voltage_clamp.rst
rm -rf docs/source/voltage_clamp_files
rm docs/source/settings.rst
rm -rf docs/source/settings_notebook_files

# convert
jupyter nbconvert --to rst examples/sonata-network/sonata-network.ipynb
Expand All @@ -19,6 +21,7 @@ jupyter nbconvert --to rst examples/neo/load_nwb.ipynb
jupyter nbconvert --to rst examples/extracellular/extrafeats_example.ipynb
jupyter nbconvert --to rst examples/parallel/multiprocessing_example.ipynb
jupyter nbconvert --to rst examples/voltage_clamp/voltage_clamp.ipynb
jupyter nbconvert --to rst examples/settings/settings_notebook.ipynb

# move
mv examples/sonata-network/sonata-network.rst docs/source/
Expand All @@ -30,4 +33,6 @@ mv examples/neo/load_nwb_files docs/source/
mv examples/extracellular/extrafeats_example.rst docs/source/
mv examples/parallel/multiprocessing_example.rst docs/source/
mv examples/voltage_clamp/voltage_clamp.rst docs/source/
mv examples/voltage_clamp/voltage_clamp_files docs/source/
mv examples/voltage_clamp/voltage_clamp_files docs/source/
mv examples/settings/settings_notebook.rst docs/source/settings.rst
mv examples/settings/settings_notebook_files docs/source/
32 changes: 29 additions & 3 deletions docs/source/eFeatures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ The first spike is ignored by default. This can be changed by setting ignore_fir
The burst detection can be fine-tuned by changing the setting strict_burst_factor. Default value is 2.0.

- **Required features**: all_ISI_values
- **Units**: Hz
- **Units**: constant
- **Pseudocode**: ::

burst_begin_indices = [1]
Expand Down Expand Up @@ -433,7 +433,7 @@ The first spike is ignored by default. This can be changed by setting ignore_fir
The burst detection can be fine-tuned by changing the setting strict_burst_factor. Default value is 2.0.

- **Required features**: all_ISI_values
- **Units**: Hz
- **Units**: constant
- **Pseudocode**: ::

burst_begin_indices = [1]
Expand Down Expand Up @@ -1370,7 +1370,7 @@ min_AHP_indices
- **Pseudocode**: ::

peak_indices_plus = peak_indices
peak_indices_plus.append(len(voltage))
peak_indices_plus.append(len(voltage) - 1)
for i in range(peak_indices):
min_AHP_indices.append(numpy.argmin(v[i:i + 1]) + i)

Expand Down Expand Up @@ -1570,6 +1570,32 @@ min_voltage_between_spikes
for peak1, peak2 in zip(peak_indices[:-1], peak_indices[1:]):
min_voltage_between_spikes.append(numpy.min(voltage[peak1:peak2]))

min_between_peaks_indices
~~~~~~~~~~~~~~~~~~~~~~~~~

`SpikeShape`_ : Indices of the minimal voltage between consecutive spikes

The last value of min_between_peaks_values is the minimum between last spike and stimulus end
if strict stiminterval is True, or minimum between last spike and last voltage value
if strict stiminterval is False

Attention! This feature represents indices of the interpolated time series.
If you want to use it on time or voltage, make sure that you are using the interpolated output time or voltage feature,
and not the time or voltage variable you gave as input.

- **Required features**: peak_indices
- **Units**: constant
- **Pseudocode**: ::

if strict_stiminterval:
end_idx = numpy.argmin(t >= stim_end)[0][0]
else:
end_idx = len(time) - 1
peak_indices_plus = peak_indices
peak_indices_plus.append(end_idx)
for i in range(peak_indices):
min_between_peaks_indices.append(numpy.argmin(v[i:i + 1]) + i)

min_between_peaks_values
~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Examples
.. toctree::

python_example1
settings
multiprocessing_example
deap_optimisation
neoIO_example
Expand Down
10 changes: 5 additions & 5 deletions efel/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class Settings:
Attributes:
Threshold (float): Spike detection threshold (default: -20.0).
DerivativeThreshold (float): Threshold value for derivative calculations
(default: 10.0).
(default: 10.0).
DownDerivativeThreshold (float): Threshold value for downward derivative
calculations (default: -12.0).
calculations (default: -12.0).
dependencyfile_path (str): Path to the dependency file
(default: 'DependencyV5.txt').
(default: 'DependencyV5.txt').
spike_skipf (float): Fraction of spikes to skip (default: 0.1).
max_spike_skip (int): Maximum number of spikes to skip (default: 2).
interp_step (float): Interpolation step (default: 0.1).
Expand All @@ -55,7 +55,7 @@ class Settings:
min_spike_height (float): Minimum spike height (default: 20.0).
strict_stiminterval (bool): Strict stimulus interval (default: False).
initburst_freq_threshold (int): Initial burst frequency threshold
(default: 50)
(default: 50).
initburst_sahp_start (int): Initial burst SAHP start (default: 5).
initburst_sahp_end (int): Initial burst SAHP end (default: 100).
DerivativeWindow (int): Derivative window (default: 3).
Expand All @@ -66,7 +66,7 @@ class Settings:
ignore_first_ISI (bool): Ignore first ISI (default: True).
impedance_max_freq (float): Impedance maximum frequency (default: 50.0).
inactivation_tc_end_skip (int): number of data points to skip before
stim end for inactivation_time_constant feature
stim end for inactivation_time_constant feature (default: 10).
"""

Threshold: float = -20.0
Expand Down
24 changes: 23 additions & 1 deletion efel/units/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,27 @@
"deactivation_time_constant": "ms",
"inactivation_time_constant": "ms",
"check_ais_initiation": "constant",
"bpap_attenuation": "constant"
"bpap_attenuation": "constant",
"peak_indices": "constant",
"AP_rise_indices": "constant",
"AP_end_indices": "constant",
"AP_fall_indices": "constant",
"min_AHP_indices": "constant",
"AP_begin_indices": "constant",
"min_between_peaks_indices": "constant",
"burst_begin_indices": "constant",
"burst_end_indices": "constant",
"ADP_peak_indices": "constant",
"interburst_min_indices": "constant",
"postburst_min_indices": "constant",
"postburst_slow_ahp_indices": "constant",
"postburst_fast_ahp_indices": "constant",
"postburst_adp_peak_indices": "constant",
"interburst_15percent_indices": "constant",
"interburst_20percent_indices": "constant",
"interburst_25percent_indices": "constant",
"interburst_30percent_indices": "constant",
"interburst_40percent_indices": "constant",
"interburst_60percent_indices": "constant",
"burst_ISI_indices": "constant"
}
213 changes: 213 additions & 0 deletions examples/settings/settings_notebook.ipynb

Large diffs are not rendered by default.

0 comments on commit 07f37b8

Please sign in to comment.