OSCR

Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments.

Code ↔ Paper

19 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 19 matches · 9 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Materials and Methods › Dentate spike analyses. ↔ Plotting and helper functions/getThetaEpochs_per_shank.m, the whole file · a weak match · score 0.93 · maximal theta power, sustained theta, theta epochs, theta detection, cycle lengths, longest
  2. [2] § Materials and Methods › Place cell analyses. ↔ Main functions/place_cell_metrics.m, lines 597–721 · score 0.84 · linear mixed model, Global remapping, Spatial correlation, fitlme, anova, Fisher
  3. [3] § Materials and Methods › Dentate spike analyses. ↔ GENERAL_LAB_CODE/find_lfp_events_in_power_ts.m, the whole file · a weak match · score 0.82 · amplitude envelope, entire LFP, cycle lengths, events detected, wavelet, power
  4. [4] § Materials and Methods › Spike sorting and unit selection. ↔ matlab/+bc/+qm/runAllQualityMetrics.m, lines 1–67 · score 0.76 · refractory period violations, quality metrics, Spike sorting, Bombcell, score, waveform
  5. [5] § Materials and Methods › Data acquisition. ↔ py_bombcell/bombcell/extract_raw_waveforms.py, lines 163–301 · score 0.75 · acquisition board, SpikeGLX, PXIe, streams, NI, neural
  6. [6] § Results › DG place cell responses to social and nonsocial olfactory stimuli ↔ Main functions/place_cell_metrics.m, lines 597–721 · score 0.74 · post hoc, global remapping, Nonsocial Odor, Fox Odor, Spatial correlation, Novel Room
  7. [7] § Materials and Methods › Spike sorting and unit selection. ↔ matlab/+bc/+qm/saveQMetrics.m, the whole file · a weak match · score 0.73 · refractory period violations, quality metrics, noise ratio, Bombcell, score, waveform
  8. [8] § Materials and Methods › Dentate spike analyses. ↔ dentate_spike_detection_classification/evaluate_scoring.m, lines 1–51 · score 0.69 · standard deviation threshold, Dentate spikes, scorers, detection, CSD, scored
  9. [9] § Materials and Methods › Dentate spike analyses. ↔ dentate_spike_detection_classification/dentateSpikeClustering.m, the whole file · a weak match · score 0.68 · CSD depth profiles, dentate spikes, dorsal, sink, clustering, classified
  10. [10] § Materials and Methods › Dentate spike analyses. ↔ dentate_spike_detection_classification/getDS_CSD_per_shank_v4.m, lines 2–45 · score 0.67 · standard deviation threshold, detected dentate spikes, CSD, detection, LFP, channel
  11. [11] § Materials and Methods › Behavior. ↔ Plotting and helper functions/getCircularTimemaps.m, the whole file · a weak match · score 0.65 · Reward Zone, Nonsocial Odor, Stimulus Zone, Fox Odor, Novel Room, circular
  12. [12] § Materials and Methods › Dentate spike analyses. ↔ Plotting and helper functions/getCircularTimemaps.m, the whole file · a weak match · score 0.61 · Reward Zone, Stimulus Zone, position bin, Social Odor, Novel Room, circle
  13. [13] § Results › DS1s were differentially modulated by social stimuli ↔ Main functions/place_cell_metrics.m, lines 723–835 · score 0.57 · post hoc, Nonsocial Odor, Fox Odor, Wald, tailed, fit
  14. [14] § Materials and Methods › Dentate spike analyses. ↔ GENERAL_LAB_CODE/get_ratemap_circtrack.m, the whole file · a weak match · score 0.56 · spikes occur, enforced, firing rate maps, velocity, spent, smoothed
  15. [15] § Materials and Methods › Place cell analyses. ↔ Main functions/place_cell_metrics.m, lines 57–206 · score 0.54 · rate ratio, spatial correlation, rate map, metric, Firing rate, log
  16. [16] § Materials and Methods › Dentate spike analyses. ↔ GENERAL_LAB_CODE/get_2d_ratemap.m, lines 1–37 · score 0.54 · spikes occur, enforced, firing rate maps, velocity, spent, Raw
  17. [17] § Materials and Methods › Behavior. ↔ Main functions/dentate_spike_metrics.m, lines 606–668 · score 0.53 · Reward Zone, Stimulus Zone, Fox Odor, Social Odor, Novel Room, Empty
  18. [18] § Materials and Methods › Place cell analyses. ↔ GENERAL_LAB_CODE/FMAToolbox/General/CircularDistribution.m, the whole file · a weak match · score 0.53 · Gaussian kernel, standard deviation, smoothed, circular, binned
  19. [19] § Materials and Methods › Dentate spike analyses. ↔ GENERAL_LAB_CODE/FMAToolbox/FMAToolbox.m, the whole file · a weak match · score 0.52 · peri event, PETHs, histograms, Firing rate, smoothed, window

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 · 854 lines · 35 KB · no license · 4 matches

  1. function place_cell_metrics(cellStruct, frType)
  2. % Purpose: to compute place cell metrics (spatial correlation, rate
  3. % overlap) from cellStruct, store in table (long) format, plot metrics, and
  4. % run statistics
  5. % - note: the saving functions have been commented out. uncomment them if
  6. % you would like to save tables, figure, and/or stats
  7. %
  8. % Inputs:
  9. % cellStruct - data structure containing the cells from all recordings
  10. % frType - whether to use the mean or peak firing rate for analyses
  11. %
  12. % Outputs:
  13. % Fig. 1 - ratemaps (Fig. 2 from paper)
  14. % Fig. 2 - global remapping (Fig. 3 from paper)
  15. % Fig. 3 - rate remapping (Fig. 4 from paper)
  16. %
  17. % Peyton Demetrovich
  18. % Colgin Lab 4/8/26
  19. %% initialize
  20. comparisons = {'A-B', 'B-B''', 'B''-A''', 'A-B''', 'A-A'''};
  21. spatBinSz = 6;
  22. cellType = {'dentate'};
  23. combos = [1 2;
  24. 2 3;
  25. 3 4;
  26. 1 3;
  27. 1 4];
  28. if strcmp(cellType, 'granule')
  29. minAvgFr = 0.1;
  30. maxAvgFr = 1;
  31. elseif strcmp(cellType, 'mossy')
  32. minAvgFr = 1;
  33. maxAvgFr = 10;
  34. else
  35. minAvgFr = 0.1;
  36. maxAvgFr = 10;
  37. end
  38. % data containers
  39. cellID =[];
  40. ratID = {};
  41. condID = {};
  42. dayID = {};
  43. comboID = {};
  44. uID = [];
  45. rateMaps = [];
  46. spatCorr = [];
  47. rateOverlap = [];
  48. signedLogRatio = [];
  49. fieldChange = [];
  50. fieldProp = [];
  51. frA = [];
  52. frB = [];
  53. uCntr = 0;
  54. %% GET DATA
  55. for r = 1:length(cellStruct.rat)
  56. fprintf('%s\n', cellStruct.rat(r).name)
  57. for c=1:length(cellStruct.rat(r).cond)
  58. if c > length(cellStruct.rat(r).cond)
  59. continue
  60. end
  61. for d = 1:length(cellStruct.rat(r).cond(c).day)
  62. fprintf('\t%s Day %d\n', cellStruct.rat(r).cond(c).name, d)
  63. fprintf('\t\t%s\n', cellStruct.rat(r).cond(c).day(d).name)
  64. dgPCu = false(length(cellStruct.rat(r).cond(c).day(d).smRms_1d_v2),1);
  65. meanFrs = cellfun(@mean, cellStruct.rat(r).cond(c).day(d).smRms_1d_v2);
  66. isPC = cell2mat(cellStruct.rat(r).cond(c).day(d).isPlaceCell);
  67. for u = 1:length(cellStruct.rat(r).cond(c).day(d).smRms_1d_v2)
  68. if (r==2 & c==2 & d== 1 & u==33) | (r==2 & c==6 & d==1 & u==31) | (r==2 & c==1 & d==1 & u==23) | (r==2 & c==1 & d==1 & u==32)% duplicate cells
  69. continue
  70. end
  71. uRateMaps = zeros(4,360/spatBinSz); %for storing rate maps from all begins for this unit
  72. uTimeMaps = zeros(4,360/spatBinSz);
  73. if ismember(cellStruct.rat(r).cond(c).day(d).session(1).uID(u).cellType, {'dentate'}) & ...
  74. any(meanFrs(u,:) >= minAvgFr) & all(meanFrs(u,:) < maxAvgFr) & any(isPC(u,:))
  75. for b = 1:4
  76. uRateMaps(b,:) = cellStruct.rat(r).cond(c).day(d).smRms_1d_v2{u,b}; %get all of the ratemaps for the spat corr comparisons
  77. uTimeMaps(b,:) = cellStruct.rat(r).cond(c).day(d).timePerBin_v2{u,b};
  78. end %begin
  79. dgPCu(u) = true;
  80. uCntr = uCntr +1;
  81. for cb = 1%:size(combos,1)
  82. cellID = [cellID; uCntr];
  83. ratID = [ratID; cellStruct.rat(r).name];
  84. condID = [condID; cellStruct.rat(r).cond(c).name];
  85. dayID = [dayID; cellStruct.rat(r).cond(c).day(d).name];
  86. comboID = [comboID; comparisons{cb}];
  87. uID = [uID; u];
  88. b1 = combos(cb,1); %begins to compare
  89. b2 = combos(cb,2);
  90. rm1 = uRateMaps(b1,:); %ratemaps to compare
  91. rm2 = uRateMaps(b2,:);
  92. pf1 = cellStruct.rat(r).cond(c).day(d).smPfs_1d_v3(u,b1);
  93. pf2 = cellStruct.rat(r).cond(c).day(d).smPfs_1d_v3(u,b2);
  94. rateMaps = [rateMaps; {[rm1; rm2]}];
  95. scMat = corrcoef(rm1,rm2);
  96. spatCorr = [spatCorr; scMat(2)];
  97. fieldRateb1 = getStrongestFieldRate(pf1, frType);
  98. fieldRateb2 = getStrongestFieldRate(pf2, frType);
  99. hasA = ~isnan(fieldRateb1);
  100. hasB = ~isnan(fieldRateb2);
  101. if hasA & hasB % field in both
  102. fieldProp = [fieldProp; 1];
  103. elseif ~hasA & hasB % gained field
  104. fieldProp = [fieldProp; 2];
  105. elseif hasA & ~hasB % lost field
  106. fieldProp = [fieldProp; 3];
  107. elseif ~hasA & ~hasB % field in neither
  108. fieldProp = [fieldProp; 4];
  109. end
  110. % if hasA & hasB
  111. % fieldBoth = 1;
  112. % fieldGain = 0;
  113. % fieldLoss = 0;
  114. % fieldNeither = 0;
  115. % elseif ~hasA & hasB
  116. % fieldBoth = 0;
  117. % fieldGain = 1;
  118. % fieldLoss = 0;
  119. % fieldNeither = 0;
  120. % elseif hasA & ~hasB
  121. % fieldBoth = 0;
  122. % fieldGain = 0;
  123. % fieldLoss = 1;
  124. % fieldNeither = 0;
  125. % elseif ~hasA & ~hasB
  126. % fieldBoth = 0;
  127. % fieldGain = 0;
  128. % fieldLoss = 0;
  129. % fieldNeither = 1;
  130. % end
  131. fc = log(fieldRateb2 / fieldRateb1);
  132. fieldChange = [fieldChange; fc];
  133. if strcmp(frType, 'mean')
  134. fr1 = nanmean(uRateMaps(b1,:));
  135. fr2 = nanmean(uRateMaps(b2,:));
  136. frA= [frA; fr1];
  137. frB= [frB; fr2];
  138. else
  139. fr1 = max(uRateMaps(b1,:));
  140. fr2 = max(uRateMaps(b2,:));
  141. frA= [frA; fr1];
  142. frB= [frB; fr2];
  143. end
  144. ro = min([fr1 fr2]) / max([fr1 fr2]); % Calculate the rate ratio with the lower FR as numerator
  145. rateOverlap = [rateOverlap; ro];
  146. slr = log(fr2/fr1); % signed log ratio
  147. signedLogRatio = [signedLogRatio; slr];
  148. end %combos
  149. end % good unit
  150. end %unit
  151. if strcmp(cellType, 'granule')
  152. cellStruct.rat(r).cond(c).day(d).granU = dgPCu;
  153. elseif strcmp(cellType, 'mossy')
  154. cellStruct.rat(r).cond(c).day(d).mossyU = dgPCu;
  155. else
  156. cellStruct.rat(r).cond(c).day(d).dgPcU = dgPCu;
  157. end
  158. end %day
  159. end % cond
  160. end %rat
  161. % fisher r-to-z transformation for spatial correlation
  162. spatCorr_z = atanh(spatCorr);
  163. % logit transform for rate overlap
  164. % rateOverlap_log = log( (rateOverlap ./ (1 - rateOverlap)) );
  165. % magnitude of log ratio
  166. % logRatioMag = abs(signedLogRatio);
  167. % create table
  168. % table_for_stats = table(cellID, uID, strrep(dayID, '_', '-'), ratID, condID, comboID, rateMaps, spatCorr, spatCorr_z, rateOverlap, rateOverlap_log, ...
  169. % 'VariableNames', {'Cell', 'Unit', 'Day', 'Rat', 'Condition', 'Session', 'RateMaps', 'SpatCorr', 'SpatCorr_norm', 'RateOverlap', 'RateOverlap_logit'});
  170. table_for_stats = table(cellID, uID, strrep(dayID, '_', '-'), ratID, condID, comboID, rateMaps, frA, frB, spatCorr, spatCorr_z, rateOverlap, signedLogRatio, fieldChange, fieldProp, ...
  171. 'VariableNames', {'Cell', 'Unit', 'Day', 'Rat', 'Condition', 'Session', 'RateMaps', 'FiringRateA', 'FiringRateB', 'SpatCorr', 'SpatCorr_norm', 'RateOverlap', 'signedLogRatio', 'infieldChange', 'FieldBehavior'});
  172. save(['remappingTable_' date '.mat'], 'table_for_stats')
  173. %% plot rate maps from table
  174. cols = {[0.0 0.45 0.70] [0.85 0.37 0.01] [0.93 0.69 0.13] [0.0 0.62 0.45] [0.80 0.47 0.74] [0.8203 0.7031 0.5469]};
  175. rats = {'Rat452', 'Rat451', 'Rat501', 'Rat504', 'Rat503'};
  176. conditionNames = {'Empty', 'Social', 'Social Odor', 'Nonsocial Odor', 'Fox Odor', 'Novel Room'};
  177. comparisons = {'A-B'};
  178. conditions = {'Empty' 'Social' 'SocialOdor' 'NonSocialOdor' 'FoxOdor' 'NovelRoom'};
  179. num_conditions = numel(conditions);
  180. figure, theme(gcf, 'light'), clf
  181. pltCntr = 1;
  182. for c=1:num_conditions
  183. % get data from specific condition and session across animals
  184. pullDataInds = strcmp(table_for_stats.Condition, conditions{c}) & strcmp(table_for_stats.Session, comparisons{1});
  185. cond_data = table_for_stats(pullDataInds,:);
  186. tmpRms = cond_data.RateMaps(:);
  187. % extract the rows from each cell
  188. firstRows = cell2mat(cellfun(@(x) x(1,:), tmpRms, 'UniformOutput', false));
  189. secondRows = cell2mat(cellfun(@(x) x(2,:), tmpRms, 'UniformOutput', false));
  190. % concatenate, normalize, then split
  191. catRows = [firstRows secondRows];
  192. catRows_norm = peak_rate_normalize_rows(catRows);
  193. firstRows_norm = catRows_norm(:,1:60);
  194. secondRows_norm = catRows_norm(:,61:120);
  195. % sort by first session
  196. [~, maxInd] = max(firstRows_norm,[],2);
  197. [~,sortInd] = sort(maxInd);
  198. % plot
  199. subplot(3,4,pltCntr)
  200. imagesc(firstRows_norm(sortInd,:))
  201. % title([' A'])
  202. xlabel('Position (bins)')
  203. ylabel({conditionNames{c}; 'Cell ID'})
  204. pltCntr = pltCntr + 1;
  205. subplot(3,4,pltCntr)
  206. imagesc(secondRows_norm(sortInd,:))
  207. xlabel('Position (bins)')
  208. yticks('')
  209. % title([' B'])
  210. if pltCntr == 12
  211. clbr = colorbar;
  212. clbr.Position = [0.91 0.1164 0.0100 0.0907];
  213. clbr.Ticks = [0.1 1];
  214. clbr.TickLabels = {'Min', 'Max'};
  215. ylabel(clbr, 'Firing rate')
  216. end
  217. pltCntr = pltCntr + 1;
  218. end
  219. colormap jet
  220. SetFigureDefaults()
  221. % add zone bars to ratemaps
  222. for i=1:11
  223. h = subplot(3,4,i);
  224. switch i
  225. case {1,2}
  226. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{1}]);
  227. case {3,4}
  228. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{2}]);
  229. case {5,6}
  230. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{3}]);
  231. case {7,8}
  232. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{4}]);
  233. case {9,10}
  234. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{5}]);
  235. case {11}
  236. add_highlight_above_axes(h, [45/6 135/6; 180/6 270/6], 0.005, 0.005, [0 0 0; cols{6}]);
  237. end
  238. end
  239. savefig(gcf,['allCells_' date])
  240. saveas(gcf, ['allCells_' date], 'png')
  241. saveas(gcf, ['allCells_' date], 'epsc')
  242. %% rat-specific marker dotplots
  243. markers = {'o', '>', 'd', 's', '<'};
  244. metric = {'SpatCorr', 'signedLogRatio'};
  245. colorInds = [1,2,3,4,5,6];
  246. % subplot(3,3,1:4)
  247. for m=1:length(metric)
  248. figure, theme(gcf, "light");
  249. for b=1%:length(comparisons)
  250. subplot(3,3,[1 4])
  251. hold on;
  252. % dummy vals for legend
  253. scatter(nan, nan, 'Marker', 'o','MarkerEdgeColor', 'k', 'LineWidth', 1, 'DisplayName', 'Rat 452');
  254. scatter(nan, nan, 'Marker', '>','MarkerEdgeColor', 'k', 'LineWidth', 1, 'DisplayName', 'Rat 451');
  255. scatter(nan, nan, 'Marker', 'd','MarkerEdgeColor', 'k', 'LineWidth', 1, 'DisplayName', 'Rat 501');
  256. scatter(nan, nan, 'Marker', 's','MarkerEdgeColor', 'k', 'LineWidth', 1, 'DisplayName', 'Rat 504');
  257. scatter(nan, nan, 'Marker', '<','MarkerEdgeColor', 'k', 'LineWidth', 1, 'DisplayName', 'Rat 503');
  258. legend('show');
  259. legend('autoupdate', 'off');
  260. legend location southwest
  261. for i = 1:numel(rats)
  262. if m == 1
  263. pullData = strcmp(table_for_stats.Rat, rats{i}) & strcmp(table_for_stats.Session, comparisons{b});
  264. rat_data = table_for_stats(pullData, :);
  265. else
  266. pullData = strcmp(stableTable.Rat, rats{i}) & strcmp(stableTable.Session, comparisons{b});
  267. rat_data = stableTable(pullData, :);
  268. end
  269. for j = 1:num_conditions
  270. cond = conditions{j};
  271. % rat and cond-specific data
  272. cond_data = rat_data(strcmp(rat_data.Condition, cond), :);
  273. if ~isempty(cond_data)
  274. x_jitter = j + 0.3 * (rand(height(cond_data),1) - 0.5); % Add jitter
  275. scttr = scatter(x_jitter, cond_data.(metric{m}), 100, ...
  276. 'Marker', markers{i}, ...
  277. 'MarkerEdgeColor', 'k', ...
  278. 'MarkerFaceColor', cols{colorInds(j)}, ...
  279. 'DisplayName', rats{i}, 'LineWidth', 1);
  280. end
  281. end
  282. end
  283. for i=1:num_conditions
  284. % plot medians for each condition
  285. if m == 1
  286. pullData = strcmp(table_for_stats.Condition, conditions{i}) & strcmp(table_for_stats.Session, comparisons{b});
  287. cond_data = table_for_stats(pullData,:);
  288. else
  289. pullData = strcmp(stableTable.Condition, conditions{i}) & strcmp(stableTable.Session, comparisons{b});
  290. cond_data = stableTable(pullData,:);
  291. end
  292. scatter(i, nanmedian(cond_data.(metric{m})),100, 'Marker', 'x',...
  293. 'MarkerEdgeColor', 'k', 'LineWidth', 2);
  294. if i==1 & m==1
  295. % kmeans thresholding
  296. [~, C] = kmeans(cond_data.(metric{m}), 2, 'Replicates', 50);
  297. sc_thresh = mean(C); % approximate boundary
  298. yline(sc_thresh,'r--');
  299. text(-1,sc_thresh+.075, {'Stability'; 'Threshold'}, 'Color', 'r')
  300. end
  301. end
  302. xlim([-1, num_conditions + 1]);
  303. xticks('');
  304. ylabel(metric{m})
  305. if m==1
  306. ylim([-1 1])
  307. else
  308. ylim([-2 2])
  309. end
  310. end
  311. if m == 1 % create table of stable cells using threshold from empty condition spatial correlations
  312. stableTable = table_for_stats(table_for_stats.SpatCorr > sc_thresh,:);
  313. % unstableTable = table_for_stats(table_for_stats.SpatCorr < sc_thresh,:);
  314. end
  315. end
  316. %% plot firing rates
  317. % figure, clf
  318. % for c=1:length(conditions)
  319. % % pullData = strcmp(table_for_stats.Condition, conditions{c});
  320. % % cond_dataA = table_for_stats.FiringRateA(pullData,:);
  321. % % cond_dataB = table_for_stats.FiringRateB(pullData,:);
  322. % pullData = strcmp(stableTable.Condition, conditions{c});
  323. % cond_dataA = stableTable.FiringRateA(pullData,:);
  324. % cond_dataB = stableTable.FiringRateB(pullData,:);
  325. % subplot(2,3,c)
  326. % scatter(cond_dataA, cond_dataB, 30, 'filled', 'MarkerFaceColor', cols{c})
  327. % hold on
  328. % plot([0 10], [0 10], 'k--')
  329. % xlim([0 10])
  330. % ylim([0 10])
  331. % xlabel('Firing Rate in A')
  332. % ylabel('Firing Rate in B')
  333. % title(conditionNames{c})
  334. % end
  335. % %
  336. % % % loglog scale
  337. % logax = logspace(-2, 2, 10);
  338. % figure, clf
  339. % for c=1:length(conditions)
  340. % pullData = strcmp(table_for_stats.Condition, conditions{c});
  341. % cond_dataA = table_for_stats.FiringRateA(pullData,:);
  342. % cond_dataB = table_for_stats.FiringRateB(pullData,:);
  343. % % pullData = strcmp(stableTable.Condition, conditions{c});
  344. % % cond_dataA = stableTable.FiringRateA(pullData,:);
  345. % % cond_dataB = stableTable.FiringRateB(pullData,:);
  346. % subplot(2,3,c)
  347. % loglog(cond_dataA, cond_dataB, 'o', 'LineStyle', 'none', 'MarkerFaceColor', cols{c}, 'MarkerEdgeColor', 'none');
  348. % hold on
  349. % plot(logax, logax, 'k--')
  350. % xlabel('Firing Rate in A')
  351. % ylabel('Firing Rate in B')
  352. % title(conditionNames{c})
  353. % end
  354. %% field behavior per condition
  355. % figure, theme(gcf, 'light'), clf
  356. % for c=1:length(conditions)
  357. % pullData = strcmp(table_for_stats.Condition, conditions{c});
  358. % cond_dataA = table_for_stats.FieldBehavior(pullData,:);
  359. % % pullData = strcmp(stableTable.Condition, conditions{c});
  360. % % cond_dataA = stableTable.FieldBehavior(pullData,:);
  361. % subplot(2,3,c)
  362. % histogram(cond_dataA, 'FaceColor', cols{c}, 'EdgeColor', cols{c});
  363. % xticks([1:4])
  364. % xticklabels({'Field in Both' 'Gained Field' 'Lost Field' 'Field in Neither'})
  365. % ylabel('# Cells')
  366. % title(conditionNames{c})
  367. % ylim([0 15])
  368. % xlim([0.25 4.75])
  369. % end
  370. %% cumulative probability
  371. tileNum = [2,3,5,6,8];
  372. condCount = length(unique(table_for_stats.Condition));
  373. distTest = 'ks'; % either 'ks' for 2-sample kolmogorov-smirnov or 'ad' for 2-sample anderson-darling
  374. for m = 1:length(metric)
  375. cdfStat = {
  376. 'Comparison', 'test-type', 'stat', 'p' 'p_BF';
  377. 'Empty vs Social', [distTest], nan, nan, nan;
  378. 'Empty vs Social Odor', [distTest], nan, nan, nan;
  379. 'Empty vs Nonsocial Odor', [distTest], nan, nan, nan;
  380. 'Empty vs FoxOdor', [distTest], nan, nan, nan;
  381. 'Empty vs NovelRoom', [distTest], nan, nan, nan;
  382. 'Social Odor vs Fox Odor', [distTest], nan, nan, nan;
  383. 'Social Odor vs Nonsocial Odor', [distTest], nan, nan, nan;
  384. };
  385. for b=1%:size(combos,1)
  386. if m == 1
  387. pullData = strcmp(table_for_stats.Condition, 'Empty') & strcmp(table_for_stats.Session, comparisons{b});
  388. control_data = table_for_stats.(metric{m})(pullData,:);
  389. else
  390. pullData = strcmp(stableTable.Condition, 'Empty') & strcmp(stableTable.Session, comparisons{b});
  391. control_data = stableTable.(metric{m})(pullData,:);
  392. end
  393. control_data(isnan(control_data)) = [];
  394. for c = 2:condCount
  395. if m == 1
  396. pullData = strcmp(table_for_stats.Condition, conditions{c}) & strcmp(table_for_stats.Session, comparisons{b});
  397. cond_data = table_for_stats.(metric{m})(pullData,:);
  398. else
  399. pullData = strcmp(stableTable.Condition, conditions{c}) & strcmp(stableTable.Session, comparisons{b});
  400. cond_data = stableTable.(metric{m})(pullData,:);
  401. end
  402. cond_data(isnan(cond_data)) = [];
  403. if isempty(cond_data)
  404. continue
  405. end
  406. figure(m+1),
  407. subplot(3,3,tileNum(c-1)), cla
  408. [control_f, x, flo, fup] = ecdf(control_data, 'Alpha', 0.05, 'Bounds','on');
  409. stairs(x, control_f, 'Color', cols{1}, 'DisplayName', conditions{1}, 'LineWidth', 2); % CDF
  410. hold on;
  411. plot(x, flo, '--', x, fup, '--', 'Color', cols{1}); % 95% CI
  412. [cond_f, x, flo, fup] = ecdf(cond_data, 'Alpha', 0.05, 'Bounds','on');
  413. stairs(x, cond_f, 'Color', cols{c}, 'DisplayName', conditions{c}, 'LineWidth', 2); % CDF
  414. plot(x, flo, '--', x, fup, '--', 'Color', cols{c}); % 95% CI
  415. switch distTest
  416. case 'ks'
  417. if m == 1 % spatial corr
  418. [~,p,stat] = kstest2(control_data, cond_data,'Tail', 'smaller'); % If the data values in x1 tend to be larger than those in x2, the empirical distribution function of x1 tends to be smaller than that of x2, and vice versa.
  419. else % rate ratios
  420. [~,p,stat] = kstest2(control_data, cond_data);
  421. end
  422. cdfStat{c,3} = stat;
  423. cdfStat{c,4} = p;
  424. cdfStat{c,5} = min(1, p .* (size(cdfStat,1)-1));
  425. if c==6
  426. format shortE
  427. title({ [conditionNames{c} ' vs ' conditionNames{1}]; ['p = ' num2str(p) ', ks2stat = ' num2str(round(stat,3))] })
  428. format default
  429. else
  430. title({ [conditionNames{c} ' vs ' conditionNames{1}]; ['p = ' num2str(round(p,3)) ', ks2stat = ' num2str(round(stat,3))] })
  431. end
  432. case 'ad'
  433. [stat, p] = ad2test(control_data, cond_data);
  434. cdfStat{c,3} = stat;
  435. cdfStat{c,4} = p;
  436. cdfStat{c,5} = min(1, p .* (size(cdfStat,1)-1));
  437. title({ [conditionNames{c} ' vs ' conditionNames{1}]; ['p = ' num2str(round(p,3)) ', ad2stat = ' num2str(round(stat,3))] })
  438. end
  439. ylabel('Cumulative Probabilty')
  440. xlabel(metric{m})
  441. if m==1
  442. xlim([-1 1])
  443. else
  444. xlim([-2 2])
  445. end
  446. axis square
  447. box off
  448. yticks([0 0.5 1])
  449. if c == 3
  450. if m == 1
  451. pullData = strcmp(table_for_stats.Condition, 'SocialOdor') & strcmp(table_for_stats.Session, comparisons{b});
  452. so_data = table_for_stats.(metric{m})(pullData,:);
  453. pullData = strcmp(table_for_stats.Condition, 'NonSocialOdor') & strcmp(table_for_stats.Session, comparisons{b});
  454. nso_data = table_for_stats.(metric{m})(pullData,:);
  455. pullData = strcmp(table_for_stats.Condition, 'FoxOdor') & strcmp(table_for_stats.Session, comparisons{b});
  456. fo_data = table_for_stats.(metric{m})(pullData,:);
  457. else
  458. pullData = strcmp(stableTable.Condition, 'SocialOdor') & strcmp(stableTable.Session, comparisons{b});
  459. so_data = stableTable.(metric{m})(pullData,:);
  460. pullData = strcmp(stableTable.Condition, 'NonSocialOdor') & strcmp(stableTable.Session, comparisons{b});
  461. nso_data = stableTable.(metric{m})(pullData,:);
  462. pullData = strcmp(stableTable.Condition, 'FoxOdor') & strcmp(stableTable.Session, comparisons{b});
  463. fo_data = stableTable.(metric{m})(pullData,:);
  464. end
  465. so_data(isnan(so_data)) = [];
  466. nso_data(isnan(nso_data)) = [];
  467. fo_data(isnan(fo_data)) = [];
  468. subplot(3,3,9), cla
  469. [so_f, x, flo, fup] = ecdf(so_data, 'Alpha', 0.05, 'Bounds','on');
  470. stairs(x, so_f, 'Color', cols{3}, 'DisplayName', conditions{3}, 'LineWidth', 2); % CDF
  471. hold on;
  472. plot(x, flo, '--', x, fup, '--', 'Color', cols{3}); % 95% CI
  473. [nso_f, x, flo, fup] = ecdf(nso_data, 'Alpha', 0.05, 'Bounds','on');
  474. stairs(x, nso_f, 'Color', cols{4}, 'DisplayName', conditions{4}, 'LineWidth', 2); % CDF
  475. plot(x, flo, '--', x, fup, '--', 'Color', cols{4}); % 95% CI
  476. [fo_f, x, flo, fup] = ecdf(fo_data, 'Alpha', 0.05, 'Bounds','on');
  477. stairs(x, fo_f, 'Color', cols{5}, 'DisplayName', conditions{5}, 'LineWidth', 2); % CDF
  478. plot(x, flo, '--', x, fup, '--', 'Color', cols{5}); % 95% CI
  479. switch distTest
  480. case 'ks'
  481. [~,p1,stat1] = kstest2(so_data, nso_data);
  482. cdfStat{8,3} = stat1;
  483. cdfStat{8,4} = p1;
  484. cdfStat{8,5} = min(1, p1 .* (size(cdfStat,1)-1));
  485. [~,p2,stat2] = kstest2(so_data, fo_data);
  486. cdfStat{7,3} = stat2;
  487. cdfStat{7,4} = p2;
  488. cdfStat{7,5} = min(1, p2 .* (size(cdfStat,1)-1));
  489. title({ ['SO vs NSO: p = ' num2str(round(p1,3)) ', ks2stat = ' num2str(round(stat1,3))]; ['SO vs FO: p = ' num2str(round(p2,3)) ', ks2stat = ' num2str(round(stat2,3))] })
  490. case 'ad'
  491. [stat1, p1] = ad2test(so_data, nso_data);
  492. cdfStat{8,3} = stat1;
  493. cdfStat{8,4} = p1;
  494. cdfStat{8,5} = min(1, p1 .* (size(cdfStat,1)-1));
  495. [stat2, p2] = ad2test(nso_data, fo_data);
  496. cdfStat{7,3} = stat2;
  497. cdfStat{7,4} = p2;
  498. cdfStat{7,5} = min(1, p2 .* (size(cdfStat,1)-1));
  499. title({ ['SO vs NSO: p = ' num2str(round(p1,3)) ', ad2stat = ' num2str(round(stat1,3))]; ['SO vs FO: p = ' num2str(round(p2,3)) ', ad2stat = ' num2str(round(stat2,3))] })
  500. end
  501. axis square
  502. box off
  503. ylabel('Cumulative Probabilty')
  504. xlabel(metric{m})
  505. if m==1
  506. xlim([-1 1])
  507. else
  508. xlim([-2 2])
  509. end
  510. yticks([0 0.5 1])
  511. end
  512. end
  513. end
  514. disp(cdfStat)
  515. % writecell(cdfStat, [metric{m} '_cdfStats_' date '.csv']);
  516. end
  517. %% Linear mixed model statistics
  518. table_for_stats.Cell = categorical(table_for_stats.Cell);
  519. table_for_stats.Rat = categorical(table_for_stats.Rat);
  520. table_for_stats.Rat = reordercats(table_for_stats.Rat, {'Rat452', 'Rat451', 'Rat501', 'Rat504', 'Rat503'});
  521. table_for_stats.Condition = categorical(table_for_stats.Condition);
  522. table_for_stats.Condition = reordercats(table_for_stats.Condition, {'Empty', 'Social', 'SocialOdor', 'NonSocialOdor', 'FoxOdor', 'NovelRoom'});
  523. table_for_stats.Session = categorical(table_for_stats.Session);
  524. % fit model
  525. lme = fitlme(table_for_stats, ...
  526. 'SpatCorr_norm ~ Condition + (1|Rat)', 'Verbose', 1, 'DummyVarCoding', 'reference');
  527. % test for overall effect of condition
  528. anv = anova(lme)
  529. save(['global_remapping_lme_' date '.mat'], 'lme', 'anv')
  530. % get estimated marginal means
  531. % Define categories
  532. conditions = categories(table_for_stats.Condition);
  533. n = numel(conditions);
  534. dummyRat = repmat(table_for_stats.Rat(1), n, 1);
  535. % dummyCell = repmat(stableTable.Cell(1), n, 1);
  536. newTbl = table(categorical(conditions), categorical(dummyRat), ...
  537. 'VariableNames', {'Condition','Rat'});
  538. [yhat, yCI] = predict(lme, newTbl, 'Conditional', false);
  539. % conditions = unique(table_for_stats.Condition);
  540. % sessions = unique(table_for_stats.Session); % unnecessary when no main effect of session
  541. %
  542. % % Create grid of all combinations
  543. % [C, S] = ndgrid(conditions, sessions);
  544. %
  545. % % Create dummy values for Rat and Cell
  546. % n = numel(C);
  547. % dummyRat = repmat("DummyRat", n, 1);
  548. % dummyCell = repmat("DummyCell", n, 1);
  549. %
  550. % % Build table
  551. % newTbl = table(C(:), S(:), categorical(dummyRat), categorical(dummyCell), ...
  552. % 'VariableNames', {'Condition', 'Session', 'Rat', 'Cell'});
  553. %
  554. % % plot
  555. % [yhat, yCI] = predict(lme, newTbl, 'Conditional', false);
  556. figure(2), subplot(3,3,7), cla, hold on
  557. for c=1:length(yhat)
  558. plot([c,c],[yCI(c,1), yCI(c,2)], 'Color', cols{c}, 'LineWidth', 2)
  559. plot(c, yhat(c), 'ko')
  560. end
  561. xticks([1:length(conditions)])
  562. xticklabels(conditionNames)
  563. xtickangle(45)
  564. xlim([-1 7])
  565. ylabel({'Spatial Correlation'; '(Fisher''s r-to-z)'})
  566. % if significant main effect of condition, run post-hoc planned comparisons
  567. if anv.pValue(end) < 0.05
  568. statPlan = {
  569. 'Comparison', 'test-type', 'contrastLabel', 'Fstat', 'pTwo', 'df1','df2', 'Tstat', 'pNew', 'pNew_BF';
  570. 'Empty vs Social', 'one-tailed', [0 1 0 0 0 0], nan, nan,nan, nan, nan,nan,nan;
  571. 'Empty vs Social Odor', 'one-tailed', [0 0 1 0 0 0], nan, nan, nan, nan, nan,nan,nan;
  572. 'Empty vs Nonsocial Odor', 'one-tailed', [0 0 0 1 0 0], nan, nan, nan, nan, nan,nan,nan;
  573. 'Empty vs FoxOdor', 'one-tailed', [0 0 0 0 1 0], nan, nan, nan, nan, nan, nan,nan;
  574. 'Empty vs NovelRoom', 'one-tailed', [0 0 0 0 0 1], nan, nan, nan, nan, nan, nan,nan;
  575. 'Social Odor vs Fox Odor', 'two-tailed', [0 0 1 0 -1 0], nan, nan, nan, nan, nan, nan,nan;
  576. 'Social Odor vs Nonsocial Odor','two-tailed', [0 0 1 -1 0 0], nan, nan, nan, nan ,nan, nan,nan;
  577. };
  578. beta = fixedEffects(lme); % p-by-1
  579. V = lme.CoefficientCovariance; % p-by-p
  580. xpos = [1,2;
  581. 1,3;
  582. 1,4;
  583. 1,5;
  584. 1,6;
  585. 3,5;
  586. 3,4;
  587. ];
  588. % convert F to a signed t using the contrast estimate's direction, then use the t CDF for a "less-than" test.
  589. for i=2:size(statPlan,1)
  590. % H: 1-by-p contrast row (e.g., [0 1 -1 0 ...])
  591. H = statPlan{i,3}; % adjust to your coefficient order
  592. % Wald F-test
  593. [pTwo, Fstat, df1, df2] = coefTest(lme, H);
  594. % Get the contrast estimate and its SE
  595. theta = H * beta; % contrast estimate (β_level - β_ref)
  596. se = sqrt(H * V * H.'); % standard error of the contrast
  597. % Convert to signed t-statistic (df1 must be 1)
  598. if df1 == 1
  599. tStat = theta / se;
  600. % One-tailed p-value for "lower than reference"
  601. if ismember(statPlan{i,2}, {'one-tailed'})
  602. pNew = tcdf(tStat, df2); % uses left tail; small pOne supports θ < 0
  603. else
  604. pNew = 2 * min(tcdf(tStat, df2), 1 - tcdf(tStat, df2)); % two-tailed from t
  605. end
  606. pNew_bf = min(1, pNew .* (size(statPlan,1)-1));
  607. % store values
  608. statPlan{i,4} = Fstat;
  609. statPlan{i,5} = pTwo;
  610. statPlan{i,6} = df1;
  611. statPlan{i,7} = df2;
  612. statPlan{i,8} = tStat;
  613. statPlan{i,9} = pNew;
  614. statPlan{i,10} = pNew_bf;
  615. if statPlan{i,10} < 0.05
  616. sigstar(xpos(i-1,:), statPlan{i,10})
  617. end
  618. end
  619. end
  620. disp(statPlan)
  621. writecell(statPlan, ['spatCorr_stats_' date '.csv']);
  622. end
  623. SetFigureDefaults()
  624. savefig(gcf,['spatCorr_plots_' date])
  625. saveas(gcf, ['spatCorr_plots_' date], 'png')
  626. saveas(gcf, ['spatCorr_plots_' date], 'epsc')
  627. %% for stable cell metrics
  628. stableTable.Cell = categorical(stableTable.Cell);
  629. stableTable.Rat = categorical(stableTable.Rat);
  630. stableTable.Rat = reordercats(stableTable.Rat, {'Rat452', 'Rat451', 'Rat501', 'Rat504', 'Rat503'});
  631. stableTable.Condition = categorical(stableTable.Condition);
  632. stableTable.Condition = reordercats(stableTable.Condition, {'Empty', 'Social', 'SocialOdor', 'NonSocialOdor', 'FoxOdor'});
  633. stableTable.Session = categorical(stableTable.Session);
  634. % fit model
  635. % lme = fitlme(stableTable, ...
  636. % 'RateOverlap_logit ~ Condition + (1|Rat)', 'Verbose', 1, 'DummyVarCoding', 'reference');
  637. lme = fitlme(stableTable, ...
  638. 'signedLogRatio ~ Condition + (1|Rat)', 'Verbose', 1, 'DummyVarCoding', 'reference');
  639. % test for overall effect of condition
  640. anv = anova(lme)
  641. save(['rate_remapping_lme_' date '.mat'], 'lme', 'anv')
  642. % get estimated marginal means
  643. % Define categories
  644. conditions = categories(stableTable.Condition);
  645. n = numel(conditions);
  646. dummyRat = repmat(stableTable.Rat(1), n, 1);
  647. % dummyCell = repmat(stableTable.Cell(1), n, 1); % use only if random
  648. % effect of cell
  649. newTbl = table(categorical(conditions), categorical(dummyRat), ...
  650. 'VariableNames', {'Condition','Rat'});
  651. [yhat, yCI] = predict(lme, newTbl, 'Conditional', false);
  652. figure(3), subplot(3,3,7), cla, hold on
  653. for c=1:length(yhat)
  654. plot([c,c],[yCI(c,1), yCI(c,2)], 'Color', cols{c}, 'LineWidth', 2)
  655. plot(c, yhat(c), 'ko')
  656. end
  657. xticks([1:length(conditions)])
  658. xticklabels(conditionNames)
  659. xtickangle(45)
  660. xlim([-1 7])
  661. ylabel('Signed Log FR Ratio')
  662. ylim([-1 1])
  663. % if significant main effect of condition, run post-hoc planned comparisons
  664. if anv.pValue(end) < 0.05
  665. statPlan = {
  666. 'Comparison', 'test-type', 'contrastLabel', 'Fstat', 'pTwo', 'df1','df2', 'Tstat', 'pNew', 'pNew_corrected';
  667. 'Empty vs Social', 'two-tailed', [0 1 0 0 0], nan, nan,nan, nan, nan,nan,nan;
  668. 'Empty vs Social Odor', 'two-tailed', [0 0 1 0 0], nan, nan, nan, nan, nan,nan,nan;
  669. 'Empty vs Nonsocial Odor', 'two-tailed', [0 0 0 1 0], nan, nan, nan, nan, nan,nan,nan;
  670. 'Empty vs FoxOdor', 'two-tailed', [0 0 0 0 1], nan, nan, nan, nan, nan, nan,nan;
  671. 'Social Odor vs Fox Odor', 'two-tailed', [0 0 1 0 -1], nan, nan, nan, nan, nan, nan,nan;
  672. 'Social Odor vs Nonsocial Odor','two-tailed', [0 0 1 -1 0], nan, nan, nan, nan ,nan, nan,nan;
  673. };
  674. beta = fixedEffects(lme); % p-by-1
  675. V = lme.CoefficientCovariance; % p-by-p
  676. xpos = [1,2;
  677. 1,3;
  678. 1,4;
  679. 1,5;
  680. 1,6;
  681. 3,5;
  682. 3,4;
  683. ];
  684. % convert F to a signed t using the contrast estimate's direction, then use the t CDF for a "less-than" test.
  685. for i=2:size(statPlan,1)
  686. % H: 1-by-p contrast row (e.g., [0 1 -1 0 ...])
  687. H = statPlan{i,3}; % adjust to your coefficient order
  688. % Wald F-test
  689. [pTwo, Fstat, df1, df2] = coefTest(lme, H);
  690. % Get the contrast estimate and its SE
  691. theta = H * beta; % contrast estimate (β_level - β_ref)
  692. se = sqrt(H * V * H.'); % standard error of the contrast
  693. % Convert to signed t-statistic (df1 must be 1)
  694. if df1 == 1
  695. tStat = theta / se;
  696. % One-tailed p-value for "lower than reference"
  697. if ismember(statPlan{i,2}, {'one-tailed'})
  698. pNew = tcdf(tStat, df2); % uses left tail; small pOne supports θ < 0
  699. else
  700. pNew = 2 * min(tcdf(tStat, df2), 1 - tcdf(tStat, df2)); % two-tailed from t
  701. end
  702. pNew_bf = min(1, pNew .* (size(statPlan,1)-1));
  703. % store values
  704. statPlan{i,4} = Fstat;
  705. statPlan{i,5} = pTwo;
  706. statPlan{i,6} = df1;
  707. statPlan{i,7} = df2;
  708. statPlan{i,8} = tStat;
  709. statPlan{i,9} = pNew;
  710. statPlan{i,10} = pNew_bf;
  711. if statPlan{i,10} < 0.05
  712. sigstar(xpos(i-1,:), statPlan{i,10})
  713. end
  714. end
  715. end
  716. disp(statPlan)
  717. writecell(statPlan, ['rate_stats_' date '.csv']);
  718. end
  719. SetFigureDefaults()
  720. savefig(gcf,['rate_plots_' date])
  721. saveas(gcf, ['rate_plots_' date], 'png')
  722. saveas(gcf, ['rate_plots_' date], 'epsc')
  723. end
  724. function rates = getStrongestFieldRate(placeFields, mode)
  725. % mode = 'peak' or 'mean'
  726. numCells = numel(placeFields);
  727. rates = nan(numCells,1);
  728. for n = 1:numCells
  729. if isempty(placeFields{n}), continue; end
  730. % find strongest field
  731. [~, idx] = max([placeFields{n}.peakRate]);
  732. if strcmp(mode, 'peak')
  733. rates(n) = placeFields{n}(idx).peakRate;
  734. else
  735. rates(n) = placeFields{n}(idx).meanRate;
  736. end
  737. end
  738. end

place_cell_metrics.m at commit fd5d50d, no license · at the source

Overview

Authors: Peyton G Demetrovich1,2, Laura Lee Colgin1,2,3
ORCID iDs: Laura Lee Colgin
  1. Interdisciplinary Neuroscience Program, The University of Texas at Austin, Austin, Texas 78712
  2. Center for Learning and Memory, The University of Texas at Austin, Austin, Texas 78712
  3. Department of Neuroscience, The University of Texas at Austin, Austin, Texas 78712
Institutions: The University of Texas at Austin (United States)
Dates: published online 12 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1523/jneurosci.2001-25.2026 · PMID 42469025 · PMCID PMC13470782 · OpenAlex W7169518659
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: extracellular electrophysiology (units, LFP) (modality), rat (organism), systems (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions, Machine learning, Spectral & time-frequency, Preprocessing, Connectivity, Single-unit activity, calcium imaging
Keywords: dentate gyrus, dentate spikes, hippocampus, place cells, social behaviors, spatial memory
MeSH: Action Potentials*, Dentate Gyrus*, Environment*, Neurons*, Place Cells*, Space Perception*, Animals, Female, Local Field Potential Measurement, Male, Odorants, Rats, Rats, Long-Evans (* major topic)
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: NIMH NIH HHS (R01 MH131317); HHS | National Institutes of Health (R01MH131317); The University of Texas at Austin Graduate Continuing Fellowship
Citations: not cited yet (Europe PMC); 69 references in the paper

Abstract

The dentate gyrus (DG) is thought to play a key role in the formation of dissociable memory representations for similar contexts. Neurons in the DG receive highly processed spatial and nonspatial sensory information from the medial and lateral entorhinal cortices, respectively. Changes in spatially tuned firing patterns of DG place cells occur after spatial changes to an environment, but the degree to which DG place cells respond to ethologically relevant nonspatial stimuli is largely unknown. Spatial and nonspatial information is thought to be transmitted to the DG during discrete local field potential events called dentate spikes. Here, we tested the extent to which different spatial and nonspatial stimuli modulate place cell firing patterns and dentate spike dynamics. We performed extracellular recordings of DG place cells and local field potentials in rats of both sexes exploring a familiar spatial environment, in which social stimuli and nonsocial odors of varying ethological relevance were presented, and a novel spatial environment. As expected, DG place cells exhibited different firing patterns between familiar and novel environments. Significant changes in firing were not observed, however, with any of the nonspatial stimuli. Surprisingly, the occurrence of dentate spikes associated with lateral entorhinal cortex input increased during exploration of ethologically relevant stimuli, and this increase was greater for social stimuli. Altogether, these results suggest that the DG preferentially responds to social stimuli at the network level, providing novel insights into how spatial and nonspatial information is processed in the DG.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 19 matches between paragraphs and lines of code.

Julie-Fabre/bombcell

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 2952cd5e16796635a4dfa61d7e286a4b46014521, 7 September 2026
Languages: MATLAB (80), Python (20), Jupyter (5), C (1)
Size: 173 files, 106 scripts
Software Heritage: not archived
Found in: the text, “Spike sorting and unit selection.”
Holds: README, license file, environment (py_bombcell/pyproject.toml, py_bombcell/requirements.txt), documentation, 6 notebooks
Not found: CITATION.cff, tests, continuous integration
Tools: NumPy (20 files), pandas (12 files), Matplotlib (11 files), Statistics and Machine Learning Toolbox (10 files), SciPy (6 files), Phy (4 files), Optimization Toolbox (2 files), Curve Fitting Toolbox (1 file), Signal Processing Toolbox (1 file), Numba (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
108 files

ColginLab/Demetrovich_Colgin_2026

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: fd5d50da76e2a64120562cc05203e824efde81bf, 29 April 2026
Languages: MATLAB (21)
Size: 22 files, 21 scripts
Software Heritage: not archived
Found in: “Statistics, data, and code availability.”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
22 files

ColginLab/ColginLabCode

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 3ceac6adfd22e6f47266eb65e7df044623e9bfa3, 19 May 2020
Languages: MATLAB (1347), C (14), C/C++ (11)
Size: 1,892 files, 1,372 scripts
Software Heritage: not archived
Found in: “Statistics, data, and code availability.”
Holds: README, tests, documentation
Not found: license file, CITATION.cff, environment file, continuous integration
Tools: Statistics and Machine Learning Toolbox (91 files), Chronux (72 files), CircStat (44 files), Signal Processing Toolbox (29 files), Image Processing Toolbox (9 files), EEGLAB (1 file), export_fig (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
1,373 files

The paper's code and data availability statement is in the Data section.

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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1,499 scripts, each with its path and the digest of its content;
  • 19 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.

Statistics, data, and code availability

GLMMs or LMMs and two-sample Kolmogorov–Smirnov tests were used to analyze results, as described above for each measure. Statistical tests on each (G)LMM were computed as Wald F tests or converted t tests, as reported. Converted t tests were necessary for one-tailed tests that were used when effects in a specific direction were hypothesized a priori. Post hoc comparisons were computed only when a significant main effect [for (G)LMMs with one fixed effect] or interaction effect [for (G) LMMs with two or more fixed effects] was observed. All reported p values were Bonferroni corrected unless otherwise stated. All data and statistical analyses were performed using MATLAB scripts, which are hosted at https://github.com/ColginLab/Demetrovich_Colgin_2026. Scripts were written using custom, built-in, and/or toolbox-specific functions. Certain custom functions were used from our lab’s code base (https://github.com/ColginLab/ColginLabCode). Data used in this study are available at https://web.corral.tacc.utexas.edu/ColginLab/Demetrovich_Colgin_JNeurosci_2026/.

Reproduced under the paper's license (CC BY), from the paper cited above.

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 → Society for Neuroscience

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 6 keywords, 13 MeSH terms, 3 funders, 65 references.

Cite

This paper

Demetrovich, P. G., & Colgin, L. L. (2026). Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments. The Journal of neuroscience : the official journal of the Society for Neuroscience, 46(32), e2001252026. https://doi.org/10.1523/jneurosci.2001-25.2026

BibTeX

@article{demetrovich2026dynamics,
author = {Demetrovich, Peyton G and Colgin, Laura Lee},
title = {{Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments}},
journal = {The Journal of neuroscience : the official journal of the Society for Neuroscience},
year = {2026},
month = aug,
volume = {46},
number = {32},
pages = {e2001252026},
publisher = {Society for Neuroscience},
issn = {0270-6474},
doi = {10.1523/jneurosci.2001-25.2026},
url = {https://doi.org/10.1523/jneurosci.2001-25.2026},
pmid = {42469025},
pmcid = {PMC13470782}
}

RIS

TY - JOUR
AU - Demetrovich, Peyton G
AU - Colgin, Laura Lee
TI - Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments
T2 - The Journal of neuroscience : the official journal of the Society for Neuroscience
J2 - J Neurosci
PY - 2026
DA - 2026/08/12
VL - 46
IS - 32
SP - e2001252026
SN - 0270-6474
PB - Society for Neuroscience
DO - 10.1523/jneurosci.2001-25.2026
UR - https://doi.org/10.1523/jneurosci.2001-25.2026
LA - en
ER -

CSL-JSON

{
"id": "10.1523/jneurosci.2001-25.2026",
"type": "article-journal",
"title": "Dynamics of Dentate Gyrus Place Cells and Dentate Spikes during Spatial and Nonspatial Changes in Environments",
"container-title": "The Journal of neuroscience : the official journal of the Society for Neuroscience",
"author": [
{
"family": "Demetrovich",
"given": "Peyton G"
},
{
"family": "Colgin",
"given": "Laura Lee"
}
],
"container-title-short": "J Neurosci",
"volume": "46",
"issue": "32",
"page": "e2001252026",
"DOI": "10.1523/jneurosci.2001-25.2026",
"PMID": "42469025",
"PMCID": "PMC13470782",
"ISSN": "0270-6474",
"publisher": "Society for Neuroscience",
"URL": "https://doi.org/10.1523/jneurosci.2001-25.2026",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
12
]
]
}
}

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.1016/j.neuron.2026.03.034 [code]
Dentate gyrus interneurons modulate winner-take-all network dynamics in freely behaving mice.
Journal: Neuron
In common: Chronux, CircStat, Curve Fitting Toolbox, 9 other tools, systems, 11 references
[2] doi:10.1038/s41467-026-75347-4 [code]
Sleep reveals dynamics integrating and segregating movement and stimulus representations in V1.
Journal: Nature communications
In common: Phy, Chronux, export_fig, 12 other tools, systems, 1 reference
[3] doi:10.1016/j.celrep.2026.117646 [code]
Medial entorhinal-hippocampal desynchronization parallels the emergence of memory impairment in a mouse model of Alzheimer's disease pathology.
Journal: Cell reports
In common: Chronux, export_fig, CircStat, 10 other tools, systems, 4 references
[4] doi:10.1038/s41593-026-02357-2 [code]
Experience reorganizes content-specific memory traces in macaques.
Journal: Nature neuroscience
In common: Phy, Chronux, export_fig, 11 other tools, 1 reference
[5] doi:10.1038/s41467-026-73106-z [code]
Respiratory pauses highlight sleep architecture in mice.
Journal: Nature communications
In common: Chronux, export_fig, CircStat, 9 other tools, extracellular electrophysiology (units, LFP), 1 reference
[6] doi:10.1016/j.patter.2026.101590 [code]
Density-based longitudinal neuron tracking in high-density electrophysiological recordings.
Journal: Patterns (New York, N.Y.)
In common: Phy, CircStat, Optimization Toolbox, 6 other tools, extracellular electrophysiology (units, LFP), 5 references
[7] doi:10.1038/s41593-026-02232-0 [code]
Entorhinal cortex represents task-relevant remote locations independently of CA1.
Journal: Nature neuroscience
In common: Phy, CircStat, Optimization Toolbox, 8 other tools, systems, 3 references
[8] doi:10.1126/sciadv.aea1037 [code]
Distinct cortical spatial representations learned along disparate visual pathways.
Journal: Science advances
In common: Chronux, CircStat, Curve Fitting Toolbox, 8 other tools, systems, 2 references
[9] doi:10.1038/s41467-026-72620-4 [code]
Grid maps are disrupted after large-scale arena expansion and recover with experience.
Journal: Nature communications
In common: Chronux, export_fig, CircStat, 5 other tools, extracellular electrophysiology (units, LFP), systems
[10] doi:10.64898/2026.03.12.710517 [code]
Cortical excitability inversely modulates fMRI connectivity via low-frequency neuronal coupling
Journal: bioRxiv (preprint)
In common: Chronux, CircStat, Optimization Toolbox, 8 other tools, systems

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.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

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.