OSCR

Grid maps are disrupted after large-scale arena expansion and recover with experience.

Code ↔ Paper

8 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 8 matches · 5 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › Analysis of single-unit spiking activity › Grid score ↔ +CMBHOME/@Session/Gridness.m, lines 1–60 · score 0.83 · inner circle, minor axis, major axis, rate map autocorrelogram, eccentricity, gridness
  2. [2] § Methods › Analysis of single-unit spiking activity › Grid score ↔ other/systemIndependent/GridnessScoreExternal/gridnessScoreCBM10_3.m, lines 9–145 · score 0.74 · outer radius, inner circle, classified, fewer, gridness, rate map
  3. [3] § Methods › Analysis of single-unit spiking activity › Grid score ↔ +CMBHOME/@Session/b_thetaIndex.m, the whole file · a weak match · score 0.69 · fast Fourier transform, power spectrum, autocorrelogram, peaks, spike
  4. [4] § Methods › Analysis of single-unit spiking activity › Spatial firing rate maps ↔ +CMBHOME/+PASS_INDEX/rate_map.m, the whole file · a weak match · score 0.66 · occupancy normalized, Gaussian kernel, firing rate maps, spent, smoothed, dimensional
  5. [5] § Methods › Analysis of single-unit spiking activity › Spatial firing rate maps ↔ +CMBHOME/+PASS_INDEX/pass_index.m, lines 1–128 · score 0.65 · occupancy normalized, Gaussian kernel, firing rate maps, smoothed, dimensional, animal
  6. [6] § Methods › Analysis of single-unit spiking activity › Spatial information ↔ +CMBHOME/@Session/SpatialInformation.m, the whole file · a weak match · score 0.55 · spatial information scores, Gaussian kernel, occupancy, bits, Rate maps, smoothed
  7. [7] § Methods › Analysis of single-unit spiking activity › Spatial information ↔ +CMBHOME/@Session/MyvarInformation.m, the whole file · a weak match · score 0.55 · spatial information scores, Gaussian kernel, occupancy, bits, Rate maps, smoothed
  8. [8] § Results › The formation of grid maps in large-scale expanded environments depends on experience ↔ +CMBHOME/@Session/plot_velocityrate.m, the whole file · a weak match · score 0.53 · linear regression, correlation coefficient, firing rates, cells

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 · 631 lines · 19 KB · no license · 1 match

  1. function [gridness, props] = Gridness(self, cel, varargin)
  2. % Calculates the original gridness score of 'cel'. Continuizes all epochs.
  3. %
  4. % ARGUMENTS
  5. %
  6. % cel 1x2 vector indicating tetrode index and cell index
  7. %
  8. % RETURNS
  9. %
  10. % gridness a number indicating gridness score
  11. % props struct of grid cell properties (see below)
  12. %
  13. % GRID CELL PROPERTY STRUCT FIELDS:
  14. %
  15. % periodicity(n, 2) vector of the autocorrelogram correlation as a function of
  16. % rotation (see ALGORITHM below)
  17. %
  18. % rate_map ratemap used in analysis
  19. %
  20. %
  21. % auto_corr matrix of the rate map autocorrelogram with donut cut
  22. % out of it. There is a second matrix along the third
  23. % dimension indicating where cuts were made. This can be
  24. % used in the AlphaData property of an image plot
  25. %
  26. % auto_corr_mask binary matrix where 1 indicates values used in analysis
  27. % (donut)
  28. %
  29. % eccentricity eccentricity of ellipse created by first six peaks in
  30. % auto_corr around center
  31. %
  32. % e_angle angle of rotation of major axis of ellipse (useful when
  33. % setting correction)
  34. %
  35. % e_skew ratio of major:minor axis of ellipse. This is the
  36. % scaling along the major axis when performing correction
  37. % with grid3.
  38. %
  39. % r_out radius of outer circle (pixels)
  40. %
  41. % r_in radius of inner circle (pixels)
  42. %
  43. % spacing field spacing in pixels
  44. %
  45. % OPTIONAL PARAMETERS
  46. %
  47. % xdim vector of bin edges along x dimension
  48. % ydim vector of bin edges along y dimension
  49. % supress_plot 0 or 1 (1). If 0, plots autocorrelation, the cut
  50. % donut, and the periodicity of the donut
  51. % std_smooth_kernel STD of the gaussian kernel to smooth the rate map
  52. % binside The length in cm of the side of a bin when
  53. % calculating the rate map
  54. % rotate_inc (3 degrees). Change the angle increment for which
  55. % we calculate the correlation between rotated ac's
  56. % grid3 (0) if 1, solves for elipse that is grid field, and
  57. % then distorts it to create circle
  58. % r_out radius of the outer donut
  59. % r_in radius of the inner donut
  60. % continuize_epochs (0) if 1, returns the grid score for rate map of
  61. % cumulative data for all root.epoch(s). if 2,
  62. % returns grid score for each root.epoch separately
  63. % autocorr you can provide an autocorrelation to run gridness
  64. % on like this: CMBHOME.Session.Gridness([], [], 'autocorr', AC);
  65. %
  66. % DEPENDS ON
  67. %
  68. % image processessing toolbox (edge and padarray)
  69. %
  70. % CMBHOME.Utils (extrema2 and others)
  71. %
  72. % ALGORITHM
  73. %
  74. % 1. calculates the rate map, smooths it, sets no occupancy to zero
  75. % 2. gets the autocorrelation of the rate map
  76. % 3. cuts out the center peak from the autocorrelation, and finds the six
  77. % surrounding peaks, if they all exist, and cuts them out to make a
  78. % donut
  79. % 4. rotate the donut 3 (rotate inc) degrees at a time to 360, calculating
  80. % correlation at each step
  81. % 5. gridness score is the difference between the minimum peak at either
  82. % 60 or 120 degrees and the maximum trough at either 30, 90 or 150
  83. % degrees
  84. %
  85. % v1 dec 2009 - based upon orig gridness score (conj grid cells by sargolini et al)
  86. % v2 may 6 2010 - added eliptical correction (grid 3 param)
  87. % syntax: [gridness, phi_v_cor, auto_corr, eccentricity, grid3rotate, grid3factor, r_out, r_in] = Gridness(self, cel, varargin)
  88. % v3 jan 10 2011 - created grid property struct to simplify output
  89. %
  90. % [gridness, props] = root.Gridness(cel)
  91. % [gridness, props] = root.Gridness(cel, params)
  92. p = inputParser;
  93. p.addRequired('self')
  94. p.addRequired('cel', @isnumeric)
  95. p.addParamValue('xdim', [], @isnumeric);
  96. p.addParamValue('ydim', [], @isnumeric);
  97. p.addParamValue('clims', [], @(c) numel(c)==1);
  98. p.addParamValue('continuize_epochs', 0, @(c) numel(c)==1 && (c==1 || c==0));
  99. p.addParamValue('supress_plot', 1, @(c) numel(c)==1 && (c==1 || c==0));
  100. p.addParamValue('figure_handle', [], @(c) numel(c)==1);
  101. p.addParamValue('std_smooth_kernel', 4, @isnumeric);
  102. p.addParamValue('binside', 3, @isnumeric)
  103. p.addParamValue('rotate_inc', 3, @isnumeric)
  104. p.addParamValue('grid3', 0, @isnumeric)
  105. p.addParamValue('r_out', 0, @isnumeric)
  106. p.addParamValue('r_in', 0, @isnumeric)
  107. p.addParamValue('thresh', .1, @isnumeric)
  108. p.addParamValue('grid3rotate', 0, @isnumeric)
  109. p.addParamValue('grid3factor', 0, @isnumeric)
  110. p.addParamValue('autocorr', [], @isnumeric)
  111. p.parse(self, cel, varargin{:});
  112. self = p.Results.self;
  113. cel = p.Results.cel;
  114. xdim = p.Results.xdim;
  115. ydim = p.Results.ydim;
  116. clims = p.Results.clims;
  117. continuize_epochs = p.Results.continuize_epochs;
  118. supress_plot = p.Results.supress_plot;
  119. figure_handle = p.Results.figure_handle;
  120. std_smooth_kernel = p.Results.std_smooth_kernel;
  121. binside = p.Results.binside;
  122. rotate_inc = p.Results.rotate_inc;
  123. grid3 = p.Results.grid3;
  124. r_out = p.Results.r_out;
  125. r_in = p.Results.r_in;
  126. thresh = p.Results.thresh;
  127. grid3rotate = p.Results.grid3rotate;
  128. grid3factor = p.Results.grid3factor;
  129. autocorr = p.Results.autocorr;
  130. import CMBHOME.Utils.* % we need the super cool extrema2 function
  131. gridness = [];
  132. props.periodicity = NaN; % initialize grid cell properties
  133. props.rate_map = NaN;
  134. props.rate_map_mask = NaN;
  135. props.orig_auto_corr = NaN;
  136. props.auto_corr = NaN;
  137. props.auto_corr_mask = NaN;
  138. props.eccentricity = NaN;
  139. props.e_angle = NaN;
  140. props.e_skew = NaN;
  141. props.r_out = NaN;
  142. props.r_in = NaN;
  143. props.angle = NaN;
  144. props.spacing = NaN;
  145. props.ellipse = NaN;
  146. if ~isempty(self)
  147. if size(self.epoch, 1)>1 && continuize_epochs==0 % use some recursion to do multiple epochs
  148. [gridness, props] = MultipleEpochs(self, xdim, ydim, binside, std_smooth_kernel,...
  149. rotate_inc, cel, grid3, r_out, r_in, thresh, grid3factor, grid3rotate);
  150. if ~supress_plot, PlotIt(props.auto_corr, props.periodicity, gridness); end
  151. return
  152. end
  153. end
  154. rot_ind_mins = round([30/rotate_inc, 90/rotate_inc, 150/rotate_inc])+1; % indexes in rotated ac to check
  155. rot_ind_maxs = round([60/rotate_inc, 120/rotate_inc])+1;
  156. if isempty(autocorr)
  157. [rate_map, ~, ~, ~, rmmask] = self.RateMap(cel, 'supress_plot', 1, 'xdim', xdim, 'ydim', ydim, 'binside', binside, 'std_smooth_kernel', std_smooth_kernel, 'continuize_epochs', 1); % step 1
  158. autocorr = moserac(rate_map); % step 2: get autocorrelogram, make sure its a square image for later processing...
  159. else
  160. rate_map = [];
  161. rmmask = [];
  162. end
  163. auto_corr = MakeSquare(autocorr); % make autocorrelation matrix square
  164. props.orig_auto_corr = auto_corr;
  165. [auto_corr, peak_radius, mask, no_center_peak] = RemoveCenterPeak(auto_corr, r_in, thresh);
  166. if no_center_peak, disp('No center peak'), return, end
  167. [succ, props] = RemoveOuterCircle(auto_corr, peak_radius, mask, thresh, grid3, binside, r_out, grid3rotate, grid3factor, props);
  168. [~, ~, props.periodicity] = AutoCorrRotation(rot90(props.auto_corr, 3), props.auto_corr, 'cut_circle', 0, 'supress_plot', 1, 'rotate_inc', rotate_inc);
  169. gridness = min(props.periodicity(rot_ind_maxs, 2))-max(props.periodicity(rot_ind_mins, 2)); % solve for gridness
  170. props.periodicity(:,1) = props.periodicity(:,1) + 90; % shift correlation angles to 0-180 degree
  171. props.rate_map = rate_map;
  172. props.rate_map_mask = rmmask;
  173. props.r_in = peak_radius;
  174. if ~supress_plot, PlotIt(props.auto_corr, props.periodicity, gridness); end
  175. end
  176. function PlotIt(auto_corr, phi_v_cor, gridness)
  177. figure
  178. n_epochs = length(gridness);
  179. for i = 1:n_epochs
  180. if iscell(auto_corr)
  181. subplot(n_epochs, 2, (i-1)*2+1), imagesc(auto_corr{i}(:,:,1)), axis square, axis off
  182. else
  183. subplot(n_epochs, 2, (i-1)*2+1), imagesc(auto_corr(:,:,1)), axis square, axis off
  184. end
  185. subplot(n_epochs, 2, (i-1)*2+2), plot(phi_v_cor(:,(i-1)*2+1), phi_v_cor(:,(i-1)*2+2));
  186. end
  187. end
  188. function [succ, props] = RemoveOuterCircle(auto_corr, peak_width, mask, thresh, grid3, binside, r_out, grid3rotate, grid3factor, props)
  189. %
  190. % auto_corr matrix of autocorrelation
  191. % d half the width of peaks (radius of peak edge)
  192. % mask marks where cuts in auto_corr were made
  193. % thresh threshold for peaks
  194. import CMBHOME.Utils.* % for extrema2 function
  195. eccentricity = NaN;
  196. spacing = NaN;
  197. succ = 0;
  198. s = size(auto_corr, 1)-1; % square matrix
  199. [col, row] = meshgrid(-s/2:s/2, -s/2:s/2); % indices on grid
  200. [~, inds] = extrema2(auto_corr);
  201. peak_centers = [col(inds), row(inds)];
  202. d2 = sqrt(sum(peak_centers.^2,2));
  203. peak_centers(d2<1.2*peak_width, :) = [];
  204. d2(d2<1.2*peak_width) = [];
  205. if r_out % if outter radius is given, find peaks within radius
  206. peak_centers(d2>r_out,:) = [];
  207. d2(d2>r_out) = [];
  208. l = length(d2);
  209. d2 = d2(1:min([l, 6]));
  210. peak_centers = peak_centers(1:min([l, 6]), :);
  211. if isempty(d2), d2 = s/2; end
  212. elseif ~isempty(d2)
  213. succ = 1;
  214. [d2, ind] = sort(d2(:));
  215. peak_centers = peak_centers(ind, :);
  216. peak_centers(d2-d2(1)>.6*d2(1),:) = []; % clear peaks much farther away from the first
  217. d2(d2-d2(1)>.6*d2(1)) = [];
  218. l = length(d2);
  219. d2 = d2(1:min([l, 6]));
  220. peak_centers = peak_centers(1:min([l, 6]), :);
  221. if isempty(d2), d2 = s/2; end
  222. else
  223. disp('No surrounding peaks.');
  224. d2 = s/2;
  225. end
  226. if (grid3 & length(d2)==6) || (grid3 & r_out & grid3rotate & grid3factor)
  227. [auto_corr, grid3factor, mask, eccentricity, grid3rotate, cs, r_out] = Ovalate(auto_corr, d2, peak_width, peak_centers, mask, r_out, grid3rotate, grid3factor);
  228. props.ellipse = cs; % assign ellipse coefficients
  229. props.r_out = r_out;
  230. elseif r_out % user spec outer radius but 6 peaks were not detected, or
  231. [auto_corr, mask ] = MakeDonutAndMask(auto_corr, mask, r_out);
  232. props.r_out = r_out;
  233. else
  234. [auto_corr, mask ] = MakeDonutAndMask(auto_corr, mask, d2(end)+peak_width);
  235. props.r_out = d2(end)+peak_width;
  236. end
  237. props.auto_corr = auto_corr;
  238. props.auto_corr_mask = ~mask;
  239. props.eccentricity = eccentricity;
  240. props.e_angle = grid3rotate;
  241. props.e_skew = grid3factor;
  242. end
  243. function [auto_corr, grid3factor, mask, eccentricity, grid3rotate, cs, r_out] = Ovalate(auto_corr, d2, peak_width, peak_centers, mask, r_out, grid3rotate, grid3factor)
  244. % This function takes the 6 peaks in the autocorrelogram, fits an adapted
  245. % oval equation to it, and then squishes the autocorrelation to make the
  246. % pattern roouunund
  247. %figure('position', [0 0 1300 600])
  248. import CMBHOME.Utils.*
  249. rot_ind_mins = round([30/30, 90/30, 150/30])+1; % indexes in rotated ac to check
  250. rot_ind_maxs = round([60/30, 120/30])+1;
  251. s = size(auto_corr, 1);
  252. if r_out & grid3rotate & grid3factor % if we are to assume an elliptical correction
  253. auto_corr = imrotate(auto_corr, grid3rotate, 'bicubic', 'crop'); % rotate auto_corr so that major axis is up
  254. mask = imrotate(mask, grid3rotate - 90, 'bicubic', 'crop');
  255. auto_corr = imresize(auto_corr, [ceil(s*grid3factor) s], 'bicubic'); % resize it
  256. mask = imresize(mask, [ceil(s*grid3factor) s], 'bicubic');
  257. [auto_corr, mask] = MakeDonutAndMask(auto_corr, mask, r_out, peak_width);
  258. eccentricity = sqrt(1 - factor^2);
  259. else
  260. % Try without correction
  261. [nocorrect.auto_corr, nocorrect.mask] = MakeDonutAndMask(auto_corr, mask, min([d2(end)+peak_width/2 s/2]));
  262. [~, ~, nocorrect.phi_v_cor] = AutoCorrRotation(rot90(nocorrect.auto_corr, 3), nocorrect.auto_corr, 'cut_circle', 0, 'supress_plot', 1, 'rotate_inc', 30);
  263. nocorrect.gridness = min(nocorrect.phi_v_cor(rot_ind_maxs, 2))-max(nocorrect.phi_v_cor(rot_ind_mins, 2));
  264. % Fit ellipse and solve for minor and major axis, etc
  265. cs = EllipseDirectFit(peak_centers); % coefficients for equation for an ellipse
  266. [A, B, phi, x, y] = EllipseFromCoef(cs, peak_centers);
  267. ec.factor = min(A, B)/max(A,B);
  268. if ec.factor >.5 % if major axis is less than twice the length of the minor axis
  269. ec.auto_corr = imrotate(auto_corr, rad2deg(phi)+90, 'bicubic', 'crop'); % rotate auto_corr so that major axis is up
  270. ec.mask = imrotate(mask, 90+rad2deg(phi), 'bicubic', 'crop');
  271. ec.auto_corr = imresize(ec.auto_corr, [ceil(s*ec.factor) s], 'bicubic'); % resize it
  272. ec.mask = imresize(ec.mask, [ceil(s*ec.factor) s], 'bicubic');
  273. [ec.auto_corr, ec.mask ] = MakeDonutAndMask(ec.auto_corr, ec.mask, B+peak_width/2, peak_width);
  274. [~, ~, ec.phi_v_cor] = AutoCorrRotation(rot90(ec.auto_corr, 3), ec.auto_corr, 'cut_circle', 0, 'supress_plot', 1, 'rotate_inc', 30);
  275. ec.gridness = min(ec.phi_v_cor(rot_ind_maxs, 2))-max(ec.phi_v_cor(rot_ind_mins, 2));
  276. ec.eccentricity = sqrt(1-(B/A)^2);
  277. else
  278. ec.gridness = -100; % some arbitrarily low number
  279. ec.auto_corr = auto_corr;
  280. ec.mask = mask;
  281. cs = NaN;
  282. end
  283. % tmph = gcf;
  284. %
  285. % figure, subplot(1, 2, 1),
  286. % imagesc(auto_corr), axis equal, set(gca, 'ydir', 'normal'), hold on
  287. % scatter(peak_centers(:,1)+s/2+.5, peak_centers(:,2)+s/2+.5, 'g*'),
  288. % line([s/2+.5, s/2+A*cos(phi)+.5], [s/2+.5, s/2+A*sin(phi)+.5], 'Color', 'r', 'LineWidth', 2);
  289. % line([s/2+.5, s/2+B*cos(phi+pi/2)+.5], [s/2+.5, s/2+B*sin(phi+pi/2)+.5], 'Color', 'b', 'LineWidth', 2); title('major app'), axis equal, hold off
  290. % line(x+s/2+.5, y+s/2+.5, 'color', 'k', 'linewidth', 1.5)
  291. %
  292. % subplot(1, 2, 2), imagesc(ec.auto_corr), title(['g: ' num2str(ec.gridness)]), set(gca, 'ydir', 'normal'), axis equal
  293. %
  294. % %print(gcf, '-dpsc2', 'grid3.ps', '-append')
  295. % %close(gcf)
  296. % figure(tmph)
  297. if ec.gridness < nocorrect.gridness
  298. grid3rotate = 90; % no rotation
  299. grid3factor = 1;
  300. auto_corr = nocorrect.auto_corr;
  301. mask = nocorrect.mask;
  302. eccentricity = 0;
  303. r_out = min([d2(end)+peak_width/2 s/2]);
  304. else
  305. grid3rotate = phi;
  306. grid3factor = ec.factor;
  307. auto_corr = ec.auto_corr;
  308. mask = ec.mask;
  309. eccentricity = ec.eccentricity;
  310. r_out = B+peak_width/2;
  311. end
  312. end
  313. end
  314. function [matout, d, mask, no_center_peak] = RemoveCenterPeak(matin, r_in, thresh)
  315. % [centercut, 2stdmajoraxis] = RemoveCenterPeak(matin);
  316. %
  317. % Removes center peak of autocorrelogram by finding point furthest from
  318. % center that is half the peak (which is == 1 if using moserac).
  319. %
  320. % The above is the radius of center cutout. The since we are using an
  321. % autocorr, the peak will be either round or an oblong shape. The ratio of
  322. % the half width at the minor axis to the major axis could be the skewedness of
  323. % fields to be added in a future version.
  324. %
  325. % andrew nov 10 2010
  326. matout = [];
  327. d = [];
  328. mask = [];
  329. import CMBHOME.Utils.*
  330. s = size(matin, 1)-1; % square matrix
  331. no_center_peak = 0;
  332. [col, row] = meshgrid(-s/2:s/2, -s/2:s/2);
  333. if r_in % if inner radius is given
  334. d = r_in;
  335. matin(sqrt(col.^2 + row.^2) <= d) = 0; % set center peak to zero
  336. matout = matin;
  337. mask = zeros(size(matin)); % build mask for plotting
  338. mask(sqrt(col.^2 + row.^2) <= d) = 1;
  339. return
  340. end
  341. if all(isnan(matin(:))), no_center_peak = 1; return; end
  342. [~, inds] = extrema2(matin);
  343. peak_centers = [col(inds), row(inds)];
  344. d2 = sqrt(sum(peak_centers.^2,2));
  345. d2 = sort(d2);
  346. if length(d2)>1
  347. d2(1) = [];
  348. d2(d2-d2(1)>1.5*d2(1)) = [];
  349. end
  350. if ~isempty(d2)
  351. d = mean(d2(1:min([length(d2) 6])))/2;
  352. end
  353. % peaks = sqrt(col(matin >= thresh).^2 + row(matin>= thresh).^2);
  354. %
  355. % d = sort(peaks(:));
  356. %
  357. % d = d(find(diff(d)>1, 1, 'first')); % farthest radius of center peak
  358. % edge_inds = edge(matin>=.1);
  359. %
  360. % d = min(sqrt(col(edge_inds).^2 + row(edge_inds).^2));
  361. % below used to work OK
  362. % img_prop = regionprops(matin>thresh, {'centroid', 'minoraxislength', 'majoraxislength', 'FilledArea'});
  363. %
  364. % [~, ind] = min(sum((vertcat(img_prop(:).Centroid)-repmat((s+1)/2, length(img_prop), 2)).^2, 2)); % ind to center region
  365. %
  366. % d = img_prop(ind).MinorAxisLength/2;
  367. %d = img_prop(ind).FilledArea * (img_prop(ind).MinorAxisLength/2) / ((img_prop(ind).MinorAxisLength/2)^2*pi);
  368. if isempty(d) || 2*d>=.8 * (s+1) % if center peak is not a discrete thing, redefine thresh and look for closest non-thresh value
  369. %thresh = mean([1, min(min(matin(round(.2*end):round(.8*end),
  370. %round(.2*end):round(.8*end))))]); % half width
  371. thresh = .1; % half width
  372. peaks = sqrt(col(matin < thresh).^2 + row(matin < thresh).^2);
  373. d = min(peaks(:));
  374. end
  375. if 2*d>=.8 * (s+1) % if the detected center peak diameter is more than 80% of the autocorrelogram side dim
  376. no_center_peak = 1;
  377. d = 0;
  378. end
  379. matin(sqrt(col.^2 + row.^2) <= d) = 0; % set center peak to zero
  380. matout = matin;
  381. mask = zeros(size(matin)); % build mask for plotting
  382. mask(sqrt(col.^2 + row.^2) <= d) = 1;
  383. end
  384. function [auto_corr, mask] = MakeDonutAndMask(auto_corr, mask, r, recut_center)
  385. if ~exist('recut_center', 'var'), recut_center = 0; end
  386. s1 = size(auto_corr, 1)-1;
  387. s2 = size(auto_corr, 2)-1;
  388. [col, row] = meshgrid(-s2/2:s2/2, -s1/2:s1/2); % indices on grid % cut the donut
  389. r = min([ (s1-1)/2, r]); % set outer radius
  390. auto_corr(sqrt(col.^2 + row.^2) > r) = 0;
  391. if recut_center
  392. auto_corr(sqrt(col.^2 + row.^2)<=recut_center) = 0;
  393. mask(sqrt(col.^2 + row.^2)<=recut_center) = 1;
  394. end
  395. mask(sqrt(col.^2 + row.^2) > r) = 1;
  396. r = ceil(r); % reshape to square
  397. ds = size(auto_corr, 1)/2-r;
  398. ds2 = size(auto_corr, 2)/2-r;
  399. if ds<1, ds = .9; end
  400. if ds2<1, ds2 = .9; end
  401. auto_corr = auto_corr(ceil(ds):end-floor(ds),ceil(ds2):end-floor(ds2));
  402. mask = mask(ceil(ds):end-floor(ds),ceil(ds2):end-floor(ds2));
  403. auto_corr = MakeSquare(auto_corr);
  404. mask = MakeSquare(mask);
  405. mask = round(mask);
  406. end
  407. function matout = MakeSquare(matin)
  408. % no longer pads, but instead cuts
  409. a = diff(size(matin));
  410. if a<0 % if there are more rows than cols
  411. matout = matin(1+floor(-a/2):end-ceil(-a/2), :);
  412. elseif a>0 % if there are more cols than rows
  413. matout = matin(:, 1+floor(a/2):end-ceil(a/2));
  414. else
  415. matout = matin;
  416. end
  417. end
  418. function [gridness, props] = MultipleEpochs(self, xdim, ydim,...
  419. binside, std_smooth_kernel, rotate_inc,...
  420. cel, grid3, r_out, r_in, thresh,...
  421. grid3factor, grid3rotate)
  422. import CMBHOME.Utils.*
  423. if isempty(xdim) || isempty(ydim), % if binning dimensions are not specified, create them
  424. [x, y] = ContinuizeEpochs(self.x, self.y);
  425. xdim = min(x):self.spatial_scale^-1*binside:max(x); %edges of x and y dimensions
  426. ydim = min(y):self.spatial_scale^-1*binside:max(y);
  427. end
  428. gridness = nan(size(self.epoch,1), 1);
  429. epochs = self.epoch;
  430. for i = 1:size(epochs,1)
  431. self.epoch = epochs(i,:);
  432. [gridness(i), props(i)] = self.Gridness(cel, 'xdim', xdim, 'ydim', ydim, 'std_smooth_kernel', std_smooth_kernel, 'rotate_inc', rotate_inc, 'grid3', grid3', 'r_out', r_out, 'r_in', r_in, 'thresh', thresh, 'grid3factor', grid3factor, 'grid3rotate', grid3rotate);
  433. end
  434. end

Gridness.m at commit 01ddb2e, no license · at the source

Overview

  1. Department of Bioengineering, George Mason University,Fairfax, VA USA
  2. Interdisciplinary Program in Neuroscience, George Mason University,Fairfax, VA USA
Institutions: George Mason University (United States)
Journal: Nature communications, volume 17, issue 1, article 7035
Dates: received 14 March 2025; accepted 21 April 2026; published online 8 May 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41467-026-72620-4 · PMID 42103711 · PMCID PMC13391489 · OpenAlex W7160718492
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: extracellular electrophysiology (units, LFP) (modality), mouse (organism), systems (subfield)
Methods: Statistics, Spectral & time-frequency, Connectivity, Single-unit activity, calcium imaging
Keywords: Neuroscience, Neural circuits
MeSH: Entorhinal Cortex*, Grid Cells*, Action Potentials, Animals, Male, Mice, Mice, Inbred C57BL, Space Perception (* major topic)
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: NINDS (R00NS116129)
Citations: cited by 1 paper (Europe PMC); 46 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

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

hasselmonians/CMBHOME

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 01ddb2e967f0d75fca5e9f76459f53f59f3ffbc1, 5 January 2023
Languages: MATLAB (641), C (23), C/C++ (13)
Size: 1,409 files, 677 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, tests, documentation
Not found: license file, CITATION.cff, environment file, continuous integration
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
678 files

cnc-ntnu/bnt

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 648698c8b1985ee7968b1cdbcc37d1ff2ab8cc6f, 22 September 2021
Languages: MATLAB (482), Java (1)
Size: 576 files, 483 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: license file
Not found: README, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
484 files

dannenberglab/Tiling-of-large-scaled-environments-by-grid-cells

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: ef4a0dbe374331ca3745fc0ad6eaae8a2aeb8f04, 13 March 2026
Languages: MATLAB (9)
Size: 11 files, 9 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Image Processing Toolbox (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
11 files

Zenodo 19053822

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the references
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Image Processing Toolbox (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
11 files
At the source:

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-72620-4.

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:

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

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-72620-4.

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 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 2 keywords, 8 MeSH terms, 1 funder, 44 references.

Cite

This paper

Gutiérrez-Guzmán, B. E., Hernández-Pérez, J. J., & Dannenberg, H. (2026). Grid maps are disrupted after large-scale arena expansion and recover with experience. Nature communications, 17(1), 7035. https://doi.org/10.1038/s41467-026-72620-4

BibTeX

@article{gutierrezguzman2026grid,
author = {Gutiérrez-Guzmán, Blanca E. and Hernández-Pérez, J Jesús and Dannenberg, Holger},
title = {{Grid maps are disrupted after large-scale arena expansion and recover with experience}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {7035},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-72620-4},
url = {https://doi.org/10.1038/s41467-026-72620-4},
pmid = {42103711},
pmcid = {PMC13391489}
}

RIS

TY - JOUR
AU - Gutiérrez-Guzmán, Blanca E.
AU - Hernández-Pérez, J Jesús
AU - Dannenberg, Holger
TI - Grid maps are disrupted after large-scale arena expansion and recover with experience
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/05/08
VL - 17
IS - 1
SP - 7035
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-72620-4
UR - https://doi.org/10.1038/s41467-026-72620-4
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-72620-4",
"type": "article-journal",
"title": "Grid maps are disrupted after large-scale arena expansion and recover with experience",
"container-title": "Nature communications",
"author": [
{
"family": "Gutiérrez-Guzmán",
"given": "Blanca E."
},
{
"family": "Hernández-Pérez",
"given": "J Jesús"
},
{
"family": "Dannenberg",
"given": "Holger"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "7035",
"DOI": "10.1038/s41467-026-72620-4",
"PMID": "42103711",
"PMCID": "PMC13391489",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-72620-4",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
8
]
]
}
}

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.1038/s41467-026-70289-3 [code]
Directional dynamics in the entorhinal cortex of male mice driven by behavioral constraints.
Journal: Nature communications
In common: Optimization Toolbox, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, systems, mouse, 8 references
[2] doi:10.1126/sciadv.adz9893 [code]
Hippocampal place cells map terrain geometry independently of behavior.
Journal: Science advances
In common: CircStat, Curve Fitting Toolbox, Image Processing Toolbox, 2 other tools, extracellular electrophysiology (units, LFP), 6 references
[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, 5 other tools, systems, mouse, 1 reference
[4] doi:10.1523/jneurosci.2001-25.2026 [code]
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
In common: Chronux, export_fig, CircStat, 5 other tools, extracellular electrophysiology (units, LFP), systems
[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, 5 other tools, extracellular electrophysiology (units, LFP), mouse
[6] 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: Chronux, export_fig, CircStat, 5 other tools, systems, mouse
[7] doi:10.1038/s41593-026-02357-2 [code]
Experience reorganizes content-specific memory traces in macaques.
Journal: Nature neuroscience
In common: Chronux, export_fig, CircStat, 5 other tools
[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, 3 other tools, systems, 2 references
[9] doi:10.64898/2026.03.10.710908 [code]
Toroidal topology of grid-cell activity precedes spatial navigation during development
Journal: bioRxiv (preprint)
In common: Chronux, CircStat, Image Processing Toolbox, 2 other tools, 3 references
[10] 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, 4 other tools, systems, mouse

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.