The entorhinal spatial map integrates visual identity information of landmarks.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 885 lines · 21 KB · Apache-2.0
- copyfile('D:\GarretData\IdenticalCueData\environmentTemplate\temp_ENV2.mat','temp_ENV2.mat');
- copyfile('D:\GarretData\IdenticalCueData\environmentTemplate\ENV2_CueBins.mat','ENV2_CueBins.mat');
- load('temp_ENV2.mat');
- load('ENV2_CueBins.mat');
- temp=temp_ENV2; %cue template
- c=ENV2_CueBins;
- % use 95 percentile
- load('D:\GarretData\IdenticalCueData\tracks234\cueCellsEachDay\cell95Idx.mat');
- load('D:\GarretData\IdenticalCueData\allFolders.mat');
- env=2;
- day=1;
- %calculate amplitude difference using both peak or mean
- % for sequence correlation:
- %creat folders and cell idx
- useIdx=cell95Idx(:,env-1);
- useFolders={};
- p=pwd;
- for n=1:length(allFolders)
- cd(allFolders{n});
- load('allDayEnv.mat')
- cd(allDayEnv{env}{day});
- d=dir('TSeries-*');
- for m=1:length(d)
- useFolders{end+1}=[d(m).folder '\' d(m).name '\suite2p'];
- end
- end
- cd(p)
- save('useIdx.mat','useIdx')
- save('useFolders.mat','useFolders');
- %%
- binWidth=5;
- %move cue identify to the first column
- cues=[];
- cues(:,1)=c(:,3);%first column: cue identify 1 and 2: same number is the same cue
- cues(:,[2 3])=c(:,[1 2]); %second and third columns: cue start and end
- cues(:,4)=(cues(:,3)+cues(:,2))/2-0.5; %cue center in bin: for the cues with add number of bins, this is the end of the second bin
- cues(:,5)=cues(:,4)*5; %cue center in cm
- save('temp.mat','temp');
- save('cues.mat','cues');
- figure,plot(temp)
- for n=1:size(cues,1);
- if cues(n,1)==1;
- hold on
- plot([cues(n,2):1:cues(n,3)],1,'g.');
- else
- hold on
- plot([cues(n,2):1:cues(n,3)],1,'m.');
- end
- end
- saveas(gcf,'templatePlot.fig')
- close
- %%
- %all distances
- allDistancesI=[];%all distances betwen identical cues: cue numbers are the row numbers in "cues"
- allDistancesNI=[];%all distances betwen non-identical cues: cue numbers are the row numbers in "cues"
- %first column is one cue, second column is the second cue, the third column is their distances in bins, and the last one
- %is their distances in cm.
- %identical cue combinations
- idxI=[];
- %the both types of cue
- cueType=[1 2];
- for ct=1:length(cueType)
- i=find(cues(:,1)==cueType(ct));
- for n=1:length(i)-1;
- for m=n+1:length(i);
- thisPair=[i(n) i(m)];
- idxI=[idxI;thisPair];
- end
- end
- end
- allDistancesI=idxI;%the first and second columns are the two cues
- %the 3rd column is the distance between cue centers by bin
- for n=1:size(allDistancesI,1);
- allDistancesI(n,3)=abs(cues(allDistancesI(n,1),4)-cues(allDistancesI(n,2),4));
- allDistancesI(n,4)=allDistancesI(n,3)*binWidth;
- end
- [~,i]=sort(allDistancesI(:,4));
- allDistancesI=allDistancesI(i,:);
- %non identical cue combinations
- idxNI=[];
- %the first type of cue
- i1=find(cues(:,1)==1);
- i2=find(cues(:,1)==2);
- for n=1:length(i1);
- for m=1:length(i2);
- thisPair=[i1(n) i2(m)];
- idxNI=[idxNI;thisPair];
- end
- end
- allDistancesNI=idxNI;%the first and second columns are the two cues
- %the 3rd column is the distance between cue centers by bin
- for n=1:size(allDistancesNI,1);
- allDistancesNI(n,3)=abs(cues(allDistancesNI(n,1),4)-cues(allDistancesNI(n,2),4));
- allDistancesNI(n,4)=allDistancesNI(n,3)*binWidth;
- end
- [~,i]=sort(allDistancesNI(:,4));
- allDistancesNI=allDistancesNI(i,:);
- save('allDistancesNI.mat','allDistancesNI');
- save('allDistancesI.mat','allDistancesI');
- % group the same distances in cells
- allDistancesIGroup={};
- allDistancesIGroup{1}=allDistancesI([1 2],:);
- allDistancesIGroup{2}=allDistancesI(3,:);
- allDistancesIGroup{3}=allDistancesI(4,:);
- allDistancesIGroup{4}=allDistancesI(5,:);
- allDistancesIGroup{5}=allDistancesI(6,:);
- allDistancesIGroup{6}=allDistancesI(7,:);
- allDistancesNIGroup={};
- allDistancesNIGroup{1}=allDistancesNI(1,:);
- allDistancesNIGroup{2}=allDistancesNI([2 3],:);
- allDistancesNIGroup{3}=allDistancesNI(4,:);
- allDistancesNIGroup{4}=allDistancesNI(5,:);
- allDistancesNIGroup{5}=allDistancesNI(6,:);
- allDistancesNIGroup{6}=allDistancesNI(7,:);
- allDistancesNIGroup{7}=allDistancesNI(8,:);
- save('allDistancesNIGroup.mat','allDistancesNIGroup');
- save('allDistancesIGroup.mat','allDistancesIGroup');
- %% amplitude differences
- load('useIdx.mat');
- load('useFolders.mat')
- load('allDistancesIGroup.mat')
- load('allDistancesNIGroup.mat')
- p=pwd;
- cueCellDataThresh=95;
- [ampDiffIMean,ampDiffNIMean,ampDiffIPeak,ampDiffNIPeak] = ampDiff(useIdx,useFolders,allDistancesIGroup,allDistancesNIGroup,cueCellDataThresh);
- save('ampDiffIMean.mat','ampDiffIMean');
- save('ampDiffIPeak.mat','ampDiffIPeak');
- save('ampDiffNIMean.mat','ampDiffNIMean');
- save('ampDiffNIPeak.mat','ampDiffNIPeak');
- %% plot them
- ampDiffIMeanAll={};% if there are two cells, merge them
- ampDiffIMeanMean=[];%mean
- ampDiffIMeanSEM=[];
- for n=1:length(ampDiffIMean);
- a=ampDiffIMean{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- ampDiffIMeanAll{n}=aa;
- ampDiffIMeanMean(n)=nanmean(aa);
- ampDiffIMeanSEM(n)=nansem(aa,2);
- end
- ampDiffIPeakAll={};% if there are two cells, merge them
- ampDiffIPeakMean=[];%mean
- ampDiffIPeakSEM=[];
- for n=1:length(ampDiffIPeak);
- a=ampDiffIPeak{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- ampDiffIPeakAll{n}=aa;
- ampDiffIPeakMean(n)=nanmean(aa);
- ampDiffIPeakSEM(n)=nansem(aa,2);
- end
- distanceOnlyI=unique(allDistancesI(:,end));
- ampDiffNIMeanAll={};% if there are two cells, merge them
- ampDiffNIMeanMean=[];%mean
- ampDiffNIMeanSEM=[];
- for n=1:length(ampDiffNIMean);
- a=ampDiffNIMean{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- ampDiffNIMeanAll{n}=aa;
- ampDiffNIMeanMean(n)=nanmean(aa);
- ampDiffNIMeanSEM(n)=nansem(aa,2);
- end
- ampDiffNIPeakAll={};% if there are two cells, merge them
- ampDiffNIPeakMean=[];%mean
- ampDiffNIPeakSEM=[];
- for n=1:length(ampDiffNIPeak);
- a=ampDiffNIPeak{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- ampDiffNIPeakAll{n}=aa;
- ampDiffNIPeakMean(n)=nanmean(aa);
- ampDiffNIPeakSEM(n)=nansem(aa,2);
- end
- distanceOnlyNI=unique(allDistancesNI(:,end));
- figure
- subplot(221)
- errorbar(distanceOnlyI,ampDiffIMeanMean,ampDiffIMeanSEM,'g')
- hold on
- errorbar(distanceOnlyNI,ampDiffNIMeanMean,ampDiffNIMeanSEM,'m')
- title('ampDifferences mean');
- subplot(222)
- errorbar(distanceOnlyI,ampDiffIPeakMean,ampDiffIPeakSEM,'g')
- hold on
- errorbar(distanceOnlyNI,ampDiffNIPeakMean,ampDiffNIPeakSEM,'m')
- title('ampDifferences peak');
- %no distances, just include all
- I=cell2mat(ampDiffIMeanAll);
- NI=cell2mat(ampDiffNIMeanAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(ampDiffIPeakAll);
- NI=cell2mat(ampDiffNIPeakAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- saveas(gcf,'ampDifferences.fig')
- %only use matched distances
- idxI=[1 3 5 6];
- idxNI=[1 3 5 6];
- figure
- subplot(221)
- errorbar(distanceOnlyI(idxI),ampDiffIMeanMean(idxI),ampDiffIMeanSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),ampDiffNIMeanMean(idxNI),ampDiffNIMeanSEM(idxNI),'m')
- %STATs
- ITemp=ampDiffIMeanAll(idxI);
- NITemp=ampDiffNIMeanAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['ampDifferences mean pAnova',num2str(pAnova(1))]);
- subplot(222)
- errorbar(distanceOnlyI(idxI),ampDiffIPeakMean(idxI),ampDiffIPeakSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),ampDiffNIPeakMean(idxNI),ampDiffNIPeakSEM(idxNI),'m')
- %STATs
- ITemp=ampDiffIPeakAll(idxI);
- NITemp=ampDiffNIPeakAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['ampDifferences peak pAnova',num2str(pAnova(1))]);
- %no distances, just include all
- I=cell2mat(ampDiffIMeanAll(idxI));
- NI=cell2mat(ampDiffNIMeanAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(ampDiffIPeakAll(idxI));
- NI=cell2mat(ampDiffNIPeakAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- saveas(gcf,'ampDifferencesMatchedDistance.fig')
- %% get all lags
- cueCellDataThresh=95;
- load('useIdx.mat');
- load('useFolders.mat');
- p=pwd;
- lags={};
- for n=1:length(useIdx);
- lags{n}=[];
- disp(n)
- cd(useFolders{n});
- cells=useIdx{n};
- if cueCellDataThresh==95;
- filename1='cueAnalysis_sig\newScoreShuffleTemplate\cueCellsAllThresh.mat';
- filename2='cueCellsAllThresh';
- else
- filename1=sprintf('%s%d.mat','cueAnalysis_sig\newScoreShuffleTemplate\cueCellsAllThresh',cueCellDataThresh);
- filename2=['cueCellsAllThresh',num2str(cueCellDataThresh)];
- end
- load(filename1);
- data=eval(filename2);
- [~,useCellIdx,~]=intersect(data.realIdx,cells);
- lags{n}=data.lags(useCellIdx);
- end
- cd(p);
- save('lags.mat','lags');
- %% get all dfofs
- cueCellDataThresh=95;
- load('useIdx.mat');
- load('useFolders.mat');
- p=pwd;
- dfofs={};
- for n=1:length(useIdx);
- dfofs{n}=[];
- disp(n)
- cd(useFolders{n});
- cells=useIdx{n};
- if cueCellDataThresh==95;
- filename1='cueAnalysis_sig\newScoreShuffleTemplate\cueCellsAllThresh.mat';
- filename2='cueCellsAllThresh';
- else
- filename1=sprintf('%s%d.mat','cueAnalysis_sig\newScoreShuffleTemplate\cueCellsAllThresh',cueCellDataThresh);
- filename2=['cueCellsAllThresh',num2str(cueCellDataThresh)];
- end
- load(filename1);
- data=eval(filename2);
- [~,useCellIdx,~]=intersect(data.realIdx,cells);
- dfofs{n}=data.dfofAvg(:,useCellIdx);
- end
- cd(p);
- save('dfofs.mat','dfofs');
- %% calculate correlation
- load('useIdx.mat');
- load('useFolders.mat')
- load('allDistancesIGroup.mat')
- load('allDistancesNIGroup.mat')
- p=pwd;
- cueCellDataThresh=95;
- % number of cells per sequence
- NCell=15;
- % number of shuffles
- NShuffle=100;
- NCellFolders=[];
- for n=1:length(useIdx);
- NCellFolders(n)=length(useIdx{n});
- end
- iUse=find(NCellFolders>NCell);
- useIdxN=useIdx(iUse);
- useFoldersN=useFolders(iUse);
- [randomCells,corrIMean,corrNIMean,corrIPeak,corrNIPeak] = corrAtCues_NCellFOV(useIdxN,useFoldersN,allDistancesIGroup,allDistancesNIGroup,cueCellDataThresh,NCell);
- save('corrIMean.mat','corrIMean');
- save('corrIPeak.mat','corrIPeak');
- save('corrNIMean.mat','corrNIMean');
- save('corrNIPeak.mat','corrNIPeak');
- save('randomCells.mat','randomCells');
- %% plot corr
- corrIMeanAll={};% if there are two cells, merge them
- corrIMeanMean=[];%mean
- corrIMeanSEM=[];
- for n=1:length(corrIMean);
- a=corrIMean{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrIMeanAll{n}=aa;
- corrIMeanMean(n)=nanmean(aa);
- corrIMeanSEM(n)=nansem(aa,2);
- end
- corrIPeakAll={};% if there are two cells, merge them
- corrIPeakMean=[];%mean
- corrIPeakSEM=[];
- for n=1:length(corrIPeak);
- a=corrIPeak{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrIPeakAll{n}=aa;
- corrIPeakMean(n)=nanmean(aa);
- corrIPeakSEM(n)=nansem(aa,2);
- end
- distanceOnlyI=unique(allDistancesI(:,end));
- corrNIMeanAll={};% if there are two cells, merge them
- corrNIMeanMean=[];%mean
- corrNIMeanSEM=[];
- for n=1:length(corrNIMean);
- a=corrNIMean{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrNIMeanAll{n}=aa;
- corrNIMeanMean(n)=nanmean(aa);
- corrNIMeanSEM(n)=nansem(aa,2);
- end
- corrNIPeakAll={};% if there are two cells, merge them
- corrNIPeakMean=[];%mean
- corrNIPeakSEM=[];
- for n=1:length(corrNIPeak);
- a=corrNIPeak{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrNIPeakAll{n}=aa;
- corrNIPeakMean(n)=nanmean(aa);
- corrNIPeakSEM(n)=nansem(aa,2);
- end
- distanceOnlyNI=unique(allDistancesNI(:,end));
- figure
- subplot(221)
- errorbar(distanceOnlyI,corrIMeanMean,corrIMeanSEM,'g')
- hold on
- errorbar(distanceOnlyNI,corrNIMeanMean,corrNIMeanSEM,'m')
- title('corr mean');
- subplot(222)
- errorbar(distanceOnlyI,corrIPeakMean,corrIPeakSEM,'g')
- hold on
- errorbar(distanceOnlyNI,corrNIPeakMean,corrNIPeakSEM,'m')
- title('corr peak');
- %no distances, just include all
- I=cell2mat(corrIMeanAll);
- NI=cell2mat(corrNIMeanAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(corrIPeakAll);
- NI=cell2mat(corrNIPeakAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- filename=sprintf('%s_%d_%s_%d.fig', 'corrNCell', NCell,'NShuffle',NShuffle);
- saveas(gcf,filename)
- figure
- subplot(221)
- errorbar(distanceOnlyI(idxI),corrIMeanMean(idxI),corrIMeanSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),corrNIMeanMean(idxNI),corrNIMeanSEM(idxNI),'m')
- %STATs
- ITemp=corrIMeanAll(idxI);
- NITemp=corrNIMeanAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['corr mean pAnova',num2str(pAnova(1))]);
- subplot(222)
- errorbar(distanceOnlyI(idxI),corrIPeakMean(idxI),corrIPeakSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),corrNIPeakMean(idxNI),corrNIPeakSEM(idxNI),'m')
- %STATs
- ITemp=corrIPeakAll(idxI);
- NITemp=corrNIPeakAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['corr peak pAnova',num2str(pAnova(1))]);
- %no distances, just include all
- I=cell2mat(corrIMeanAll(idxI));
- NI=cell2mat(corrNIMeanAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(corrIPeakAll(idxI));
- NI=cell2mat(corrNIPeakAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- filename=sprintf('%s_%d_%s_%d_%s.fig', 'corrNCell', NCell,'NShuffle',NShuffle,'matchedDistance');
- saveas(gcf,filename)
- %% calculate correlation
- load('useIdx.mat');
- load('useFolders.mat')
- load('allDistancesIGroup.mat')
- load('allDistancesNIGroup.mat')
- p=pwd;
- cueCellDataThresh=95;
- % % number of cells per sequence
- % NCell=15;
- % % number of shuffles
- % NShuffle=100;
- [corrIMeanNoShuffle,corrNIMeanNoShuffle,corrIPeakNoShuffle,corrNIPeakNoShuffle] = corrAtCuesNoShuffle(useIdx,useFolders,allDistancesIGroup,allDistancesNIGroup,cueCellDataThresh);
- save('corrIMeanNoShuffle.mat','corrIMeanNoShuffle');
- save('corrIPeakNoShuffle.mat','corrIPeakNoShuffle');
- save('corrNIMeanNoShuffle.mat','corrNIMeanNoShuffle');
- save('corrNIPeakNoShuffle.mat','corrNIPeakNoShuffle');
- %% plot corr
- corrIMeanNoShuffleAll={};% if there are two cells, merge them
- corrIMeanNoShuffleMean=[];%mean
- corrIMeanNoShuffleSEM=[];
- for n=1:length(corrIMeanNoShuffle);
- a=corrIMeanNoShuffle{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrIMeanNoShuffleAll{n}=aa;
- corrIMeanNoShuffleMean(n)=nanmean(aa);
- corrIMeanNoShuffleSEM(n)=nansem(aa,2);
- end
- corrIPeakNoShuffleAll={};% if there are two cells, merge them
- corrIPeakNoShuffleMean=[];%mean
- corrIPeakNoShuffleSEM=[];
- for n=1:length(corrIPeakNoShuffle);
- a=corrIPeakNoShuffle{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrIPeakNoShuffleAll{n}=aa;
- corrIPeakNoShuffleMean(n)=nanmean(aa);
- corrIPeakNoShuffleSEM(n)=nansem(aa,2);
- end
- distanceOnlyI=unique(allDistancesI(:,end));
- corrNIMeanNoShuffleAll={};% if there are two cells, merge them
- corrNIMeanNoShuffleMean=[];%mean
- corrNIMeanNoShuffleSEM=[];
- for n=1:length(corrNIMeanNoShuffle);
- a=corrNIMeanNoShuffle{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrNIMeanNoShuffleAll{n}=aa;
- corrNIMeanNoShuffleMean(n)=nanmean(aa);
- corrNIMeanNoShuffleSEM(n)=nansem(aa,2);
- end
- corrNIPeakNoShuffleAll={};% if there are two cells, merge them
- corrNIPeakNoShuffleMean=[];%mean
- corrNIPeakNoShuffleSEM=[];
- for n=1:length(corrNIPeakNoShuffle);
- a=corrNIPeakNoShuffle{n};
- for m=1:length(a);
- a{m}=a{m}';
- end
- aa=nanmean(cell2mat(a),2)';
- corrNIPeakNoShuffleAll{n}=aa;
- corrNIPeakNoShuffleMean(n)=nanmean(aa);
- corrNIPeakNoShuffleSEM(n)=nansem(aa,2);
- end
- distanceOnlyNI=unique(allDistancesNI(:,end));
- figure
- subplot(221)
- errorbar(distanceOnlyI,corrIMeanNoShuffleMean,corrIMeanNoShuffleSEM,'g')
- hold on
- errorbar(distanceOnlyNI,corrNIMeanNoShuffleMean,corrNIMeanNoShuffleSEM,'m')
- title('corr mean');
- subplot(222)
- errorbar(distanceOnlyI,corrIPeakNoShuffleMean,corrIPeakNoShuffleSEM,'g')
- hold on
- errorbar(distanceOnlyNI,corrNIPeakNoShuffleMean,corrNIPeakNoShuffleSEM,'m')
- title('corr peak');
- %no distances, just include all
- I=cell2mat(corrIMeanNoShuffleAll);
- NI=cell2mat(corrNIMeanNoShuffleAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(corrIPeakNoShuffleAll);
- NI=cell2mat(corrNIPeakNoShuffleAll);
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- saveas(gcf,'corrNCellNoShuffle.fig')
- figure
- subplot(221)
- errorbar(distanceOnlyI(idxI),corrIMeanNoShuffleMean(idxI),corrIMeanNoShuffleSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),corrNIMeanNoShuffleMean(idxNI),corrNIMeanNoShuffleSEM(idxNI),'m')
- %STATs
- ITemp=corrIMeanNoShuffleAll(idxI);
- NITemp=corrNIMeanNoShuffleAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['corr mean pAnova',num2str(pAnova(1))]);
- subplot(222)
- errorbar(distanceOnlyI(idxI),corrIPeakNoShuffleMean(idxI),corrIPeakNoShuffleSEM(idxI),'g')
- hold on
- errorbar(distanceOnlyNI(idxNI),corrNIPeakNoShuffleMean(idxNI),corrNIPeakNoShuffleSEM(idxNI),'m')
- %STATs
- ITemp=corrIPeakNoShuffleAll(idxI);
- NITemp=corrNIPeakNoShuffleAll(idxNI);
- I=[];
- NI=[];
- for n=1:length(idxI);
- I(:,n)=ITemp{n}';
- NI(:,n)=NITemp{n}';
- end
- [pAnova,pMC,pLabel] = anovaRM2W_full_BH(I,NI,1);
- title(['corr mean pAnova',num2str(pAnova(1))]);
- %no distances, just include all
- I=cell2mat(corrIMeanNoShuffleAll(idxI));
- NI=cell2mat(corrNIMeanNoShuffleAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(223)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['mean p=',num2str(p1)])
- %no distances, just include all
- I=cell2mat(corrIPeakNoShuffleAll(idxI));
- NI=cell2mat(corrNIPeakNoShuffleAll(idxNI));
- M=[];
- M(1)=nanmean(I);
- M(2)=nanmean(NI);
- S=[];
- S(1)=nansem(I,2);
- S(2)=nansem(NI,2);
- subplot(224)
- bar([1 2],M)
- hold on
- errorbar([1 2],M,S,'.')
- names={'Iden'; 'Noniden' };
- set(gca,'xticklabel',names)
- [r,p1]=ttest2(I,NI);
- title(['Peak p=',num2str(p1)])
- saveas(gcf,'corrNCellNoShuffle_matchedDistance.fig')
ampAndCorr.m at commit 76eb11a, under Apache-2.0 · at the source
Overview
- Spatial Navigation and Memory Unit, National Institute of Neurological Disorders and Stroke, National Institutes of Health,Bethesda, MD USA
- Present Address: Medical Scientist Training Program, Medical College of Wisconsin,Milwaukee, WI USA
- Present Address: Division of Clinical Geriatrics, Center for Alzheimer Research, Department of Neurobiology, Care Sciences and Society, Karolinska Institutet,Stockholm, Sweden
- Present Address: Department of Psychological and Brain Sciences, University of California, Santa Barbara,Santa Barbara, CA USA
Abstract
Landmarks guide navigation by providing information through their location and identity. The medial entorhinal cortex (MEC) is well known for representing landmark location, but whether it also encodes landmark identity remains unclear. Here we show, using two-photon calcium imaging of MEC neurons in mice navigating multiple virtual environments, that a population of neurons known as cue cells encodes landmark identity. Cue cells respond selectively to individual landmarks and produce more distinct activity patterns for visually disparate landmarks than for identical ones. Identity encoding is modulated by the spatial shift of cue cell activity relative to landmark location and is context dependent, changing across environments, but remaining stable within the same environment despite repeated experience. In contrast, cue cells’ representation of landmark location changes with experience. Grid cells, another major MEC cell type, more strongly represent landmark location, but only weakly encode identity. These findings suggest that the MEC integrates both the location and identity of landmarks to support navigation.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
GuLab-NIH/Wang-and-Shahid-2026
76eb11afe5dd89df7dc8bb9506de4578bc35161a, 19 March 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
24 files
- ampAndCorr.m, MATLAB, 885 lines
- ampAndCorrPerFOV.m, MATLAB, 285 lines
- ampAndCorrPerMouse.m, MATLAB, 285 lines
- ampDiff.m, MATLAB, 152 lines
- ampDiffGrid.m, MATLAB, 159 lines
- ampDiff_inputBin.m, MATLAB, 173 lines
- ampDiff_inputBinAwayBin.
m , MATLAB, 184 lines - corrAtCues.m, MATLAB, 271 lines
- corrAtCuesNoShuffle.m, MATLAB, 278 lines
- corrAtCuesNoShuffleAllId
xFov.m , MATLAB, 290 lines - corrAtCuesNoShuffleAllId
xFovGrid.m , MATLAB, 298 lines - corrAtCuesNoShuffleAllId
xFov_inputBin.m , MATLAB, 307 lines - corrAtCuesNoShuffleAllId
xFov_inputBinAwayBin.m , MATLAB, 318 lines - corrAtCuesNoShuffle_inpu
tBin.m , MATLAB, 297 lines - corrAtCues_NCellFOV.m, MATLAB, 281 lines
- corrAtCues_NCellFOVNonCu
e.m , MATLAB, 290 lines - lagPlotForPaper.m, MATLAB, 444 lines
- lagPlotForPaper_corr.m, MATLAB, 214 lines
- matchDis_amp.m, MATLAB, 588 lines
- matchDis_corr.m, MATLAB, 588 lines
- violinForAmpAllDistances
.m , MATLAB, 139 lines - violinForCorrAllDistance
s.m , MATLAB, 139 lines - LICENSE, License, 201 lines
- README.md, Text, 2 lines
Code availability
Custom code used for the analysis of data is available on GitHub [https://
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;
- 22 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- 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
- zenodo:19115394, at Zenodo; found in “Data availability”
Data availability
Data generated in this study have been deposited in Zenodo [10.5281/
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, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 2 keywords, 9 MeSH terms, 1 funder, 59 references.
Cite
This paper
Wang, G., Shahid, F., Malone, T. J., Tyan, J., Cekada, K., Chen, L., & Gu, Y. (2026). The entorhinal spatial map integrates visual identity information of landmarks. Nature communications, 17(1), 6164. https://
BibTeX
@article{wang2026entorhi
author = {Wang, Garret and Shahid, Farid and Malone, Taylor J. and Tyan, Jean and Cekada, Kyle and Chen, Lujia and Gu, Yi},
title = {{The entorhinal spatial map integrates visual identity information of landmarks}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {6164},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42098095},
pmcid = {PMC13365227}
}
RIS
TY - JOUR
AU - Wang, Garret
AU - Shahid, Farid
AU - Malone, Taylor J.
AU - Tyan, Jean
AU - Cekada, Kyle
AU - Chen, Lujia
AU - Gu, Yi
TI - The entorhinal spatial map integrates visual identity information of landmarks
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 6164
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "The entorhinal spatial map integrates visual identity information of landmarks",
"container-title": "Nature communications",
"author": [
{
"family": "Wang",
"given": "Garret"
},
{
"family": "Shahid",
"given": "Farid"
},
{
"family": "Malone",
"given": "Taylor J."
},
{
"family": "Tyan",
"given": "Jean"
},
{
"family": "Cekada",
"given": "Kyle"
},
{
"family": "Chen",
"given": "Lujia"
},
{
"family": "Gu",
"given": "Yi"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "6164",
"DOI": "10.1038/
"PMID": "42098095",
"PMCID": "PMC13365227",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
7
]
]
}
}
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.celrep.2024.114813 [code]
- The medial entorhinal cortex encodes multisensory spatial information.Journal: Cell reportsIn common: Violinplot-Matlab, Statistics and Machine Learning Toolbox, mouse, 27 references, author Yi Gu
- [2] doi:10.1038/s41467-024-45853-4 [code]
- A consistent map in the medial entorhinal cortex supports spatial memory.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, mouse, 17 references, 2 authors
- [3] doi:10.1038/s42003-025-08241-2
- Object-translocation induces event coding in the rat hippocampus.Journal: Communications biologyIn common: 16 references
- [4] doi:10.1038/s41593-026-02240-0 [code]
- The dentate gyrus efficiently converges LEC and MEC inputs into multimodal, highly specific and reliable environmental representations.Journal: Nature neuroscienceIn common: Statistics and Machine Learning Toolbox, mouse, 15 references
- [5] doi:10.1038/s41467-024-54932-5 [code]
- Multiplexing of temporal and spatial information in the lateral entorhinal cortex.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 14 references
- [6] doi:10.7554/elife.83008 [code]
- Fan cells in lateral entorhinal cortex directly influence medial entorhinal cortex through synaptic connections in layer 1.Journal: eLifeIn common: mouse, 14 references
- [7] doi:10.1038/s42003-023-04958-0
- Rat hippocampal CA1 region represents learning-related action and reward events with shorter latency than the lateral entorhinal cortex.Journal: Communications biologyIn common: 12 references
- [8] doi:10.1016/j.isci.2025.113960
- Landmark vector cells in the absence of visual input.Journal: iScienceIn common: 11 references
- [9] doi:10.1016/j.celrep.2024.114470 [code]
- Retrosplenial inputs drive visual representations in the medial entorhinal cortex.Journal: Cell reportsIn common: Statistics and Machine Learning Toolbox, mouse, 10 references
- [10] doi:10.1038/s41586-024-08034-3 [code]
- One-shot entorhinal maps enable flexible navigation in novel environments.Journal: NatureIn common: Statistics and Machine Learning Toolbox, mouse, 10 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 22 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:7d4db2a47c3e1cee…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-72453-1)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-72453-1.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-72453-1
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-72453-1"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-72453-1.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
