BUG: Parameters ccg_threshold and cluster_pcs don't do anything
Describe the issue:
Hi MouseLand team,
I'm working on a project to 'fine tune' the kilosort4 settings towards our specific electrodes and application, and have been tweaking the individual parameters to understand their impact on the spike detection and clustering.
I noticed that changing the clustering parameters ccg_threshold and cluster_pcs didn't do anything to the spikes detected, clusters, or 'good' units identified.
These are the limits I tested on our data:
ccg_threshold: default (0.25), 0.5, 0.1cluster_pcs: default (64), 1, 16, 32, 128
When I looked in Phy, the templates etc. looked identical to the default case. The other settings have worked just fine, resulting in changes in the spikes detected, clusters, etc.
Should I be expecting these settings to do something, or are they yet to be implemented?
Reproduce the bug:
from kilosort.io import load_probe
from kilosort import run_kilosort, DEFAULT_SETTINGS
import numpy as np
datafile = "path/to/file.dat"
settings = DEFAULT_SETTINGS.copy() #need to copy, or will overwrite the settings!
p = load_probe("path/to/probe.mat")
settings['n_chan_bin'] = 32
### CLUSTERS
settings['ccg_threshold'] = 1.0 #0.25 - no effect
#settings['cluster_pcs'] = 128 #64 - no effect
print(settings)
print("\n")
results = run_kilosort(
settings = settings,
filename = datafile,
probe=p)
Error message:
No response
Version information:
OS: Windows 10 Enterprise (build: 190475.4291) Python: 3.9.19
Context for the issue:
No response
Experiment information:
No response
@EliseA-UoB ccg_threshold is checked alongside a hard-coded threshold, so increasing the value (i.e. making it less restrictive) may not have any effect since the other criteria is the same:
cross_refractory = Q12<ccg_threshold and (R12<.05)
You should see some differences if you decrease it from the default instead.
As for cluster_pcs you are correct, it looks like that was used in the past but currently has no purpose.