Skip to content

Commit

Permalink
New analysis and visualization tools
Browse files Browse the repository at this point in the history
  • Loading branch information
cwindolf committed Dec 13, 2023
1 parent 85dd25f commit 1256c99
Show file tree
Hide file tree
Showing 5 changed files with 704 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/dartsort/cluster/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
import torch
from dartsort.util import drift_util, waveform_util
from dartsort.util.data_util import DARTsortSorting
from dartsort.util.multiprocessing_util import get_pool
from hdbscan import HDBSCAN
from sklearn.decomposition import PCA
Expand Down Expand Up @@ -210,10 +209,15 @@ def split_cluster(self, in_unit):
if n_spikes < self.min_cluster_size:
return SplitResult()

max_registered_channel, n_pitches_shift, reloc_amplitudes, kept = self.get_registered_channels(in_unit)
(
max_registered_channel,
n_pitches_shift,
reloc_amplitudes,
kept,
) = self.get_registered_channels(in_unit)
if not kept.size:
return SplitResult()

features = []
if self.use_localization_features:
loc_features = self.localization_features[in_unit]
Expand All @@ -222,7 +226,9 @@ def split_cluster(self, in_unit):
features.append(loc_features)

if self.n_pca_features > 0:
enough_good_spikes, kept, pca_embeds = self.pca_features(in_unit, max_registered_channel, n_pitches_shift)
enough_good_spikes, kept, pca_embeds = self.pca_features(
in_unit, max_registered_channel, n_pitches_shift
)
if not enough_good_spikes:
return SplitResult()
# scale pc features to match localization features
Expand Down
1 change: 1 addition & 0 deletions src/dartsort/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ class MatchingConfig:
default_featurization_config = FeaturizationConfig()
default_subtraction_config = SubtractionConfig()
default_template_config = TemplateConfig()
coarse_template_config = TemplateConfig(superres_templates=False)
default_matching_config = MatchingConfig()
Loading

0 comments on commit 1256c99

Please sign in to comment.