Skip to content

Commit 1a4a1dd

Browse files
committed
docs formatting
1 parent d6b971f commit 1a4a1dd

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

doc/modules/qualitymetrics/noise_cutoff.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ instead, it directly compares counts in the low‐amplitude bins to counts in hi
1414

1515
1. **Build a histogram**
1616

17-
For each unit, divide all amplitudes into `n_bins` equally spaced bins over the range of the amplitude.
18-
If the number of spikes is large, you may consider using a larger `n_bins`. For a small number of spikes, consider a smaller `n_bins`.
17+
For each unit, divide all amplitudes into ``n_bins`` equally spaced bins over the range of the amplitude.
18+
If the number of spikes is large, you may consider using a larger ``n_bins``. For a small number of spikes, consider a smaller ``n_bins``.
1919
Let :math:`n_i` denote the count in the :math:`i`-th bin.
2020

2121
2. **Identify the “low” region**
22-
- Compute the amplitude value at the specified `low_quantile` (for example, 0.10 = 10th percentile), denoted as :math:`\text{amp}_{low}`.
23-
- Find all histogram bins whose upper edge is below that quantile value. These bins form the low‐quantile region.
22+
- Compute the amplitude value at the specified ``low_quantile`` (for example, 0.10 = 10th percentile), denoted as :math:`\text{amp}_{low}`.
23+
- Find all histogram bins whose upper edge is below that quantile value. These bins form the "low‐quantile region".
2424
- Compute
2525

2626
.. math::
@@ -29,8 +29,8 @@ instead, it directly compares counts in the low‐amplitude bins to counts in hi
2929
3030
3. **Identify the “high” region**
3131

32-
- Compute the amplitude value at the specified `high_quantile` (for example, 0.25 = top 25th percentile), denoted as :math:`\text{amp}_{high}`.
33-
- Find all histogram bins whose lower edge is greater than that quantile value. These bins form the high‐quantile region.”
32+
- Compute the amplitude value at the specified ``high_quantile`` (for example, 0.25 = top 25th percentile), denoted as :math:`\text{amp}_{high}`.
33+
- Find all histogram bins whose lower edge is greater than that quantile value. These bins form the "high‐quantile region".
3434
- Compute
3535

3636
.. math::
@@ -46,8 +46,8 @@ instead, it directly compares counts in the low‐amplitude bins to counts in hi
4646
\mathrm{cutoff} = \frac{\mu_{\mathrm{low}} - \mu_{\mathrm{high}}}{\sigma_{\mathrm{high}}}.
4747
4848
49-
- If no low‐quantile bins exist, a warning is issued and `cutoff = NaN`.
50-
- If no high‐quantile bins exist or :math:`\sigma_{\mathrm{high}} = 0`, a warning is issued and `cutoff = NaN`.
49+
- If no low‐quantile bins exist, a warning is issued and ``cutoff = NaN``.
50+
- If no high‐quantile bins exist or :math:`\sigma_{\mathrm{high}} = 0`, a warning is issued and ``cutoff = NaN``.
5151

5252
5. **Compute the low-to-peak ratio**
5353

@@ -61,19 +61,20 @@ instead, it directly compares counts in the low‐amplitude bins to counts in hi
6161
- If there are no low bins, :math:`\mathrm{ratio} = NaN`.
6262

6363

64-
Together, (cutoff, ratio) quantify how suppressed the low‐end of the amplitude distribution is relative to the top quantile and to the peak.
64+
Together, ``(cutoff, ratio)`` quantify how suppressed the low‐end of the amplitude distribution is relative to the top quantile and to the peak.
6565

6666
Expectation and use
6767
-------------------
6868

6969
Noise cutoff attempts to describe whether an amplitude distribution is cut off.
70-
Larger values of `cutoff` and `ratio` suggest that the distribution is cut-off.
71-
IBL uses the default value of 1 to choose the number of lower bins, with a suggested threshold of 5 for `cutoff` and 0.1 for `ratio` to determine whether a unit is cut off or not.
72-
In practice, the IBL threshold is quite conservative, and a lower threshold might be better for your data.
73-
We suggest plotting the data using the `plot_amplitudes` widget to view your data when choosing your threshold.
70+
Larger values of ``cutoff`` and ``ratio`` suggest that the distribution is cut-off.
71+
IBL uses the default value of 1 (equivalent to e.g. ``low_quantile=0.01, n_bins=100``) to choose the number of
72+
lower bins, with a suggested threshold of 5 for ``cutoff`` to determine whether a unit is cut off or not.
73+
In practice, the IBL threshold is quite conservative, and a lower threshold might work better for your data.
74+
We suggest plotting the data using the :py:func:`~spikeinterface.widgets.plot_amplitudes` widget to view your data when choosing your threshold.
7475
It is suggested to use this metric when the amplitude histogram is **unimodal**.
7576

76-
The metric is loosely based on [Hill]_'s amplitude cutoff, but is here adapted (originally by [IBL2024]_) to avoid making the Gaussianity assumption on spike distributions.
77+
The metric is loosely based on [Hill]_'s amplitude cutoff, but is here adapted (originally by [IBL2024]_) to avoid making the Gaussian assumption on spike distributions.
7778

7879
Example code
7980
------------
@@ -118,8 +119,8 @@ Links to original implementations
118119

119120
* From `IBL implementation <https://github.com/int-brain-lab/ibllib/blob/2e1f91c622ba8dbd04fc53946c185c99451ce5d6/brainbox/metrics/single_units.py>`_
120121

121-
Note: Compared to the original implementation, we have added a comparison between the low-amplitude bins to the largest bin (`noise_ratio`).
122-
The selection of low-amplitude bins is based on the `low_quantile` rather than the number of bins.
122+
Note: Compared to the original implementation, we have added a comparison between the low-amplitude bins to the largest bin (``noise_ratio``).
123+
The selection of low-amplitude bins is based on the ``low_quantile`` rather than the number of bins.
123124

124125
Literature
125126
----------

0 commit comments

Comments
 (0)