Skip to content

Commit

Permalink
Updated docs to reflect changes to template groupings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobpennington committed Apr 13, 2024
1 parent ecfd82a commit 8769ad7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Example notebooks are provided in the `docs/source/tutorials` folder and in the
**If you use Kilosort1-4, please cite the [paper](https://www.nature.com/articles/s41592-024-02232-7):**
Pachitariu, M., Sridhar, S., Pennington, J., & Stringer, C. (2024). Spike sorting with Kilosort4.

**Note on multi-shank probes** : We are aware of some issues with sorting data from probes with multiple shanks. See [documentation here](https://kilosort.readthedocs.io/en/latest/multi_shank.html) for recommended workarounds until the code is updated to handle these probes.
**Note on multi-shank probes** : We are aware of some issues with sorting data from probes with multiple shanks or 2D arrays. See [documentation here](https://kilosort.readthedocs.io/en/latest/multi_shank.html) for recommended workarounds until the code is updated to handle these probes.

**Note on reusing parameters from previous versions**: This probably will not work well. Kilosort4 is a new algorithm, and the main parameters (the thresholds) can affect the results in a different way for your data. Please start with the default parameters and adjust from there based on what you see in Phy.

Expand Down
2 changes: 1 addition & 1 deletion docs/gui_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you need to create a new probe layout, select "[new]" to open the probe creat
.. image:: https://www.kilosort.org/static/images/gui_make_probe.png
:width: 600

After a probe is selected, you can click "Preview Probe" to see a visualization and verify that the probe geometry looks correct.
After a probe is selected, you can click "Preview Probe" to see a visualization and verify that the probe geometry looks correct. Checking "True Aspect Ratio" will show a physically proportional representation. Moving the slider will adjust the displayed scale of the contacts.


Load the data
Expand Down
2 changes: 2 additions & 0 deletions docs/multi_shank.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Using probes with multiple shanks
==================================
Update: the latest version of the code addresses this issue. After getting feedback from users, this page will be removed if there are no further issues. For 2D arrays, you may want to set the new `x_centers` parameter (under "Extra Settings" in the GUI) for best results.

Currently, Kilosort4 does not process shanks separately. Until this is added, we recommend changing your probe layout to artificially stack the shanks in a single column with a bit of vertical space (~100um) between each shank.

If that option isn't feasible for some reason, you can also try adjusting the `min_template_size` and/or `dminx` parameters in the GUI, or in the settings argument for `run_kilosort` if you're using the API. Setting `dminx` to around half the total width of the probe seems to be a good starting point, and you can adjust from there.
Expand Down
5 changes: 5 additions & 0 deletions docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ This sets the standard deviation of the smallest Gaussian spatial envelope used
This is the number of nearest channels and template locations, respectively, used when assigning templates to spikes during spike detection. ``nearest_chans`` cannot be larger than the total number of channels on the probe, so it will need to be reduced for probes with less than 10 channels. ``nearest_templates`` does not have this restriction. However, for probes with around 64 channels or less and sparsely spaced contacts, decreasing ``nearest_templates`` to be less than or equal to the number of channels helps avoid numerical instability.


``x_centers``
-------------
The number of x-positions to use when determining centers for template groupings. Specifically, this is the number of centroids to look for when using k-means to cluster the x-positions for the probe. In most cases you should not need to specify this. However, **for probes with contacts arranged in a 2D grid**, we recommend setting ``x_centers`` such that centers are placed every 200-300um so that there are not too many templates in each group. For example, for an array that is 2000um in width, try ``x_centers = 10``. If contacts are very densely spaced, you may need to use a higher value for better performance.


``duplicate_spike_bins``
------------------------
After sorting has finished, spikes that occur within this number of bins of each other, from the same unit, are assumed to be artifacts and removed. The default of 15 bins corresponds to 0.5ms for a sampling rate of 30000hz. If your sampling rate is different, you may need to increase or decrease this accordingly. If you see otherwise good neurons with large peaks around 0ms when viewing correlograms in Phy, increasing this value can help remove those artifacts.
Expand Down

0 comments on commit 8769ad7

Please sign in to comment.