Skip to content
jamesjun edited this page Dec 18, 2017 · 12 revisions

Clustering step is performed using sort_() function ("sort" command) that uses a density-based clustering (DPCLUS) method Rodriguez and Laio, Science'14. DPCLUS algorithm computes the density and distance parameters for each spiking event using their spatiotemporal neighbors. Density (=rho) is computed by counting the number of neighbors within a cut-off distance (dc). Distance to the nearest neighbor (delta) having a greater density value is stored, as well as the index of the nearest neighbor. Euclidean distances are computed in the feature dimension (P.vcFet) between a pair of events which occurred close in space and time (P.nTime_clu). GPU is used to significantly speed up the computation (~70x of CPU). Events at the density peaks are identified by searching for outliers in the density (rho) vs. distance (delta) plot, and the cluster memberships are first assigned to the peak-density events and recursively copied to their nearest neighbors until all events are assigned (gradient descending). For a spiking event having the peak amplitude at site K and the second peak at site L, its spatial neighbors include events that have the peak amplitude at sites K or L. Since the nearest neighbor can exist at a different site, the membership assignment can globally propagated to all sites. This heuristic can track units that are drifting between multiple sites.

After the initial clustering using DPCLUS, units with similar spike waveforms (averaged raw) are merged if their correlation score exceeds P.maxWavCor. Since the probe drift changes the spike waveforms, averaged waveforms are computed at three depth ranges per unit. The spike depth is estimated by the center of mass (CoM) using the site positions and the peak spike amplitude at each site. Since each unit has three average waveforms, maximum correlation score is taken from the 3x3 correlation matrix for each unit pair. Time shift is applied between a pair of unit (P.spkRefrac_ms = 0.25 ms) to find the maximum cross-correlation value.

Syntax

  • S0 = sort_(P)

Input

Output

Precondition

  • Spike detection is already done using detect_(). is_detected_() checks whether the spike detection is already done. "jrc sort" command calls detect_() if [[is_detected_()] returns false.

Operations

  • fet2clu_(): Cluster the event features (trFet_spk)
    • cluster_spacetime_(): Apply spatiotemporal DPCLUS (divide and conquer density-based clustering)
      • For each site, compute Rho (density) and Delta (distance) values for each spike using DPCLUS clustering
      • calc_dc2_(): Compute distance cut-off value (dc) based on the P.dc_percent parameter.
      • cuda_rho_(): Compute local density (rho) per each spike using GPU.
      • cuda_delta_(): Compute separation distance (delta) per each spike using GPU.
  • postCluster_(): Group clusters using rho and delta values (see P.rho_cut, P.delta1_cut), and apply automated merging based on the mean unit waveforms
  • post_merge_(): Merge units based on the mean spike waveforms. Unit pairs with correlation above the threshold (P.maxWavCor) is automatically merged.

Clone this wiki locally