OSCR

Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input.

Code ↔ Paper

18 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 18 matches
  1. [1] § Methods › Sequence-axon detection and analysis ↔ Main Scripts/EC_Axons_Sequences_and_Behavior_Only_Expert.m, lines 111–210 · score 0.83 · delay axon, offset axon, trial reliability, odor axon, EC axons, delay period
  2. [2] § Results › Two-photon calcium imaging of temporammonic entorhinal cortical axons in dorsal CA1 revealed differential sequential activity in LEC and MEC inputs ↔ Main Scripts/EC_Axons_Sequences_and_Behavior_Only_Expert.m, lines 111–210 · score 0.75 · odor offset, 0–1 s, 1–2 s, 2–6 s, Delay Period, axons
  3. [3] § Results › Chemogenetic inhibition of entorhinal cortex disrupted non-spatial BTSP ↔ Main Scripts/CA1PSAM_Decoding.m, lines 347–452 · score 0.67 · way ANOVA, LEC PSAM4, MEC PSAM4, mCherry, SVM, decoding
  4. [4] § Results ↔ Main Scripts/CA1PSAM_BTSP_average_fulltrial_10trials.m, lines 334–445 · score 0.65 · Benjamini Hochberg procedure, opposite odor, delay period, small events, Firing rate increase, reference event
  5. [5] § Results ↔ Main Scripts/CA1PSAM_BTSP_average_fulltrial_1trial.m, lines 334–445 · score 0.65 · Benjamini Hochberg procedure, opposite odor, delay period, small events, Firing rate increase, reference event
  6. [6] § Results › LEC inhibition reduced strength of odor representations in dorsal CA1 ↔ Main Scripts/CA1PSAM_Decoding.m, lines 207–229 · score 0.62 · odor decoding accuracy, MEC experimental, PSAM4 animals, LEC
  7. [7] § Methods › Calcium imaging data pre-processing › CA1 imaging with EC chemogenetics experiments ↔ Preprocessing/align_behavior.m, lines 17–64 · score 0.57 · default classifier, suite2p, movies, iscell, deconvolution, signals
  8. [8] § Methods › Linear regression models ↔ Main Scripts/CA1Learning_BTSP_average_odor_pres_10trials.m, lines 396–540 · score 0.56 · linear regression model, fitlme, scatter, mouse, day
  9. [9] § Methods › Linear regression models ↔ Main Scripts/CA1Learning_BTSP_average_odor_pres_1trial.m, lines 389–535 · score 0.56 · linear regression model, fitlme, scatter, mouse, day
  10. [10] § Methods › Calcium imaging data pre-processing › CA1 imaging with EC chemogenetics experiments ↔ Main Scripts/CA1PSAM_Binary_BTSP.m, lines 1–40 · score 0.53 · saline day, suite2p, classifier, motion, fluorescence, deconvolution
  11. [11] § Methods › Calcium imaging data pre-processing › EC axon imaging experiments ↔ Main Scripts/EC_Axons_Example_ROIs.m, lines 1–27 · score 0.53 · Deconvolved signals, suite2p, reward period, ball, locomotion, axon
  12. [12] § Methods › Calcium imaging data pre-processing › EC axon imaging experiments ↔ Main Scripts/EC_Axons_Selectivity_and_Decoding_Most_Selective_ROIs.m, lines 1–28 · score 0.53 · Deconvolved signals, suite2p, reward period, ball, locomotion, axon
  13. [13] § Results › Single-neuron holographical optogenetic stimulation induced odor-fields ↔ Main Scripts/CA1PSAM_AhmetBruker_compareeventshapes.m, lines 296–441 · score 0.53 · spontaneous events, event amplitudes, S3e, stimulation, width, STD
  14. [14] § Methods › Support vector machine decoding › CA1 imaging with EC chemogenetics experiments ↔ Main Scripts/EC_Axons_Selectivity_and_Decoding_Most_Selective_ROIs.m, lines 30–71 · score 0.52 · shuffle comparison, subsampling, decoding, assignment, block, ROIs
  15. [15] § Methods › Locomotion analysis ↔ Main Scripts/CA1Learning_Locomotion.m, lines 31–47 · score 0.51 · rolling backwards, locomotion, scored, ball, mouse, binned
  16. [16] § Methods › Locomotion analysis ↔ Main Scripts/CA1PSAM_Behavior_and_Locomotion.m, lines 41–56 · score 0.51 · rolling backwards, locomotion, scored, ball, mouse, binned
  17. [17] § Methods › Support vector machine decoding › CA1 imaging with EC chemogenetics experiments ↔ Main Scripts/CA1PSAM_Decoding.m, lines 40–64 · score 0.51 · shuffle comparison, subsampling, decoding, assignment, block, ROIs
  18. [18] § Results › LEC temporammonic axonal activity encoded stronger odor-specific information than MEC axonal activity ↔ Main Scripts/EC_Axons_Selectivity_and_Decoding_Most_Selective_ROIs.m, lines 244–253 · score 0.51 · odor decoding accuracy, delay period, axons, selectivity, offset

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 · 666 lines · 36 KB · no license · 3 matches

  1. %% Figure Panels made in this script:
  2. % FIGURE 4H-I
  3. % Get decoding accuracy of half second bins for:
  4. % just odor, first odor, second odor, firstvssecond, non-match vs match,
  5. % all 4 combos, and time during delay
  6. % Don't need to load this if you are just loading data
  7. load('allCA1PSAM.mat');
  8. % Notes on format
  9. % rawtrials is a 2x2 cell (1st dim is LEC then MEC, 2nd dim is controls then experimental animals)
  10. % rawtrials{1,1} is control LEC animals
  11. % rawtrials{2,1} is control MEC animals
  12. % rawtrials{1,2} is experimental LEC animals
  13. % rawtrials{2,2} is experimental MEC animals
  14. % Each of these is a nx4x2 cell (for n animals, 4 pairs, and 2 days for
  15. % each pair (with saline day first then PSEM day)
  16. % Ex: allCA1PSAM.rawtrials{1,2}{3,4,1} is saline day from the 4th pair of
  17. % 3rd animal from experimental LEC group
  18. % Within each 'F' is raw fluorescence, 'Fneu' is neuropil fluorescence,
  19. % and 'spks' is deconvolved signal (used for all analysis)
  20. % 'locomotion' is speed of ball (a.u.)
  21. % 'xyoff' is motion of brain calculated as movement of each imaging frame from reference frame
  22. % 'roistats' holds information for each ROI output from suite2p
  23. % 'beh' first column is odor combo, and 2nd column is outcome:
  24. % 1 = hit (lick on 12 or 21), 2 = false-choice (lick on 11 or 22),
  25. % 3 = miss (no-lick on 12 or 21), 4 = correct-rejection (no-lick on 11 or 22)
  26. % 'licking' holds lick timing for each trial
  27. % 'frametimes' is time x-axis for trials
  28. % First odor onset and offset are at 0 and 1 seconds
  29. % Second odor onset and offset are at 6 and 7 seconds
  30. % Reward period is from 8 to 11 seconds
  31. % 'p' are the parameters used to run 'make_allCA1PSAM.m' (see that code for specifics)
  32. %% Parameters
  33. numpairs = 4; % These are consistent for all data
  34. decode = struct; % Structure to hold all decoding results of each subsample
  35. decode.p = struct; % Structure for parameters regarding this
  36. decode.p.roisizes = [50:50:300,1000]; % How many rois to subsample for each step, Last is 1000 just to make sure got all ROIs for their betas
  37. decode.p.roisubsamples = 20; % How many times to subsample the ROIs for each roisize step
  38. decode.p.trainperc = 0.8; % Train on 80% of trials and test on 20% (done in 5 blocks of 20, or 5 blocks of 40 for justodor)
  39. decode.p.numshuf = 1; % NOT A REAL PARAMETER, I will just do one shuffle comparison for each real roisubsample
  40. % Jank assignment of bins for doing analysis with half second bins
  41. decode.p.bins = floor(allCA1PSAM.frametimes/0.5);
  42. decode.p.bins(1) = -4;
  43. decode.p.bins(end-4:end) = 27;
  44. decode.p.bins = decode.p.bins+5;
  45. decode.p.bintime = nan(1,decode.p.bins(end));
  46. for bin=1:decode.p.bins(end)
  47. thisbin = find(decode.p.bins==bin);
  48. decode.p.bintime(bin) = mean(allCA1PSAM.frametimes(thisbin));
  49. end
  50. % For the justodor time, you can use the same bins with the same start (just fewer at the end)
  51. decode.p.justodor1bins= [1:16]; % Which bins for first odor (2 secs before and 5 after)
  52. decode.p.justodor2bins = [13:28]; % Which bins for second odor (2 secs before and 5 after, overlap with last 2 seconds of delay)
  53. decode.p.delaytimebins = [9:15]; % These are middle 3.5 seconds of delay (skipping first second and last 0.5 seconds). This is 7 halfsecond bins
  54. %% Iterate, prepare data, and do all calculations (for real and shuffle)
  55. rng("Default"); % Reset MATLAB random number generator to yield repeatable results
  56. tic;
  57. decode.justodor = cell(2,2);
  58. decode.firstodor = cell(2,2);
  59. decode.secondodor = cell(2,2);
  60. decode.firstvssecond = cell(2,2);
  61. decode.matchvsnonmatch = cell(2,2);
  62. decode.fourcombos = cell(2,2);
  63. decode.delaytime = cell(2,2);
  64. decode.justodorbetas = cell(2,2);
  65. decode.firstodorbetas = cell(2,2);
  66. decode.secondodorbetas = cell(2,2);
  67. decode.firstvssecondbetas = cell(2,2);
  68. decode.matchvsnonmatchbetas = cell(2,2);
  69. decode.fourcombosbetas = cell(2,2);
  70. decode.delaytimebetas = cell(2,2);
  71. for groupregion=1:2 % LEC vs MEC
  72. for groupvirus=1:2 % Control (mcherry) vs experimental PSAM
  73. numanimals = size(allCA1PSAM.rawtrials{groupregion,groupvirus},1);
  74. decode.justodor{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.justodor1bins),2); % First 2 is saline vs PSEM, last 2 is real vs shuf
  75. decode.firstodor{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.bintime),2);
  76. decode.secondodor{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.bintime),2);
  77. decode.firstvssecond{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.justodor1bins),2);
  78. decode.matchvsnonmatch{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.bintime),2);
  79. decode.fourcombos{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.bintime),2);
  80. decode.delaytime{groupregion,groupvirus} = nan(numanimals,numpairs,2,length(decode.p.roisizes),decode.p.roisubsamples,length(decode.p.delaytimebins),length(decode.p.delaytimebins),2);
  81. decode.justodorbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2); % Again first 2 is saline vs PSEM, second 2 is real vs shuf
  82. decode.firstodorbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  83. decode.secondodorbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  84. decode.firstvssecondbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  85. decode.matchvsnonmatchbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  86. decode.fourcombosbetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  87. decode.delaytimebetas{groupregion,groupvirus} = cell(numanimals,numpairs,2,2);
  88. for animal=1:numanimals
  89. for pair=1:numpairs
  90. for daytype=1:2 % Saline vs PSEM
  91. disp(string(groupregion)+string(groupvirus)+string(animal)+string(pair)+string(daytype));
  92. toc;tic;
  93. % First bin the data
  94. data = allCA1PSAM.rawtrials{groupregion,groupvirus}{animal,pair,daytype}.spks; % CHANGE HERE IF YOU WANT FLUORESCENCE OR SOMETHING NOT SPKS
  95. [numrois,numtrials,~] = size(data);
  96. databinned = nan(numrois,numtrials,length(decode.p.bintime));
  97. for bin=1:length(decode.p.bintime)
  98. thisbin = find(decode.p.bins==bin);
  99. databinned(:,:,bin) = mean(data(:,:,thisbin),3);
  100. end
  101. % Prepare data for justodor
  102. thisbeh = allCA1PSAM.rawtrials{groupregion,groupvirus}{animal,pair,daytype}.beh(:,1);
  103. countodora = 0;
  104. countodorb = 0;
  105. odorabinned = nan(numrois,length(thisbeh),length(decode.p.justodor1bins));
  106. odorbbinned = nan(numrois,length(thisbeh),length(decode.p.justodor2bins));
  107. for trial=1:length(thisbeh)
  108. if thisbeh(trial) < 20 % This gets the first odor
  109. countodora = countodora + 1;
  110. odorabinned(:,countodora,:) = databinned(:,trial,decode.p.justodor1bins);
  111. else
  112. countodorb = countodorb + 1;
  113. odorbbinned(:,countodorb,:) = databinned(:,trial,decode.p.justodor1bins);
  114. end
  115. if mod(thisbeh(trial),2) % This gets the second odor
  116. countodora = countodora + 1;
  117. odorabinned(:,countodora,:) = databinned(:,trial,decode.p.justodor2bins);
  118. else
  119. countodorb = countodorb + 1;
  120. odorbbinned(:,countodorb,:) = databinned(:,trial,decode.p.justodor2bins);
  121. end
  122. end
  123. justodordatabinned = cat(2,odorabinned,odorbbinned);
  124. artificialbeh = cat(1,zeros(length(thisbeh),1),ones(length(thisbeh),1)); % Making this because cat justodora and odorb together (also use for firstvssecond)
  125. % And also prep data for first vs second odor
  126. firstvssecondbinned = cat(2,databinned(:,:,decode.p.justodor1bins),databinned(:,:,decode.p.justodor2bins));
  127. % also use artificialbeh here because cat them together
  128. % Get permutations of which rois to use for each step
  129. roiperms = cell(length(decode.p.roisizes),decode.p.roisubsamples);
  130. for roisizeiter=1:length(decode.p.roisizes)
  131. for roiiter=1:decode.p.roisubsamples
  132. if numrois > decode.p.roisizes(roisizeiter)
  133. roiperms{roisizeiter,roiiter} = randperm(numrois,decode.p.roisizes(roisizeiter));
  134. end
  135. end
  136. end
  137. % Now we have all data ready, can start iterating roisubsamples
  138. reachedend = 0;
  139. for roisizeiter=1:length(decode.p.roisizes)
  140. for roiiter=1:decode.p.roisubsamples
  141. % If we already reached the end we can just fill with last calculated values
  142. if reachedend
  143. decode.justodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,justodorreal,justodorshuf));
  144. decode.firstodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,firstodorreal,firstodorshuf));
  145. decode.secondodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,secondodorreal,secondodorshuf));
  146. decode.firstvssecond{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,firstvssecondreal,firstvssecondshuf));
  147. decode.matchvsnonmatch{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,matchvsnonmatchreal,matchvsnonmatchshuf));
  148. decode.fourcombos{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,fourcombosreal,fourcombosshuf));
  149. decode.delaytime{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:,:) = cat(3,delaytimereal,delaytimeshuf);
  150. continue;
  151. end
  152. if decode.p.roisizes(roisizeiter) >= numrois
  153. theseroi = [1:numrois]; % If numrois is smaller, than I just use all cells
  154. reachedend = 1; % just do it once then fill in rest
  155. else
  156. theseroi = roiperms{roisizeiter,roiiter};
  157. end
  158. % Now can call the decode functions repeatedly
  159. [justodorreal, justodorshuf, decode.justodorbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.justodorbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedbinarySVM(justodordatabinned(theseroi,:,:),artificialbeh,decode.p.trainperc,reachedend);
  160. [firstodorreal, firstodorshuf, decode.firstodorbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.firstodorbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedbinarySVM(databinned(theseroi,:,:),thisbeh>20,decode.p.trainperc,reachedend);
  161. [secondodorreal, secondodorshuf, decode.secondodorbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.secondodorbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedbinarySVM(databinned(theseroi,:,:),mod(thisbeh+1,2),decode.p.trainperc,reachedend);
  162. [firstvssecondreal, firstvssecondshuf, decode.firstvssecondbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.firstvssecondbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedbinarySVM(firstvssecondbinned(theseroi,:,:),artificialbeh,decode.p.trainperc,reachedend);
  163. [matchvsnonmatchreal, matchvsnonmatchshuf, decode.matchvsnonmatchbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.matchvsnonmatchbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedbinarySVM(databinned(theseroi,:,:),thisbeh==12|thisbeh==21,decode.p.trainperc,reachedend);
  164. [fourcombosreal, fourcombosshuf, decode.fourcombosbetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.fourcombosbetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binnedfourcombosSVM(databinned(theseroi,:,:),thisbeh,decode.p.trainperc,reachedend);
  165. [delaytimereal, delaytimeshuf, decode.delaytimebetas{groupregion,groupvirus}{animal,pair,daytype,1}, decode.delaytimebetas{groupregion,groupvirus}{animal,pair,daytype,2}] = binneddelaytimeSVM(databinned(theseroi,:,decode.p.delaytimebins),decode.p.trainperc,reachedend);
  166. % Save them into 'decode'
  167. decode.justodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,justodorreal,justodorshuf));
  168. decode.firstodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,firstodorreal,firstodorshuf));
  169. decode.secondodor{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,secondodorreal,secondodorshuf));
  170. decode.firstvssecond{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,firstvssecondreal,firstvssecondshuf));
  171. decode.matchvsnonmatch{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,matchvsnonmatchreal,matchvsnonmatchshuf));
  172. decode.fourcombos{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:) = squeeze(cat(3,fourcombosreal,fourcombosshuf));
  173. decode.delaytime{groupregion,groupvirus}(animal,pair,daytype,roisizeiter,roiiter,:,:,:) = cat(3,delaytimereal,delaytimeshuf);
  174. end
  175. end
  176. end
  177. end
  178. end
  179. end
  180. end
  181. toc;
  182. % Save to disk
  183. save('PSAMDecoding.mat','decode','-v7.3');
  184. %% FIGURE 4H
  185. % Figures visualizing decoding accuracy across trial (with significant stars), for LEC and MEC experimentals
  186. whichroisize = 2; % 2 is use 100 ROIs, 7 is use all ROIs
  187. usebintime = decode.p.bintime;
  188. whichbins = [1:26];
  189. usebintime = usebintime(whichbins);
  190. LECrealdecoding = squeeze(mean(decode.firstodor{1,2}(:,:,:,whichroisize,:,whichbins,1),5,'omitnan'))*100; % Only averaging the roiiters for this one roisize
  191. LECshufdecoding = squeeze(mean(decode.firstodor{1,2}(:,:,:,whichroisize,:,whichbins,2),5,'omitnan'))*100;
  192. plotdecodeacrosstrialnew(LECrealdecoding,LECshufdecoding,usebintime,[0.8 0 0],[45 90],[50:10:90],'Decoding Accuracy %',[0.5 0.6 0 0],"First Odor Decoding" + newline + "LEC PSAM4 Animals",'FirstOdorDecode100ROIsLECPSAM');
  193. MECrealdecoding = squeeze(mean(decode.firstodor{2,2}(:,:,:,whichroisize,:,whichbins,1),5,'omitnan'))*100; % Only averaging the roiiters for this one roisize
  194. MECshufdecoding = squeeze(mean(decode.firstodor{2,2}(:,:,:,whichroisize,:,whichbins,2),5,'omitnan'))*100;
  195. plotdecodeacrosstrialnew(MECrealdecoding,MECshufdecoding,usebintime,[0 0 0.8],[45 90],[50:10:90],'Decoding Accuracy %',[0.5 0.6 0 0],"First Odor Decoding" + newline + "MEC PSAM4 Animals",'FirstOdorDecode100ROIsMECPSAM');
  196. LECrealdecoding = squeeze(mean(decode.secondodor{1,2}(:,:,:,whichroisize,:,whichbins,1),5,'omitnan'))*100; % Only averaging the roiiters for this one roisize
  197. LECshufdecoding = squeeze(mean(decode.secondodor{1,2}(:,:,:,whichroisize,:,whichbins,2),5,'omitnan'))*100;
  198. plotdecodeacrosstrialnew(LECrealdecoding,LECshufdecoding,usebintime,[0.8 0 0],[45 90],[50:10:90],'Decoding Accuracy %',[0.5 0.6 0 0],"Second Odor Decoding" + newline + "LEC PSAM4 Animals",'SecondOdorDecode100ROIsLECPSAM');
  199. MECrealdecoding = squeeze(mean(decode.secondodor{2,2}(:,:,:,whichroisize,:,whichbins,1),5,'omitnan'))*100; % Only averaging the roiiters for this one roisize
  200. MECshufdecoding = squeeze(mean(decode.secondodor{2,2}(:,:,:,whichroisize,:,whichbins,2),5,'omitnan'))*100;
  201. plotdecodeacrosstrialnew(MECrealdecoding,MECshufdecoding,usebintime,[0 0 0.8],[45 90],[50:10:90],'Decoding Accuracy %',[0.5 0.6 0 0],"Second Odor Decoding" + newline + "MEC PSAM4 Animals",'SecondOdorDecode100ROIsMECPSAM');
  202. %% FIGURE 4I
  203. % Paired comparisons for just odor decoding of odor period
  204. whichroisize = 2; % 2 is use 100 ROIs, 7 is use all ROIs
  205. data = cell(2,2);
  206. whichbins = [5:6]; % 5-6 is odor, 7-8 is offset, 9-15 is delay
  207. for groupregion=1:2 % LEC vs MEC
  208. for groupvirus=1:2 % Control (mcherry) vs experimental PSAM
  209. data{groupregion,groupvirus} = squeeze(mean(decode.justodor{groupregion,groupvirus}(:,:,:,whichroisize,:,whichbins,1),[5 6],'omitnan'))*100; % Only averaging this roiiters and chosen bins
  210. end
  211. end
  212. plot4groupcompnew(data,[45 101],[50:10:100],'Decoding Accuracy %',[0.97 0.5 0 0],"\fontsize{20}Odor Decoding\fontsize{12}" + newline + "\fontsize{12}(during odor presentation)","PSAMJustOdorDecodeDuringOdor100ROIsnew");
  213. %% Function that plots decoding results across trial structure (for 11 seconds) NEW VERSION WITH 3-Way ANOVA (pair x daytype x bin)
  214. function plotdecodeacrosstrialnew(realdata,shufdata,bintime,color,ylimrange,yaxisticks,yaxistext,legendloc,titletext,savetext)
  215. % 3-way ANOVA repeated measures (pair x daytype x bin)
  216. % Within subject for all 3, with continuous measures for pair and bin, but
  217. % categorical for daytype
  218. [numanimals,numpairs,numdaytypes,numbins] = size(realdata); % Only works with 4 numpairs and 2 daytypes
  219. if numpairs~=4 || numdaytypes~=2
  220. disp("ERROR WRONG NUMBER OF PAIRS OR DAYTYPES");
  221. end
  222. datafortbl = nan(numanimals,numpairs*numdaytypes*numbins);
  223. tblvariables = cell(1,numpairs*numdaytypes*numbins);
  224. withindesignarray = nan(numpairs*numdaytypes*numbins,3);
  225. countcolumn = 0;
  226. for pair=1:numpairs
  227. for daytype=1:numdaytypes
  228. for bin=1:numbins
  229. countcolumn = countcolumn + 1;
  230. datafortbl(:,countcolumn) = squeeze(realdata(:,pair,daytype,bin));
  231. tblvariables{countcolumn} = sprintf('P%dDT%dBin%d',pair,daytype,bin);
  232. withindesignarray(countcolumn,:) = [pair,daytype,bin];
  233. end
  234. end
  235. end
  236. tbl = array2table(datafortbl,'VariableNames',tblvariables);
  237. withindesign = array2table(withindesignarray,'VariableNames',{'Pair','Daytype','Bin'});
  238. withindesign.Daytype = categorical(withindesign.Daytype);
  239. modelspecstart = sprintf('P%dDT%dBin%d',1,1,1);
  240. modelspecend = sprintf('P%dDT%dBin%d',numpairs,numdaytypes,numbins);
  241. modelspectext = cat(2,modelspecstart,'-',modelspecend,'~1');
  242. rm = fitrm(tbl,modelspectext,'WithinDesign',withindesign);
  243. mauchlytbl = mauchly(rm); % Mauchly test for sphericity (for reference)
  244. ranovatbl = ranova(rm, 'WithinModel', 'Pair*Daytype*Bin'); % ANOVA For reference
  245. multcomptbl = multcompare(rm,'Daytype','By','Bin');
  246. pvals = multcomptbl{[1:numbins]*2,6};
  247. allrealsaline = nan(numanimals*numpairs,length(bintime));
  248. allrealPSEM = nan(numanimals*numpairs,length(bintime));
  249. allshuf = nan(numanimals*numpairs*2,length(bintime));
  250. for bin=1:length(bintime)
  251. tempreal = squeeze(realdata(:,:,:,bin));
  252. temprealsaline = tempreal(:,:,1);
  253. temprealPSEM = tempreal(:,:,2);
  254. allrealsaline(:,bin) = temprealsaline(:);
  255. allrealPSEM(:,bin) = temprealPSEM(:);
  256. tempshuf = squeeze(shufdata(:,:,:,bin));
  257. allshuf(:,bin) = tempshuf(:);
  258. end
  259. salinemean = mean(allrealsaline,1,'omitnan');
  260. salineSEM = std(allrealsaline,0,1,'omitnan')./sqrt(size(allrealsaline,1));
  261. PSEMmean = mean(allrealPSEM,1,'omitnan');
  262. PSEMSEM = std(allrealPSEM,0,1,'omitnan')./sqrt(size(allrealPSEM,1));
  263. shufmean = mean(allshuf,1,'omitnan');
  264. shufSEM = std(allshuf,0,1,'omitnan')./sqrt(size(allshuf,1));
  265. fillx = [bintime fliplr(bintime)];
  266. fillysaline = [salinemean+salineSEM fliplr(salinemean-salineSEM)]; % These are for filled SEM
  267. fillyPSEM = [PSEMmean+PSEMSEM fliplr(PSEMmean-PSEMSEM)];
  268. fillyshuf = [shufmean+1.96*shufSEM fliplr(shufmean-1.96*shufSEM)]; % Multiply by 1.96 to get 95% confidence intervals
  269. fig = figure;
  270. hold on;
  271. fill([0 1 1 0],[-1 -1 110 110],'k','FaceAlpha',0.2,'LineStyle','none');
  272. fill([6 7 7 6],[-1 -1 110 110],'k','FaceAlpha',0.2,'LineStyle','none');
  273. fill([8 11 11 8],[-1 -1 110 110],'k','FaceAlpha',0.1,'LineStyle','none');
  274. shuffleplot = plot(bintime,shufmean,'k-','LineWidth',2);
  275. fill(fillx,fillyshuf,'k','FaceAlpha',0.2,'LineStyle','none');
  276. fill(fillx,fillysaline,color,'FaceAlpha',0.2,'LineStyle','none');
  277. fill(fillx,fillyPSEM,color,'FaceAlpha',0.2,'LineStyle','none');
  278. salineplot = plot(bintime,salinemean,'-','Color',color,'LineWidth',2);
  279. PSEMplot = plot(bintime,PSEMmean,'--','Color',color,'LineWidth',2);
  280. scatter(bintime(pvals'<0.05&salinemean>50&PSEMmean>50),(ylimrange(2)-ylimrange(1))*0.97+ylimrange(1),100,'k*');
  281. legend([salineplot PSEMplot shuffleplot],{'Saline','uPSEM','Shuffle'},'FontSize',14,'Position',legendloc);
  282. legend boxoff;
  283. title(titletext);
  284. ylabel(yaxistext);
  285. xticks([0:2:14]);
  286. xlim([-2 11]);
  287. xlabel('Time (sec)');
  288. yticks(yaxisticks);
  289. ylim(ylimrange);
  290. set(gcf, 'Position', [200, 200, 550, 350]);
  291. set(gcf,'color','w');
  292. ax = gca;
  293. ax.FontSize = 18;
  294. ax.FontName = 'Arial';
  295. ax.XColor = [0 0 0];
  296. ax.YColor = [0 0 0];
  297. fig.Renderer = 'painters';
  298. saveas(fig,savetext+".epsc");
  299. saveas(fig,savetext+".png");
  300. saveas(fig,savetext+".fig");
  301. exportgraphics(fig,savetext+".pdf");
  302. end
  303. %% New version of other function using 3-way ANOVA
  304. function plot4groupcompnew(data,ylimrange,yaxisticks,yaxistext,legendloc,titletext,savetext)
  305. colors = [[1 0.2 0.2];[0.2 0.2 1];[0.8 0 0];[0 0 0.8]];
  306. xticklocs = [1,2;3,4;5.5,6.5;7.5,8.5];
  307. % 3-way ANOVA repeated measures (group x pair x daytype)
  308. % Within subject for pair and daytype, between subject for group
  309. catdata = cat(1,data{1,1},data{2,1},data{1,2},data{2,2});
  310. [totalanimals,numpairs,numdaytype] = size(catdata);
  311. grouplabels = [repmat(1,size(data{1,1},1),1);repmat(2,size(data{2,1},1),1);repmat(3,size(data{1,2},1),1);repmat(4,size(data{2,2},1),1)];
  312. datafortbl = [];
  313. for animal = 1:totalanimals
  314. animaldata = catdata(animal,:,:);
  315. datafortbl = cat(1,datafortbl,animaldata(:)');
  316. end
  317. datafortbl = cat(2,datafortbl,grouplabels);
  318. tbl = array2table(datafortbl,'VariableNames',{'S1','S2','S3','S4','P1','P2','P3','P4','Group'});
  319. tbl.Group = categorical(tbl.Group);
  320. withindesign = table([1 1 1 1 2 2 2 2]',[1:4 1:4]','VariableNames',{'Daytype','Pair'});
  321. withindesign.Daytype = categorical(withindesign.Daytype);
  322. % withindesign.Pair = categorical(withindesign.Pair); % This is not categorical
  323. rm = fitrm(tbl,'S1-P4~Group','WithinDesign',withindesign);
  324. mauchlytbl = mauchly(rm); % Mauchly test for sphericity (for reference)
  325. ranovatbl = ranova(rm, 'WithinModel', 'Pair*Daytype'); % ANOVA For reference
  326. multcomptbl = multcompare(rm,'Daytype','By','Group');
  327. pvals = nan(4,1);
  328. for group=1:4
  329. pvals(group) = multcomptbl{group*2-2+1,6};
  330. fprintf('Lower = %.4f and Upper = %.4f\n', multcomptbl{group*2-2+1,7}, multcomptbl{group*2-2+1,8});
  331. end
  332. fig = figure;
  333. hold on;
  334. yline(50,'--k','LineWidth',2);
  335. for groupvirus=1:2 % Control (mcherry) vs experimental PSAM
  336. for groupregion=1:2 % LEC vs MEC
  337. comparenum = groupvirus*2-2 + groupregion; % Which comparison is this? - first is LEC control, 2nd MEC control exp, 3rd LEC exp, 4th MEC exp
  338. thisdata = catdata(grouplabels==comparenum,:);
  339. salineaves = mean(thisdata(:,1:numpairs),2,'omitnan'); % Animal averages to plot dots
  340. PSEMaves = mean(thisdata(:,numpairs+1:numpairs*2),2,'omitnan');
  341. salinemean = mean(salineaves) % Overall average mean bar across
  342. PSEMmean = mean(PSEMaves)
  343. salinestd = std(salineaves)
  344. PSEMstd = std(PSEMaves)
  345. plot(xticklocs(comparenum,:),[salineaves,PSEMaves],'-','Color',[0.5 0.5 0.5],'LineWidth',1);
  346. salinescatter = scatter(xticklocs(comparenum,1),salineaves,40,'MarkerEdgeColor',[0.6 0.6 0.6],'MarkerFaceColor',[1 1 1],'LineWidth',1.5);
  347. PSEMscatter = scatter(xticklocs(comparenum,2),PSEMaves,40,'MarkerEdgeColor',[0.6 0.6 0.6],'MarkerFaceColor',[0.6 0.6 0.6],'LineWidth',1.5);
  348. errorbar(xticklocs(comparenum,:),[salinemean,PSEMmean],[salinestd/sqrt(length(salineaves)),PSEMstd/sqrt(length(PSEMaves))],'.-','Color',colors(comparenum,:),'LineWidth',4,'Capsize',8);
  349. plot([xticklocs(comparenum,1) xticklocs(comparenum,1) xticklocs(comparenum,2) xticklocs(comparenum,2)],[(ylimrange(2)-ylimrange(1))*0.86+ylimrange(1) (ylimrange(2)-ylimrange(1))*0.88+ylimrange(1) (ylimrange(2)-ylimrange(1))*0.88+ylimrange(1) (ylimrange(2)-ylimrange(1))*0.86+ylimrange(1)],'-k','LineWidth',1.5);
  350. if pvals(comparenum) < 0.001
  351. asterisktext = "\bf\ast\ast\ast";
  352. signbartext = "p < 0.001";
  353. elseif pvals(comparenum) < 0.01
  354. asterisktext = "\bf\ast\ast";
  355. signbartext = sprintf("p = %.3f",pvals(comparenum));
  356. elseif pvals(comparenum) < 0.05
  357. asterisktext = "\bf\ast";
  358. signbartext = sprintf("p = %.3f",pvals(comparenum));
  359. elseif pvals(comparenum) < 0.1
  360. asterisktext = " ";
  361. signbartext = sprintf("p = %.3f",pvals(comparenum));
  362. else
  363. asterisktext = " ";
  364. signbartext = "n.s.";
  365. end
  366. text(mean(xticklocs(comparenum,:)),(ylimrange(2)-ylimrange(1))*0.985+ylimrange(1),asterisktext,'HorizontalAlignment','Center','BackGroundColor','none','FontSize',28);
  367. text(mean(xticklocs(comparenum,:)),(ylimrange(2)-ylimrange(1))*0.92+ylimrange(1),signbartext,'HorizontalAlignment','Center','BackGroundColor','none','FontSize',14);
  368. end
  369. end
  370. legend([salinescatter(1) PSEMscatter(1)],{'S','P'},'FontSize',20,'Position',legendloc);
  371. legend boxoff;
  372. xticks([mean(xticklocs(1,:)) mean(xticklocs(2,:)) mean(xticklocs(3,:)) mean(xticklocs(4,:))]);
  373. xticklabels({'LEC mCherry','MEC mCherry','LEC PSAM4','MEC PSAM4'});
  374. xtickangle(35);
  375. xlim([xticklocs(1,1)-0.5 xticklocs(4,2)+0.5]);
  376. ylabel(yaxistext);
  377. yticks(yaxisticks);
  378. ylim(ylimrange);
  379. title(titletext);
  380. set(gcf, 'Position', [200, 200, 500, 500]);
  381. set(gcf,'color','w');
  382. ax = gca;
  383. ax.FontSize = 18;
  384. ax.FontName = 'Arial';
  385. ax.XColor = [0 0 0];
  386. ax.YColor = [0 0 0];
  387. fig.Renderer = 'painters';
  388. saveas(fig,savetext+".epsc");
  389. saveas(fig,savetext+".png");
  390. saveas(fig,savetext+".fig");
  391. exportgraphics(fig,savetext+".pdf");
  392. end
  393. %% Most used function that does a binary SVM on each bin
  394. % Inputs 'data' is 3D (numrois,numtrials,numbins)
  395. % 'groups' is logical with equal sizes
  396. % 'trainperc' should always be 0.8
  397. % 'savebeta' only if all ROIs being used, I'll save the beta coefficients for each ROI and each bin
  398. % First output is accuracy across all bins for real data, second is same
  399. % for the single shuffle (only shuffle the training set group assignment)
  400. % Outbetas are the average beta coefficients from SVM (kinda like weights
  401. % for strength of information corresponding to each ROI)
  402. function [outaccreal, outaccshuf, outrealbetas, outshufbetas] = binnedbinarySVM(Data,groups,trainperc,savebeta)
  403. data0 = Data(:,groups==0,:); % I want to split so we can grab first 10 (or 20) from each group for testing
  404. data1 = Data(:,groups==1,:);
  405. [numrois,trialspergroup,numbins] = size(data0);
  406. if trainperc == 0.8
  407. numblocks = 5;
  408. numtesttrials = trialspergroup/5; % Number of testtrials per group
  409. else
  410. disp("Check trainperc, not 0.8");
  411. end
  412. if savebeta
  413. realbetas = nan(numrois,numbins,numblocks);
  414. shufbetas = nan(numrois,numbins,numblocks);
  415. end
  416. accreal = nan(numblocks,numbins);
  417. accshuf = nan(numblocks,numbins);
  418. traintarget = [zeros(trialspergroup-numtesttrials,1); ones(trialspergroup-numtesttrials,1)];
  419. shuftraintarget = traintarget(randperm(length(traintarget)));
  420. testtarget = [zeros(numtesttrials,1); ones(numtesttrials,1)];
  421. for block=1:numblocks
  422. testtrials = [(block-1)*numtesttrials+1:block*numtesttrials];
  423. traintrials = [1:trialspergroup];
  424. traintrials(testtrials) = [];
  425. for bin=1:numbins
  426. trainset = [squeeze(data0(:,traintrials,bin)),squeeze(data1(:,traintrials,bin))]';
  427. testset = [squeeze(data0(:,testtrials,bin)),squeeze(data1(:,testtrials,bin))]';
  428. % For real data
  429. svmreal = fitcsvm(trainset,traintarget);
  430. svmoutreal = predict(svmreal,testset);
  431. accreal(block,bin) = sum(svmoutreal==testtarget) / (numtesttrials*2);
  432. % For shuffle data
  433. svmshuf = fitcsvm(trainset,shuftraintarget);
  434. svmoutshuf = predict(svmshuf,testset);
  435. accshuf(block,bin) = sum(svmoutshuf==testtarget) / (numtesttrials*2);
  436. if savebeta
  437. realbetas(:,bin,block) = svmreal.Beta;
  438. shufbetas(:,bin,block) = svmshuf.Beta;
  439. end
  440. end
  441. end
  442. outaccreal = mean(accreal,1);
  443. outaccshuf = mean(accshuf,1);
  444. if savebeta
  445. outrealbetas = squeeze(mean(realbetas,3));
  446. outshufbetas = squeeze(mean(shufbetas,3));
  447. else
  448. outrealbetas = NaN;
  449. outshufbetas = NaN;
  450. end
  451. end
  452. %% Nearly identical to previous function, but for 4 combinations
  453. % Again only shuffling the training set group assignment
  454. % Big difference is that I'm averaging Betas for each binary learner
  455. % I also take absolute value of Betas before averaging because not sure how
  456. % group assignment works
  457. function [outaccreal, outaccshuf, outrealbetas, outshufbetas] = binnedfourcombosSVM(Data,groups,trainperc,savebeta)
  458. data11 = Data(:,groups==11,:);
  459. data12 = Data(:,groups==12,:);
  460. data21 = Data(:,groups==21,:);
  461. data22 = Data(:,groups==22,:);
  462. [numrois,trialspergroup,numbins] = size(data11);
  463. if trainperc == 0.8
  464. numblocks = 5;
  465. numtesttrials = trialspergroup/5; % Number of testtrials per group
  466. else
  467. disp("Check trainperc, not 0.8");
  468. end
  469. if savebeta
  470. realbetas = nan(numrois,numbins,numblocks);
  471. shufbetas = nan(numrois,numbins,numblocks);
  472. end
  473. accreal = nan(numblocks,numbins);
  474. accshuf = nan(numblocks,numbins);
  475. traintarget = [zeros(trialspergroup-numtesttrials,1); ones(trialspergroup-numtesttrials,1); ones(trialspergroup-numtesttrials,1)*2; ones(trialspergroup-numtesttrials,1)*3];
  476. shuftraintarget = traintarget(randperm(length(traintarget)));
  477. testtarget = [zeros(numtesttrials,1); ones(numtesttrials,1); ones(numtesttrials,1)*2; ones(numtesttrials,1)*3];
  478. for block=1:numblocks
  479. testtrials = [(block-1)*numtesttrials+1:block*numtesttrials];
  480. traintrials = [1:trialspergroup];
  481. traintrials(testtrials) = [];
  482. for bin=1:numbins
  483. trainset = [squeeze(data11(:,traintrials,bin)),squeeze(data12(:,traintrials,bin)),squeeze(data21(:,traintrials,bin)),squeeze(data22(:,traintrials,bin))]';
  484. testset = [squeeze(data11(:,testtrials,bin)),squeeze(data12(:,testtrials,bin)),squeeze(data21(:,testtrials,bin)),squeeze(data22(:,testtrials,bin))]';
  485. % For real data
  486. svmreal = fitcecoc(trainset,traintarget);
  487. svmoutreal = predict(svmreal,testset);
  488. accreal(block,bin) = sum(svmoutreal==testtarget) / (numtesttrials*4);
  489. % For shuffle data
  490. svmshuf = fitcecoc(trainset,shuftraintarget);
  491. svmoutshuf = predict(svmshuf,testset);
  492. accshuf(block,bin) = sum(svmoutshuf==testtarget) / (numtesttrials*4);
  493. if savebeta
  494. realnumlearners = length(svmreal.BinaryLearners);
  495. tempreal = nan(numrois,realnumlearners);
  496. for learner=1:realnumlearners
  497. tempreal(:,learner) = abs(svmreal.BinaryLearners{learner}.Beta);
  498. realbetas(:,bin,block) = mean(tempreal,2);
  499. end
  500. shufnumlearners = length(svmshuf.BinaryLearners);
  501. tempshuf = nan(numrois,shufnumlearners);
  502. for learner=1:shufnumlearners
  503. tempshuf(:,learner) = abs(svmshuf.BinaryLearners{learner}.Beta);
  504. shufbetas(:,bin,block) = mean(tempshuf,2);
  505. end
  506. end
  507. end
  508. end
  509. outaccreal = mean(accreal,1);
  510. outaccshuf = mean(accshuf,1);
  511. if savebeta
  512. outrealbetas = squeeze(mean(realbetas,3));
  513. outshufbetas = squeeze(mean(shufbetas,3));
  514. else
  515. outrealbetas = NaN;
  516. outshufbetas = NaN;
  517. end
  518. end
  519. %% Function for decoding time (very different from other functions)
  520. % Will also do 80% training 20% testing
  521. % Instead of accuracy, I output matrix
  522. function [outmatrixreal, outmatrixshuf, outrealbetas, outshufbetas] = binneddelaytimeSVM(Data,trainperc,savebeta)
  523. [numrois,numtrials,numbins] = size(Data);
  524. % First prepare data
  525. catdata = [];
  526. for bin=1:numbins
  527. catdata = cat(2,catdata,squeeze(Data(:,:,bin)));
  528. end
  529. traintarget = repelem(1:numbins,numtrials)';
  530. shuftraintarget = traintarget(randperm(length(traintarget)));
  531. catdata = catdata'; % Have to transpose because need ROI in 2nd dim
  532. if trainperc == 0.8
  533. numblocks = 5;
  534. numtesttrials = numtrials/5; % Number of testtrials per group
  535. else
  536. disp("Check trainperc, not 0.8");
  537. end
  538. if savebeta
  539. realbetas = nan(numrois,numblocks);
  540. shufbetas = nan(numrois,numblocks);
  541. end
  542. matrixreal = nan(numbins,numbins,numblocks);
  543. matrixshuf = nan(numbins,numbins,numblocks);
  544. for block=1:numblocks
  545. testtrials = false(numtrials,1);
  546. testtrials((block-1)*numtesttrials+1:block*numtesttrials) = true;
  547. testrows = repmat(testtrials,numbins,1);
  548. trainrows = ~testrows;
  549. svmreal = fitcecoc(catdata(trainrows,:),traintarget(trainrows));
  550. svmoutreal = predict(svmreal,catdata(testrows,:));
  551. svmshuf = fitcecoc(catdata(trainrows,:),shuftraintarget(trainrows));
  552. svmoutshuf = predict(svmshuf,catdata(testrows,:));
  553. if savebeta
  554. realnumlearners = length(svmreal.BinaryLearners);
  555. tempreal = nan(numrois,realnumlearners);
  556. for learner=1:realnumlearners
  557. tempreal(:,learner) = abs(svmreal.BinaryLearners{learner}.Beta);
  558. realbetas(:,block) = mean(tempreal,2);
  559. end
  560. shufnumlearners = length(svmshuf.BinaryLearners);
  561. tempshuf = nan(numrois,shufnumlearners);
  562. for learner=1:shufnumlearners
  563. tempshuf(:,learner) = abs(svmshuf.BinaryLearners{learner}.Beta);
  564. shufbetas(:,block) = mean(tempshuf,2);
  565. end
  566. end
  567. realbins = traintarget(testrows);
  568. for realbin=1:numbins
  569. for predbin=1:numbins
  570. matrixreal(realbin,predbin,block) = sum(svmoutreal==predbin & realbins==realbin) / numtesttrials;
  571. matrixshuf(realbin,predbin,block) = sum(svmoutshuf==predbin & realbins==realbin) / numtesttrials;
  572. end
  573. end
  574. end
  575. outmatrixreal = mean(matrixreal,3);
  576. outmatrixshuf = mean(matrixshuf,3);
  577. if savebeta
  578. outrealbetas = squeeze(mean(realbetas,2));
  579. outshufbetas = squeeze(mean(shufbetas,2));
  580. else
  581. outrealbetas = NaN;
  582. outshufbetas = NaN;
  583. end
  584. end

CA1PSAM_Decoding.m at commit 3ff88ad, no license · at the source

Overview

Authors: Conor C. Dorian1, Jiannis Taxidis2,3, Ahmet Arac1, Peyman Golshani1,4,5,6,7
  1. Department of Neurology, David Geffen School of Medicine, University of California, Los Angeles,Los Angeles, CA USA
  2. Program in Neurosciences and Mental Health, The Hospital for Sick Children,Toronto, ON Canada
  3. Department of Physiology, University of Toronto,Toronto, ON Canada
  4. Greater Los Angeles Veteran Affairs Medical Center, Los Angeles, CA USA
  5. Intellectual and Developmental Disabilities Research Center, University of California, Los Angeles,Los Angeles, CA USA
  6. Semel Institute for Neuroscience and Human Behavior, University of California,Los Angeles, CA USA
  7. Integrative Center for Learning and Memory, University of California,Los Angeles, CA USA
Journal: Nature communications, volume 17, issue 1, article 5098
Dates: received 24 June 2025; accepted 23 March 2026; published online 10 April 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-71503-y · PMID 41963333 · PMCID PMC13247236 · OpenAlex W7153008388
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism)
Methods: Statistics, Preprocessing, fMRI & imaging, Single-unit activity, calcium imaging, Machine learning
Keywords: Neural circuits, Hippocampus, Working memory
MeSH: CA1 Region, Hippocampal*, Entorhinal Cortex*, Hippocampus*, Neuronal Plasticity*, Animals, Calcium, Cues, Male, Memory, Short-Term, Mice, Mice, Inbred C57BL, Odorants, Optogenetics, Pyramidal Cells (* major topic)
Topic: Olfactory and Sensory Function Studies (Sensory Systems, Neuroscience), according to OpenAlex
Funding: NINDS (T32DGE1829071, 5T32NS045540-20, R01NS116589, 1P50HD103557-01, K08NS109315); Whitehall Foundation (Whitehall Foundation, Inc.)
Citations: cited by 3 papers (Europe PMC); 63 references in the paper

Abstract

Behavioral timescale synaptic plasticity (BTSP) is a form of synaptic potentiation where a single plateau potential in hippocampal neurons forms a place field during spatial learning. However, it remains unknown whether BTSP also forms non-spatial responses and what roles the medial and lateral entorhinal cortex (MEC and LEC) play in driving non-spatial BTSP. Using two-photon calcium imaging of CA1 pyramidal neurons in mice learning an odor-cued working memory task, we observed spontaneously-occurring large plateau-like calcium events during odor cues, forming stable odor representations. Using holographic optogenetics, we induced similar plateau-like calcium events in single neurons that were followed by novel odor representations. Chemogenetic inhibition of MEC reduced the frequency of plateau-like events, whereas LEC inhibition reduced their efficiency in forming odor representations. Together, our findings demonstrate that rare large somatic calcium events, consistent with BTSP, precede and drive novel odor representations in a manner differentially regulated by medial and lateral entorhinal cortex.

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

Repository

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

ccdorian/NonSpatialBTSP2026

License: none: the authors keep all their rights
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 3ff88ad870bab11eb1853e971a2745fe9044ec39, 3 March 2026
Languages: MATLAB (96)
Size: 100 files, 96 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, documentation
Not found: license file, CITATION.cff, environment file, tests, continuous integration
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
97 files

Code availability

All analysis code use for preprocessing, analysis, and making figures is available on GitHub (https://github.com/ccdorian/NonSpatialBTSP2026).

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

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;
  • 96 scripts, each with its path and the digest of its content;
  • 18 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

Datasets cited

Data availability

All processed data generated in this study has been deposited in the Dryad database (10.5061/dryad.573n5tbpp). Data generated for all figures and tables in this study are provided in the Source Data file. Source data are provided with this paper.

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

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 3 keywords, 14 MeSH terms, 2 funders, 62 references.

Cite

This paper

Dorian, C. C., Taxidis, J., Arac, A., & Golshani, P. (2026). Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input. Nature communications, 17(1), 5098. https://doi.org/10.1038/s41467-026-71503-y

BibTeX

@article{dorian2026rapid,
author = {Dorian, Conor C. and Taxidis, Jiannis and Arac, Ahmet and Golshani, Peyman},
title = {{Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5098},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-71503-y},
url = {https://doi.org/10.1038/s41467-026-71503-y},
pmid = {41963333},
pmcid = {PMC13247236}
}

RIS

TY - JOUR
AU - Dorian, Conor C.
AU - Taxidis, Jiannis
AU - Arac, Ahmet
AU - Golshani, Peyman
TI - Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/04/10
VL - 17
IS - 1
SP - 5098
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-71503-y
UR - https://doi.org/10.1038/s41467-026-71503-y
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-71503-y",
"type": "article-journal",
"title": "Rapid formation of non-spatial hippocampal representations consistent with behavioral timescale synaptic plasticity is modulated by entorhinal input",
"container-title": "Nature communications",
"author": [
{
"family": "Dorian",
"given": "Conor C."
},
{
"family": "Taxidis",
"given": "Jiannis"
},
{
"family": "Arac",
"given": "Ahmet"
},
{
"family": "Golshani",
"given": "Peyman"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "5098",
"DOI": "10.1038/s41467-026-71503-y",
"PMID": "41963333",
"PMCID": "PMC13247236",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-71503-y",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
10
]
]
}
}

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.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 Neuroscience
In common: mouse, 10 references
[2] 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 reports
In common: 9 references
[3] doi:10.1038/s41467-026-75492-w [code]
Place and behavioral modulation of hippocampal neurons during immobility.
Journal: Nature communications
In common: Statistics and Machine Learning Toolbox, mouse, 8 references
[4] doi:10.7554/elife.108352 [code]
Analysis of dendritic input currents during place field dynamics.
Journal: eLife
In common: 8 references
[5] 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: Optimization Toolbox, Image Processing Toolbox, Statistics and Machine Learning Toolbox, mouse, 5 references
[6] 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 communications
In common: mouse, 7 references
[7] 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: Optimization Toolbox, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 3 references
[8] 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, Statistics and Machine Learning Toolbox, mouse, 3 references
[9] doi:10.1038/s41586-026-10537-0 [code]
Sparse-to-dense coding transformation between hippocampal areas CA3 and CA1.
Journal: Nature
In common: 6 references
[10] doi:10.1038/s41467-026-77240-6
Prefrontal-thalamic goal states organize spatially aligned hippocampal maps.
Journal: Nature communications
In common: 6 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.

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.