Skip to content

Commit

Permalink
small GUI tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie-Fabre committed Sep 7, 2023
1 parent 1ce7346 commit c5d7907
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 8 additions & 2 deletions bc_qualityMetrics_pipeline.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@
%% example: get the quality metrics for one unit
% this is an example to get the quality metric for the unit with the
% original kilosort and phy label of xx (0-indexed), which corresponds to
% the unit with qMetric.clusterID == xx + 1. This is *NOT NECESSARILY* the
% the unit with qMetric.clusterID == xx + 1, and to
% qMetric.phy_clusterID == xx . This is *NOT NECESSARILY* the
% (xx + 1)th row of the structure qMetric - some of the clusters that kilosort
% outputs are empty, because they were dropped in the last stages of the
% algorithm. These empty clusters are not included in the qMetric structure
% there are two ways to do this:
% 1:
original_id_we_want_to_load = 0;
id_we_want_to_load_1_indexed = original_id_we_want_to_load + 1;
id_we_want_to_load_1_indexed = original_id_we_want_to_load + 1;
number_of_spikes_for_this_cluster = qMetric.nSpikes(qMetric.clusterID == id_we_want_to_load_1_indexed);
% or 2:
original_id_we_want_to_load = 0;
number_of_spikes_for_this_cluster = qMetric.nSpikes(qMetric.phy_clusterID == original_id_we_want_to_load);



4 changes: 3 additions & 1 deletion qualityMetrics/bc_runAllQualityMetrics.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@

% get this unit's attributes
thisUnit = uniqueTemplates(iUnit);
qMetric.clusterID(iUnit) = thisUnit;
qMetric.phy_clusterID(iUnit) = thisUnit - 1; % this is the cluster ID as it appears in phy
qMetric.clusterID(iUnit) = thisUnit; % this is the cluster ID as it appears in phy, 1-indexed (adding 1)

theseSpikeTimes = spikeTimes_seconds(spikeTemplates == thisUnit);
theseAmplis = templateAmplitudes(spikeTemplates == thisUnit);

Expand Down
3 changes: 1 addition & 2 deletions visualizationTools/bc_unitQualityGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ function updateUnit(unitQualityGuiHandle, memMapData, ephysData, rawWaveforms, i
else
set(guiData.isiTitle, 'String', '\color[rgb]{0 .5 0}ISI');
end
set(guiData.isiLegend, 'String', [num2str(qMetric.fractionRPVs_estimatedTauR(iCluster)*100), ' % r.p.v.', newline, ...
'estimated refractory period (ms): ', num2str(qMetric.RPV_tauR_estimate(iCluster))])
set(guiData.isiLegend, 'String', [num2str(qMetric.fractionRPVs_estimatedTauR(iCluster)*100), ' % r.p.v.'])

%% 6. plot isolation distance
if param.computeDistanceMetrics
Expand Down

0 comments on commit c5d7907

Please sign in to comment.