Previously, the code assumed that no manual merging/splitting took place prior to calculating the sorting quality metrics. However, if post-hoc manual curation (e.g. in phy) has occurred, the PC features (calculated by Kilosort) will no longer be correctly indexed by the spike_clusters array.
These changes fix indexing issues related to this discrepancy, such that PC-based metrics are now correctly calculated when spike_clusters and spike_templates do not match.
Previously, the code assumed that no manual merging/splitting took place prior to calculating the sorting quality metrics. However, if post-hoc manual curation (e.g. in phy) has occurred, the PC features (calculated by Kilosort) will no longer be correctly indexed by the
spike_clusters
array.These changes fix indexing issues related to this discrepancy, such that PC-based metrics are now correctly calculated when
spike_clusters
andspike_templates
do not match.