Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Parameters ccg_threshold and cluster_pcs don't do anything #685

Closed
EliseA-UoB opened this issue May 7, 2024 · 1 comment
Closed

Comments

@EliseA-UoB
Copy link

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:

  1. ccg_threshold: default (0.25), 0.5, 0.1
  2. cluster_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

@jacobpennington
Copy link
Collaborator

jacobpennington commented May 7, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants