Skip to content

Commit

Permalink
update unitmatch default params
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie-Fabre committed Jun 5, 2024
1 parent 85ffcce commit d5f0ef7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qualityMetrics/bc_qualityParamValuesForUnitMatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@
end
paramBC.minThreshDetectPeaksTroughs = 0.2; % this is multiplied by the max value
paramBC.firstPeakRatio = 1.1; % if units have an initial peak before the trough,

% in a units waveform to give the minimum prominence to detect peaks using
% matlab's findpeaks function.
paramBC.firstPeakRatio = 1.1; % if units have an initial peak before the trough,

paramBC.normalizeSpDecay = 1; % whether to normalize spatial decay points relative to
% maximum - this makes the spatrial decay slop calculation more invariant to the
% spike-sorting algorithm used

% recording parametrs
paramBC.ephys_sample_rate = 30000; % samples per second
Expand Down Expand Up @@ -146,7 +146,7 @@
paramBC.somatic = 1;
paramBC.minWvDuration = 100; % in us
paramBC.maxWvDuration = 800; % in us
paramBC.minSpatialDecaySlope = -0.003;
paramBC.minSpatialDecaySlope = -0.005;
paramBC.maxWvBaselineFraction = 0.3;

%distance metrics
Expand Down
22 changes: 22 additions & 0 deletions qualityMetrics/bc_updateSpatialDecaySlope.asv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function bc_updateSpatialDecaySlope(kilosortSavePath, qMetricSavePath)

% load in quality metrics
[~, qMetric] = bc_loadSavedMetrics(qMetricSavePath);

% load in relevant kilosort files
[~, spikeTemplates, templateWaveforms, ~, ~, ...
~, ~] = bc_loadEphysData(kilosortSavePath);

uniqueTemplates = unique(spikeTemplates);

% update spatial decay value
for iUnit = 1:size(uniqueTemplates,1)

thisUnit = uniqueTemplates(iUnit);

qMetric.spatialDecaySlope(iUnit) = qMetric.spatialDecaySlope(iUnit)./max(max(templateWaveforms(thisUnit, :,:)));
end

% save new metrics
parquetwrite([fullfile(qMetricSavePath, 'templates._bc_qMetrics.parquet')], qMetric)
end

0 comments on commit d5f0ef7

Please sign in to comment.