Skip to content

Commit

Permalink
Merge pull request #38 from Julie-Fabre/bleeding_edge
Browse files Browse the repository at this point in the history
Bleeding edge
  • Loading branch information
Julie-Fabre authored Nov 23, 2023
2 parents bfd5746 + f35aa58 commit cbcfd2d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
5 changes: 4 additions & 1 deletion qualityMetrics/bc_getQualityUnitType.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
% unitType==0 defines all noise units
% unitType==1 defines all good units
% unitType==2 defines all MUA units
% unitType==3 defines all non-somatic units
% unitType==3 defines all non-somatic units. If
% param.splitGoodAndMua_NonSomatic is true, it specifically defines good
% non-somatic units
% unitType==4 defines all MUA non-somatic units if param.splitGoodAndMua_NonSomatic is true
% unitType_string - nUnits x 1 string array indicating the type of each unit (good, mua, noise, non-somatic).


Expand Down
12 changes: 8 additions & 4 deletions qualityMetrics/bc_plotGlobalQualityMetric.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ function bc_plotGlobalQualityMetric(qMetric, param, unitType, uniqueTemplates, t
%% plot summary of waveforms classified as noise/mua/good
% 1. single/multi/noise/axonal waveforms
figure('Color', 'w');

unitTypeString = {'Noise', 'Single', 'Multi', 'Non-somatic'};

if param.splitGoodAndMua_NonSomatic == 0
unitTypeString = {'Noise', 'Good', 'MUA', 'Non-somatic'};
else
unitTypeString = {'Noise', 'Somatic Good', 'Somatic MUA', 'Non-somatic Good', 'Non-somatic MUA'};
end
uniqueTemplates_idx = 1:size(uniqueTemplates, 1);
for iUnitType = 0:3
subplot(2, 2, iUnitType+1)
for iUnitType = 0:length(unitTypeString)-1
subplot(2, ceil(length(unitTypeString)/2), iUnitType+1)
title([unitTypeString{iUnitType+1}, ' unit template waveforms']);
hold on;
singleU = uniqueTemplates_idx(find(unitType == iUnitType));
Expand Down
26 changes: 15 additions & 11 deletions qualityMetrics/bc_qualityParamValues.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
% in a units waveform to give the minimum prominence to detect peaks using
% matlab's findpeaks function.

% recording parametrs
% recording parameters
param.ephys_sample_rate = 30000; % samples per second
param.nChannels = 385; %number of recorded channels (including any sync channels)
% recorded in the raw data. This is usually 384 or 385 for neuropixels
Expand All @@ -120,16 +120,10 @@


%% classifying units into good/mua/noise parameters
param.minAmplitude = 20; % in uV
param.maxRPVviolations = 0.1; % fraction
param.maxPercSpikesMissing = 20; % in percentage
param.minNumSpikes = 300; % number of spikes
% whether to classify non-somatic units
param.splitGoodAndMua_NonSomatic = 0;

param.maxDrift = 100;
param.minPresenceRatio = 0.7;
param.minSNR = 0.1;

%waveform
% waveform
param.maxNPeaks = 2; % maximum number of peaks
param.maxNTroughs = 1; % maximum number of troughs
param.somatic = 1; % keep only somatic units, and reject non-somatic ones
Expand All @@ -139,8 +133,18 @@
param.maxWvBaselineFraction = 0.3; % maximum absolute value in waveform baseline
% should not exceed this fraction of the waveform's abolute peak value

%distance metrics
% distance metrics
param.isoDmin = 20; % minimum isolation distance value
param.lratioMax = 0.1; % maximum l-ratio value
param.ssMin = NaN; % minimum silhouette score

% other classification params
param.minAmplitude = 20; % in uV
param.maxRPVviolations = 0.1; % fraction
param.maxPercSpikesMissing = 20; % in percentage
param.minNumSpikes = 300; % number of spikes
param.maxDrift = 100;
param.minPresenceRatio = 0.7;
param.minSNR = 0.1;

end

0 comments on commit cbcfd2d

Please sign in to comment.