Subicular plateaus signal reward locations during goal-directed behavior.
The 6 matches · 2 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
- [1] § RESULTS › Unsupervised clustering organizes plateaus by pre-plateau Vm ↔ plateau_clustering_analysis_v3_anchors.m, lines 226–297 · score 0.77 · global template, t-SNE, plateau clusters, pre Vm, Fisher, silhouette
- [2] § METHOD DETAILS › K-means clustering and t-SNE visualization ↔ plateau_clustering_analysis_v3_anchors.m, lines 169–207 · score 0.71 · squared errors, silhouette scores, optimal, 1–6, sum, space
- [3] § METHOD DETAILS › Univariate analysis ↔ UnivariateAnalysis.zip/AnalyseTableUnivariateAnalysis.m, the whole file · a weak match · score 0.69 · Mann Whitney, univariate, pre event, plateau events, predicted, occurrence
- [4] § RESULTS › Subicular plateau occurrence is shaped by intrinsic and behavioral factors ↔ UnivariateAnalysis.zip/AnalyseTableUnivariateAnalysis.m, the whole file · a weak match · score 0.67 · Mann Whitney, plateau occurrence, pre event, univariate, predictor, variables
- [5] § METHOD DETAILS › Univariate analysis ↔ UnivariateAnalysis.zip/CreateTableUnivariateAnalysis.m, lines 1–21 · score 0.65 · plateau ratio, pre event, 20 ms, buffer, univariate, predicted
- [6] § METHOD DETAILS › Plateau analysis post reward location shift ↔ plateau-spatial-analysis.zip/analyzePlateauDistributions.m, lines 1–41 · score 0.51 · matched control, reward location, shift, delivered, opposite, bins
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 448 lines · 24 KB · CC-BY-4.0 · 2 matches
- function plateau_clustering_analysis_v3_anchors(main_folder)
- rng(1);
- %% ====================================================================
- %% SECTION 1: SETUP & CONFIGURATION
- %% ====================================================================
- if nargin < 1
- main_folder = uigetdir('', 'Select Data Folder');
- if main_folder == 0, return; end
- end
- timestamp = datestr(now, 'yyyymmdd_HHMMSS');
- save_dir = fullfile(main_folder, ['Clustering_Results_' timestamp]);
- if ~exist(save_dir, 'dir'), mkdir(save_dir); end
- FigList = struct('h', {}, 'name', {});
- % 1.1 Parameters
- k_clusters = 2;
- n_spatial_bins = 10;
- % 1.2 Anchors
- UseAnchors.Reward = true;
- UseAnchors.SimSpeed = true;
- UseAnchors.SimAccel = false;
- UseAnchors.ExactSpeed = true;
- UseAnchors.ExactAccel = false;
- UseAnchors.SpeedCrossUp = true;
- % 1.3 Filters
- Filter.Context = 'A';
- Filter.Zone = 'Both';
- Filter.Movement = 'RunOnly';
- Filter.PreVmRange = [-0.060, -0.040];
- Filter.MinDuration = 0.005;
- Filter.Kurtosis = false;
- Max_Kurtosis = 5;
- % 1.4 Features (Toggle True/False)
- FeatureParams.UseLog = true;
- UseFeatures.Duration = false;
- UseFeatures.MeanVm = false;
- UseFeatures.MedianVm = false;
- UseFeatures.Area = true;
- UseFeatures.MaxAmp = false;
- UseFeatures.Skew = false;
- UseFeatures.Kurtosis = false;
- UseFeatures.PreVm = true;
- UseFeatures.SignedDist = false;
- UseFeatures.RiseTime = false;
- UseFeatures.DecayTime = false;
- UseFeatures.TemplateMatch = true;
- fprintf('Setup Complete. Loading Data...\n');
- %% ====================================================================
- %% SECTION 2: DATA LOADING
- %% ====================================================================
- master_file = fullfile(main_folder, 'Master_Project_Data.mat');
- if ~exist(master_file, 'file'), errordlg('Data not found.'); return; end
- data = load(master_file);
- MasterEvents = data.MasterEvents;
- if isfield(data, 'SessionStruct'), SessionStruct=data.SessionStruct; else, SessionStruct=data.data_struct; end
- % Ensure SignedDist
- if ~ismember('SignedDist', MasterEvents.Properties.VariableNames)
- d = MasterEvents.DistToReward; z = lower(string(MasterEvents.ZoneTag));
- is_neg = contains(z, 'pre') | contains(z, 'far');
- d(is_neg) = -abs(d(is_neg)); MasterEvents.SignedDist = d;
- end
- % Anchor Mapping
- FullAnchorMap = {
- 'Reward', 'SignedDist', 'Reward';
- 'Sim Speed', 'Dist_similar_speed', 'similar_speed';
- 'Sim Accel', 'Dist_similar_accel', 'similar_accel';
- 'Exact Speed', 'Dist_exact_speed', 'exact_speed';
- 'Exact Accel', 'Dist_exact_accel', 'exact_accel';
- 'Speed Cross Up', 'Dist_speed_crossing_up', 'speed_crossing_up'
- };
- selMask = [UseAnchors.Reward; UseAnchors.SimSpeed; UseAnchors.SimAccel; ...
- UseAnchors.ExactSpeed; UseAnchors.ExactAccel; UseAnchors.SpeedCrossUp];
- AnchorMap = FullAnchorMap(logical(selMask), :);
- % Validate Columns
- valid_cols = false(size(AnchorMap,1), 1);
- for i=1:size(AnchorMap,1)
- if ismember(AnchorMap{i,2}, MasterEvents.Properties.VariableNames), valid_cols(i)=true; end
- end
- AnchorMap = AnchorMap(valid_cols, :);
- % Colors
- AncColors = lines(size(AnchorMap,1));
- rIdx = find(strcmp(AnchorMap(:,1), 'Reward')); if ~isempty(rIdx), AncColors(rIdx,:) = [0 0 0]; end
- % Ensure Features Exist
- req_cols = {'Kurtosis','RiseTime','DecayTime','MedianVm','Area','MaxAmp','Skew'};
- for r=1:length(req_cols), if ~ismember(req_cols{r}, MasterEvents.Properties.VariableNames), MasterEvents.(req_cols{r}) = nan(height(MasterEvents),1); end; end
- if all(isnan(MasterEvents.MedianVm)), MasterEvents.MedianVm = MasterEvents.MeanVm; end
- %% ====================================================================
- %% SECTION 3: FILTERING & TEMPLATES
- %% ====================================================================
- if strcmpi(Filter.Context, 'A'), MasterEvents = MasterEvents(strcmpi(MasterEvents.GroupTag, 'A'), :);
- elseif strcmpi(Filter.Context, 'B'), MasterEvents = MasterEvents(strcmpi(MasterEvents.GroupTag, 'B'), :); end
- if ~isempty(Filter.PreVmRange), pvm = MasterEvents.PreVm; MasterEvents = MasterEvents(pvm >= Filter.PreVmRange(1) & pvm <= Filter.PreVmRange(2), :); end
- z = lower(string(MasterEvents.ZoneTag));
- if strcmpi(Filter.Zone, 'NearOnly'), MasterEvents = MasterEvents((z == "pre") | (z == "post"), :);
- elseif strcmpi(Filter.Zone, 'FarOnly'), MasterEvents = MasterEvents((z == "far"), :); end
- s = MasterEvents.Speed; s(isnan(s)) = 0;
- if strcmpi(Filter.Movement, 'RunOnly'), MasterEvents = MasterEvents(s >= 0.05, :);
- elseif strcmpi(Filter.Movement, 'StopOnly'), MasterEvents = MasterEvents(s < 0.05, :); end
- if Filter.MinDuration > 0, MasterEvents = MasterEvents(MasterEvents.Duration >= Filter.MinDuration, :); end
- % Kurtosis Filter
- if Filter.Kurtosis ==1, MasterEvents = MasterEvents(MasterEvents.Kurtosis <= Max_Kurtosis, :); end
- if height(MasterEvents) < k_clusters, errordlg('Not enough events.', 'Error'); return; end
- % Templates
- norm_len = 100; pre_pad = 0;
- augmented_mat = nan(height(MasterEvents), pre_pad + norm_len);
- for i = 1:height(MasterEvents)
- tr = MasterEvents.Trace{i}; pvm = MasterEvents.PreVm(i);
- if length(tr) > 2, body = interp1(linspace(0,1,length(tr)), tr, linspace(0,1,norm_len));
- augmented_mat(i, :) = [repmat(pvm, 1, pre_pad), body];
- end
- end
- TemplateTrace = nanmean(augmented_mat, 1);
- ShapeScore = zeros(height(MasterEvents), 1);
- for i = 1:height(MasterEvents)
- if ~any(isnan(augmented_mat(i,:))), R = corrcoef(augmented_mat(i,:), TemplateTrace); ShapeScore(i) = R(1,2); end
- end
- MasterEvents.TemplateMatch = ShapeScore;
- %% ====================================================================
- %% SECTION 4: FEATURE EXTRACTION & CLUSTERING
- %% ====================================================================
- X = []; VarNames = {};
- if FeatureParams.UseLog, TF = @(x) log10(x); prefix = 'Log'; else, TF = @(x) x; prefix = ''; end
- if UseFeatures.Duration, X=[X, TF(MasterEvents.Duration)]; VarNames{end+1}=[prefix 'Dur']; end
- if UseFeatures.MeanVm, X=[X, MasterEvents.MeanVm]; VarNames{end+1}='MeanVm'; end
- if UseFeatures.MedianVm, X=[X, MasterEvents.MedianVm]; VarNames{end+1}='MedVm'; end
- if UseFeatures.Area, X=[X, TF(MasterEvents.Area)]; VarNames{end+1}=[prefix 'Area']; end
- if UseFeatures.MaxAmp, X=[X, MasterEvents.MaxAmp]; VarNames{end+1}='MaxAmp'; end
- if UseFeatures.Skew, X=[X, MasterEvents.Skew]; VarNames{end+1}='Skew'; end
- if UseFeatures.Kurtosis, X=[X, MasterEvents.Kurtosis]; VarNames{end+1}='Kurt'; end
- if UseFeatures.PreVm, X=[X, MasterEvents.PreVm]; VarNames{end+1}='PreVm'; end
- if UseFeatures.SignedDist, X=[X, MasterEvents.SignedDist]; VarNames{end+1}='Dist'; end
- if UseFeatures.RiseTime, X=[X, MasterEvents.RiseTime]; VarNames{end+1}='Rise'; end
- if UseFeatures.DecayTime, X=[X, MasterEvents.DecayTime]; VarNames{end+1}='Decay'; end
- if UseFeatures.TemplateMatch, X=[X, MasterEvents.TemplateMatch]; VarNames{end+1}='Shape'; end
- if isempty(X), error('No features selected.'); end
- bad_rows = any(isnan(X) | isinf(X), 2);
- if any(bad_rows), X = X(~bad_rows, :); MasterEvents = MasterEvents(~bad_rows, :); end
- X_z = zscore(X); X_z(isnan(X_z)) = 0;
- %% ====================================================================
- %% SECTION 4.5: EVALUATE OPTIMAL K (NEW TEST)
- %% ====================================================================
- fprintf('Testing optimal cluster number (k=1 to 6)...\n');
- max_k_test = 6;
- sse_list = zeros(max_k_test, 1);
- sil_list = nan(max_k_test, 1); % Silhouette undefined for k=1
- % Loop through k=1 to k=6 to test quality
- for k_t = 1:max_k_test
- % Run k-means for this k (suppress output)
- [idx_t, ~, sumd_t] = kmeans(X_z, k_t, 'Replicates', 3, 'Display', 'off');
- sse_list(k_t) = sum(sumd_t); % Sum of Squared Errors (Inertia)
- if k_t > 1
- s_t = silhouette(X_z, idx_t);
- sil_list(k_t) = mean(s_t);
- end
- end
- % Plot the results
- f_opt = figure('Name', 'Optimal K Test', 'Color', 'w', 'Position', [200 200 900 400]);
- FigList(end+1) = struct('h', f_opt, 'name', 'Optimal_K_Test');
- t_opt = tiledlayout(1, 2, 'TileSpacing', 'compact', 'Padding', 'compact');
- % Plot 1: Elbow Plot (SSE) - Look for the "bend"
- nexttile;
- plot(1:max_k_test, sse_list, '-o', 'LineWidth', 2, 'Color', 'k', 'MarkerFaceColor', 'b');
- title('Elbow Method (SSE)');
- xlabel('Number of Clusters (k)'); ylabel('Sum of Squared Errors');
- grid on;
- % Plot 2: Silhouette Plot - Look for the highest peak
- nexttile;
- plot(2:max_k_test, sil_list(2:end), '-o', 'LineWidth', 2, 'Color', 'k', 'MarkerFaceColor', 'r');
- title('Silhouette Method');
- xlabel('Number of Clusters (k)'); ylabel('Mean Silhouette Score');
- yline(0.5, 'g--', 'Good Structure'); % Reference line
- grid on;
- sgtitle('Determining Optimal Cluster Number');
- %%
- fprintf('Running K-Means Clustering...\n');
- [idx, ~] = kmeans(X_z, k_clusters, 'Replicates', 5);
- MasterEvents.Cluster = idx;
- cmap = lines(k_clusters);
- % Separation Metrics
- sil_values = silhouette(X_z, idx); GlobalSeparationIndex = mean(sil_values);
- num_vars = size(X_z, 2); FishersRatio = zeros(1, num_vars);
- X1 = X_z(idx==1, :); X2 = X_z(idx==2, :);
- for v = 1:num_vars, m1=mean(X1(:,v)); m2=mean(X2(:,v)); v1=var(X1(:,v)); v2=var(X2(:,v)); FishersRatio(v)=((m1-m2)^2)/(v1+v2); end
- ClusterStats.Silhouette = GlobalSeparationIndex; ClusterStats.FishersRatio = FishersRatio;
- %% ====================================================================
- %% SECTION 5: BASIC PLOTS (Quality Checks)
- %% ====================================================================
- % Quality
- f_stat = figure('Name', 'Cluster Quality', 'Color', 'w', 'Position', [50 50 1000 500]);
- FigList(end+1) = struct('h', f_stat, 'name', 'Cluster_Metrics');
- subplot(1, 3, 1); silhouette(X_z, idx); title(sprintf('Separation: %.3f', GlobalSeparationIndex));
- subplot(1, 3, [2 3]); bar(FishersRatio); set(gca,'XTick',1:num_vars,'XTickLabel',VarNames,'XTickLabelRotation',45); title('Parameter Importance'); grid on;
- % Correlation
- f_corr = figure('Name', 'Feature Correlation', 'Color', 'w', 'Position', [100 100 600 500]);
- FigList(end+1) = struct('h', f_corr, 'name', 'Feature_Correlation');
- heatmap(VarNames, VarNames, corr(X), 'Colormap', jet, 'ColorLimits', [-1 1]);
- % Main Vis
- f_main = figure('Name','Main Cluster Analysis','Color','w', 'Position', [50 50 1400 700]);
- FigList(end+1) = struct('h', f_main, 'name', 'Main_Visualization');
- if size(X_z,1) > 2000, samp=randsample(size(X_z,1),2000); else, samp=(1:size(X_z,1))'; end
- X_in=X_z(samp,:); idx_tsne=idx(samp); try, Y = tsne(X_in); tsne_success=true; catch, tsne_success=false; end
- subplot(2,4,1); if UseFeatures.TemplateMatch, gscatter(MasterEvents.Duration, MasterEvents.TemplateMatch, idx, cmap); ylabel('Shape Score'); else, gscatter(MasterEvents.Duration, MasterEvents.MeanVm, idx, cmap); ylabel('MeanVm'); end; title('Clusters'); grid on; legend('off');
- subplot(2,4,[2 3]); cents = zeros(k_clusters, size(X_z,2)); for c=1:k_clusters, cents(c,:) = mean(X_z(idx==c,:),1); end; plot(cents','-o', 'LineWidth', 2); set(gca, 'XTick', 1:numel(VarNames), 'XTickLabel', VarNames); title('Z-Score Profiles'); grid on;
- subplot(2,4,4); if tsne_success, gscatter(Y(:,1),Y(:,2),idx_tsne,cmap,'.',10); title('t-SNE (Cluster)'); legend('off'); end
- subplot(2,4,5); hold on; edges = linspace(-1,1,20); for c=1:k_clusters, histogram(MasterEvents.SignedDist(idx==c), edges, 'FaceColor', cmap(c,:), 'FaceAlpha', 0.4); end; title('Spatial Dist');
- subplot(2,4,8); if tsne_success, [~,~,sid_map] = unique(MasterEvents.SessionID(samp)); scatter(Y(:,1), Y(:,2), 15, sid_map, 'filled', 'MarkerFaceAlpha', 0.7); colormap(gca, turbo); title('t-SNE (Session)'); end
- subplot(2,4,6); plot(linspace(0, 1, length(TemplateTrace)), TemplateTrace, 'k', 'LineWidth', 2); title('Global Template'); axis tight;
- % Raw Traces
- for c = 1:k_clusters
- f_trace = figure('Name', sprintf('Cluster %d Raw Traces',c), 'Color', 'w', 'Position', [100 100 800 800]);
- FigList(end+1) = struct('h', f_trace, 'name', sprintf('Raw_Traces_Cluster_%d', c));
- t = tiledlayout(5,5, 'TileSpacing','none', 'Padding', 'compact');
- evs = MasterEvents(MasterEvents.Cluster==c,:);
- n_show = min(25, height(evs));
- p_idx = randsample(height(evs), n_show);
- for i=1:numel(p_idx)
- nexttile;
- tr = evs.Trace{p_idx(i)};
- plot(tr, 'Color', cmap(c,:), 'LineWidth', 1.5);
- yline(evs.PreVm(p_idx(i)), 'k:', 'LineWidth', 1);
- axis off;
- % --- SCALE BAR (Adjusted for 24ms events) ---
- if i == numel(p_idx)
- hold on;
- sr = 20000; % Sampling Rate
- x_sec = 0.05; % <--- CHANGED to 50ms (0.05s)
- y_volts = 0.02; % 20 mV
- % Convert to units
- x_len = x_sec * sr;
- y_len = y_volts;
- % Position: Bottom-Right
- yl = ylim; xl = xlim;
- x_start = xl(2) - x_len - (diff(xl)*0.1);
- y_start = yl(1) + (diff(yl)*0.1);
- % Draw L-Bar
- plot([x_start, x_start + x_len], [y_start, y_start], 'k-', 'LineWidth', 2);
- plot([x_start + x_len, x_start + x_len], [y_start, y_start + y_len], 'k-', 'LineWidth', 2);
- % Labels
- text(x_start + x_len/2, y_start - (diff(yl)*0.1), '50ms', ...
- 'HorizontalAlignment', 'center', 'FontSize', 8, 'FontWeight', 'bold');
- text(x_start + x_len + (diff(xl)*0.05), y_start + y_len/2, '20mV', ...
- 'Rotation', 90, 'VerticalAlignment', 'middle', 'FontSize', 8, 'FontWeight', 'bold');
- end
- end
- sgtitle(sprintf('Cluster %d Examples (n=%d)', c, n_show));
- end
- %% ====================================================================
- %% SECTION 6: MULTI-ANCHOR SPATIAL ANALYSIS (Normalized)
- %% ====================================================================
- fprintf('Running Spatial Analysis (Normalized per Session)...\n');
- nSess = numel(unique(MasterEvents.SessionID)); uSess = unique(MasterEvents.SessionID);
- NewEdges = linspace(-1, 1, n_spatial_bins + 1); NewCenters = (NewEdges(1:end-1) + NewEdges(2:end)) / 2;
- mask_near = abs(NewCenters) <= 0.4;
- PlotData.Spatial = struct();
- for c = 1:k_clusters
- ClusEvents = MasterEvents(MasterEvents.Cluster == c, :);
- PooledAbs=[]; PooledNorm=[]; SessAbsMean=[]; SessAbsSEM=[]; SessNormMean=[]; SessNormSEM=[];
- Stats_Near=nan(nSess, size(AnchorMap,1)); Stats_Far=nan(nSess, size(AnchorMap,1));
- AnchorDataStruct = struct();
- for a = 1:size(AnchorMap,1)
- ancName = AnchorMap{a,1}; colName = AnchorMap{a,2}; occField = AnchorMap{a,3};
- SessCurve_Abs = nan(nSess, n_spatial_bins); SessCurve_Norm = nan(nSess, n_spatial_bins);
- GlobalNumer = zeros(1, n_spatial_bins); GlobalDenom = zeros(1, n_spatial_bins);
- for s = 1:nSess
- sid = uSess(s);
- sIdx=0; for k=1:length(SessionStruct), tid=SessionStruct(k).SessionID; if iscell(tid), tid=tid{1}; end; if tid==sid, sIdx=k; break; end; end
- if sIdx==0, continue; end
- S = SessionStruct(sIdx); OccData = [];
- if strcmpi(ancName, 'Reward'), if isfield(S, 'Occupancy'), OccData = S.Occupancy; end
- else, if isfield(S, 'AnchorOccupancy') && isfield(S.AnchorOccupancy, occField), OccData = S.AnchorOccupancy.(occField); end; end
- if isempty(OccData) || ~isstruct(OccData), continue; end
- if strcmpi(Filter.Movement, 'RunOnly'), if isfield(OccData, 'Hist_Run'), h=OccData.Hist_Run; else, h=[]; end
- else, if isfield(OccData, 'Hist_All'), h=OccData.Hist_All; else, h=[]; end; end
- if isempty(h) || sum(h) < 1e-6, continue; end
- OldEdges = linspace(-1, 1, length(h) + 1); OldCenters = (OldEdges(1:end-1) + OldEdges(2:end)) / 2;
- occ_new = interp1(OldCenters, h, NewCenters, 'linear', 0);
- occ_final = occ_new * (mean(diff(NewCenters))/mean(diff(OldCenters)));
- GlobalDenom = GlobalDenom + occ_final;
- s_evs = ClusEvents(ClusEvents.SessionID == sid, :);
- if ~isempty(s_evs)
- dists = s_evs.(colName); durs = s_evs.Duration;
- valid = ~isnan(dists) & abs(dists) <= 1.0; dists = dists(valid); durs = durs(valid);
- [~,~,b] = histcounts(dists, NewEdges);
- num = zeros(1, n_spatial_bins); for k_ev=1:length(b), if b(k_ev)>0, num(b(k_ev)) = num(b(k_ev)) + durs(k_ev); end; end
- GlobalNumer = GlobalNumer + num;
- rate = num ./ max(occ_final, 1e-6);
- SessCurve_Abs(s,:) = rate;
- if sum(rate)>0, norm_prof = rate/sum(rate); SessCurve_Norm(s,:) = norm_prof;
- Stats_Near(s,a) = sum(norm_prof(mask_near)); Stats_Far(s,a) = sum(norm_prof(~mask_near));
- else, SessCurve_Norm(s,:) = 0; Stats_Near(s,a)=0; Stats_Far(s,a)=0; end
- else
- SessCurve_Abs(s,:) = 0; SessCurve_Norm(s,:) = 0; Stats_Near(s,a)=0; Stats_Far(s,a)=0;
- end
- end
- P_Abs = GlobalNumer ./ max(GlobalDenom, 1e-6); if sum(P_Abs)>0, P_Norm = P_Abs / sum(P_Abs); else, P_Norm=P_Abs; end
- PooledAbs(:,a)=P_Abs; PooledNorm(:,a)=P_Norm;
- SessAbsMean(:,a)=mean(SessCurve_Abs,1,'omitnan'); SessAbsSEM(:,a)=std(SessCurve_Abs,0,1,'omitnan')./sqrt(sum(~isnan(SessCurve_Abs(:,1))));
- SessNormMean(:,a)=mean(SessCurve_Norm,1,'omitnan'); SessNormSEM(:,a)=std(SessCurve_Norm,0,1,'omitnan')./sqrt(sum(~isnan(SessCurve_Norm(:,1))));
- % SAVE SESSION DATA (RAW & NORM)
- AnchorDataStruct(a).Name = ancName;
- AnchorDataStruct(a).Raw = SessCurve_Abs; % Absolute Rate (Hz)
- AnchorDataStruct(a).Norm = SessCurve_Norm; % Normalized Probability
- end
- % Plotting
- f_comb = figure('Name', sprintf('Cluster %d Spatial', c), 'Color', 'w', 'Position', [50 50 1400 900]);
- FigList(end+1) = struct('h', f_comb, 'name', sprintf('Cluster%d_Spatial_Anchors', c));
- t = tiledlayout(2, 3, 'TileSpacing', 'compact', 'Padding', 'compact');
- sgtitle(sprintf('Cluster %d (%s) - Normalized Stats', c, Filter.Movement));
- nexttile; hold on; for a=1:size(AnchorMap,1), plot(NewCenters, PooledNorm(:,a), '-o', 'Color', AncColors(a,:), 'LineWidth', 2); end; title('Pooled Normalized'); xline(0,'k--');
- nexttile; hold on; for a=1:size(AnchorMap,1), mu=SessNormMean(:,a)'; se=SessNormSEM(:,a)'; fill([NewCenters fliplr(NewCenters)], [mu+se fliplr(mu-se)], AncColors(a,:), 'FaceAlpha', 0.15, 'EdgeColor', 'none'); plot(NewCenters, mu, 'Color', AncColors(a,:), 'LineWidth', 2); end; title('Avg Normalized (+/- SEM)'); xline(0,'k--');
- nexttile; hold on; plot_distribution_scatter(Stats_Near, AncColors, AnchorMap(:,1)); title('Near Anchor Prob'); p_n=perform_stats(Stats_Near); subtitle(sprintf('Friedman p=%.3e',p_n));
- nexttile; hold on; plot_distribution_scatter(Stats_Far, AncColors, AnchorMap(:,1)); title('Far Anchor Prob'); p_f=perform_stats(Stats_Far); subtitle(sprintf('Friedman p=%.3e',p_f));
- PlotData.Spatial.(sprintf('C%d',c)).PooledAbs = PooledAbs; PlotData.Spatial.(sprintf('C%d',c)).PooledNorm = PooledNorm;
- PlotData.Spatial.(sprintf('C%d',c)).StatsNear = Stats_Near; PlotData.Spatial.(sprintf('C%d',c)).StatsFar = Stats_Far;
- PlotData.Spatial.(sprintf('C%d',c)).AnchorData = AnchorDataStruct;
- end
- %% ====================================================================
- %% SECTION 7: EXPORT INDIVIDUAL SESSION CURVES TO EXCEL
- %% ====================================================================
- fprintf('\n--- EXPORTING SESSION CURVES TO EXCEL ---\n');
- xlFile = fullfile(save_dir, 'Session_Spatial_Curves.xlsx');
- if exist(xlFile, 'file'), delete(xlFile); end
- % Get Spatial Axis for Headers
- binHeaders = cell(1, n_spatial_bins);
- for b=1:n_spatial_bins, binHeaders{b} = sprintf('Bin_%d', b); end
- for c = 1:k_clusters
- cName = sprintf('C%d', c);
- if ~isfield(PlotData.Spatial, cName), continue; end
- AData = PlotData.Spatial.(cName).AnchorData;
- % Create Tables for Raw and Norm
- % Format: SessionID | Reward_Bin1... | Reward_Bin10 | Speed_Bin1...
- for a = 1:length(AData)
- ancName = AData(a).Name;
- rawMat = AData(a).Raw;
- normMat = AData(a).Norm;
- % Sanitize Anchor Name for Sheet
- validName = regexprep(ancName, '[^a-zA-Z0-9]', '');
- validName = validName(1:min(10, length(validName))); % Keep short
- % Create Tables
- T_Raw = array2table([uSess, rawMat], 'VariableNames', [{'SessionID'}, binHeaders]);
- T_Norm = array2table([uSess, normMat], 'VariableNames', [{'SessionID'}, binHeaders]);
- % Write Sheets
- sheetRaw = sprintf('%s_%s_Raw', cName, validName);
- sheetNorm = sprintf('%s_%s_Norm', cName, validName);
- writetable(T_Raw, xlFile, 'Sheet', sheetRaw);
- writetable(T_Norm, xlFile, 'Sheet', sheetNorm);
- end
- end
- fprintf('Excel Export Saved: %s\n', xlFile);
- %% ====================================================================
- %% SECTION 8: SAVING FIGURES & MAT FILE
- %% ====================================================================
- fprintf('\n--- SAVING MATLAB DATA ---\n');
- for i = 1:length(FigList)
- if isvalid(FigList(i).h)
- fname = fullfile(save_dir, FigList(i).name);
- saveas(FigList(i).h, [fname '.fig']);
- exportgraphics(FigList(i).h, [fname '.png'], 'Resolution', 300);
- end
- end
- save(fullfile(save_dir, 'Clustering_Results.mat'), 'MasterEvents', 'X', 'X_z', 'VarNames', 'ClusterStats', 'PlotData', 'Filter', 'idx', 'SessionStruct');
- ExportTable = removevars(MasterEvents, {'Trace'});
- writetable(ExportTable, fullfile(save_dir, 'Events_With_Clusters.csv'));
- save(fullfile(save_dir, 'Plot_Data_Curves.mat'), 'PlotData');
- fprintf('Analysis Complete. Results saved in: %s\n', save_dir);
- msgbox(['Analysis done! Saved to: ' save_dir]);
- end
- function p = perform_stats(Mat), valid=~any(isnan(Mat),2); Mat=Mat(valid,:); if sum(valid)>5, p=friedman(Mat,1,'off'); else, p=NaN; end, end
- function plot_distribution_scatter(Mat, Colors, Labels), nGrps=size(Mat,2); boxplot(Mat, 'Labels', Labels, 'Colors', 'k', 'Symbol', ''); hold on; for i=1:nGrps, x=i+(rand(size(Mat,1),1)-0.5)*0.2; scatter(x, Mat(:,i), 25, Colors(i,:), 'filled', 'MarkerFaceAlpha', 0.6); m=nanmedian(Mat(:,i)); plot([i-0.25 i+0.25], [m m], 'k-', 'LineWidth', 2); end, grid on; end
plateau_clustering_analysis_v3_anchors.m, under CC-BY-4.0 · at the source
Overview
- Brandeis University, Department of Biology, Waltham, MA 02453, USA
- These authors contributed equally
- Lead contact
Abstract
The hippocampus is essential for spatial learning, yet how its principal output structure, the subiculum, encodes behaviorally relevant information during navigation remains poorly understood. Because subicular neurons exhibit prominent burst firing, understanding how this bursting arises during behavior is critical. Using in vivo whole-cell recordings from dorsal subiculum neurons in head-fixed mice performing goal-directed navigation, we show that many bursts arise from plateau events. Plateaus were reduced by NMDA receptor blockade, indicating a dependence on synaptic input. Organizing plateaus by membrane potential preceding their onset revealed distinct behavioral associations. Plateaus initiated from hyperpolarized potentials clustered preferentially near reward locations, whereas those initiated from more depolarized potentials were more spatially distributed. Reward-related clustering required a fixed, learned reward location and was dynamically rearranged while learning a new reward location in a familiar environment. Together, these findings identify subicular plateaus as a cellular substrate of hippocampal bursting output, organized by membrane potential state.
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 6 matches between paragraphs and lines of code.
Zenodo 21177036
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
25 files
- UnivariateAnalysis.zip/
AnalyseTableUnivariateAn , MATLAB, 155 lines, 2 matchesalysis.m - UnivariateAnalysis.zip/
CreateTableUnivariateAna , MATLAB, 214 lines, 1 matchlysis.m - extract_all_pooled_plate
au_v3_anchors.m , MATLAB, 454 lines - makePeakSortedSpatialMap
s.m , MATLAB, 117 lines - plateau-spatial-analysis
.zip/ , MATLAB, 556 linesaggregate_across_cells.m - plateau-spatial-analysis
.zip/ , MATLAB, 214 lines, 1 matchanalyzePlateauDistributi ons.m - plateau-spatial-analysis
.zip/ , MATLAB, 57 linesanalyze_anchor_set.m - plateau-spatial-analysis
.zip/ , MATLAB, 65 linescomputeExactAccelEvents. m - plateau-spatial-analysis
.zip/ , MATLAB, 66 linescomputeExactSpeedEvents. m - plateau-spatial-analysis
.zip/ , MATLAB, 53 linescomputeOppositeRewardEve nts.m - plateau-spatial-analysis
.zip/ , MATLAB, 83 linescomputeSimilarAccelEvent s.m - plateau-spatial-analysis
.zip/ , MATLAB, 83 linescomputeSimilarSpeedEvent s.m - plateau-spatial-analysis
.zip/ , MATLAB, 7 linescomputeSpeedCrossingDown Events.m - plateau-spatial-analysis
.zip/ , MATLAB, 7 linescomputeSpeedCrossingUpEv ents.m - plateau-spatial-analysis
.zip/ , MATLAB, 25 linesfilterPlateausBySpeed.m - plateau-spatial-analysis
.zip/ , MATLAB, 63 linesfindCrossingsNearRewards .m - plateau-spatial-analysis
.zip/ , MATLAB, 23 linesfind_speed_crossings.m - plateau-spatial-analysis
.zip/ , MATLAB, 45 linesfind_speed_crossings_dow n.m - plateau-spatial-analysis
.zip/ , MATLAB, 30 linesgetPlateauInfo.m - plateau-spatial-analysis
.zip/ , MATLAB, 13 linesgetWindow.m - plateau-spatial-analysis
.zip/ , MATLAB, 67 linesgroup_reward_locations.m - plateau-spatial-analysis
.zip/ , MATLAB, 77 linesplotSixDistributions.m - plateau-spatial-analysis
.zip/ , MATLAB, 28 linesplotTwoDistributions.m - plateau-spatial-analysis
.zip/ , MATLAB, 191 linesprocessEventsAroundAncho rDistance.m - plateau_clustering_analy
sis_v3_anchors.m , MATLAB, 448 lines, 2 matches
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 25 scripts, each with its path and the digest of its content;
- 6 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 3, 28 September 2026
- Publisher: n/a → Cell Press
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 8 keywords, 7 funders, 68 references, 3 RRIDs.
Cite
This paper
Bhatia, A., Adel, M., & Grienberger, C. (2026). Subicular plateaus signal reward locations during goal-directed behavior. Cell reports, 45(8), 117794. https://
BibTeX
@article{bhatia2026subic
author = {Bhatia, Aanchal and Adel, Mohamed and Grienberger, Christine},
title = {{Subicular plateaus signal reward locations during goal-directed behavior}},
journal = {Cell reports},
year = {2026},
month = aug,
volume = {45},
number = {8},
pages = {117794},
publisher = {Cell Press},
issn = {2211-1247},
doi = {10.1016/
url = {https://
pmid = {42555356},
pmcid = {PMC13586939}
}
RIS
TY - JOUR
AU - Bhatia, Aanchal
AU - Adel, Mohamed
AU - Grienberger, Christine
TI - Subicular plateaus signal reward locations during goal-directed behavior
T2 - Cell reports
J2 - Cell Rep
PY - 2026
DA - 2026/
VL - 45
IS - 8
SP - 117794
SN - 2211-1247
PB - Cell Press
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "Subicular plateaus signal reward locations during goal-directed behavior",
"container-title": "Cell reports",
"author": [
{
"family": "Bhatia",
"given": "Aanchal"
},
{
"family": "Adel",
"given": "Mohamed"
},
{
"family": "Grienberger",
"given": "Christine"
}
],
"container-title-short":
"volume": "45",
"issue": "8",
"page": "117794",
"DOI": "10.1016/
"PMID": "42555356",
"PMCID": "PMC13586939",
"ISSN": "2211-1247",
"publisher": "Cell Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
5
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1002/hipo.70081 [code]
- Spatial Organization of Morpho-Electric Subtypes of Pyramidal Neuron in the Subiculum.Journal: HippocampusIn common: intracellular / patch clamp, 11 references
- [2] doi:10.1016/j.celrep.2026.117388 [code]
- An unsuspected physiological role for mGluRIII glutamate receptors in hippocampal area CA1.Journal: Cell reportsIn common: intracellular / patch clamp, 5 references, author Christine Grienberger
- [3] doi:10.1038/s41586-026-10537-0 [code]
- Sparse-to-dense coding transformation between hippocampal areas CA3 and CA1.Journal: NatureIn common: 8 references
- [4] doi:10.1038/s41467-026-74834-y [code]
- Voltage imaging of CA1 pyramidal cells and SST+ interneurons reveals stability and plasticity mechanisms of spatial firing.Journal: Nature communicationsIn common: intracellular / patch clamp, 8 references
- [5] doi:10.1523/jneurosci.1540-25.2026 [code]
- Dendritic Inhibition Terminates Plateau Potentials in CA1 Pyramidal Neurons.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: 8 references
- [6] doi:10.7554/elife.108352 [code]
- Analysis of dendritic input currents during place field dynamics.Journal: eLifeIn common: 7 references
- [7] doi:10.1016/j.celrep.2026.117793 [code]
- Clustered inputs engage dendritic nonlinearities and calcium signaling to support efficient place-field formation in CA1 pyramidal neurons.Journal: Cell reportsIn common: 7 references
- [8] doi:10.1038/s41467-026-75492-w [code]
- Place and behavioral modulation of hippocampal neurons during immobility.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 4 references
- [9] doi:10.1038/s41467-026-71503-y [code]
- Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 4 references
- [10] doi:10.1126/sciadv.aea1037 [code]
- Distinct cortical spatial representations learned along disparate visual pathways.Journal: Science advancesIn common: Statistics and Machine Learning Toolbox, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 25 scripts, and 6 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:532f98c0b787c0d9…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
