Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex.
The 3 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Results › Progressive multi- over single-whisker response divergence in septal populations is abolished in Elfn1 KO mice ↔ eLife-VOR-RA-2025-107099/Source Code 3.m, lines 803–926 · score 0.59 · 7–20, KO SW, 1–20, KO MW, Layer, ratio
- [2] § Methods › t-SNE analysis ↔ eLife-VOR-RA-2025-107099/Source Code 3.m, lines 2352–2408 · score 0.52 · t-SNE, barneshut, exaggeration, gscatter, perplexity, algorithm
- [3] § Methods › t-SNE analysis ↔ eLife-VOR-RA-2025-107099/Source Code 5.m, the whole file · a weak match · score 0.51 · t-SNE, barneshut, exaggeration, gscatter, perplexity, algorithm
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 · 2,922 lines · 131 KB · no license · 2 matches
- %% Ali Özgür Argunşah, June, 2026
- %% https://doi.org/10.7554/eLife.107099.3
- %% Figure 1 and 4 and Supplements
- % Load Data
- clear all
- %%
- load('/Users/aargun/Documents/My Papers/Barrel-Septa/Elife_Revision/VOR_June25_2026/Data/Silicon Probe/NeighbourData_Sep2022.mat');
- load('/Users/aargun/Documents/My Papers/Barrel-Septa/Elife_Revision/VOR_June25_2026/Data/Silicon Probe/AllData_May2023.mat');
- load stim_raw.mat;
- saveFolder = '/Users/aargun/Documents/My Papers/Barrel-Septa/Elife_Revision/VOR_June25_2026/Exported';
- % Whisker Stim
- stimvec = stim(:,2)-mean(stim(1:100,2));
- stimvec_norm = stimvec/max(stimvec);
- begin = (2610-round(4000/5));
- stimvec_norm_synch = stimvec_norm(begin:begin+9199);
- t1 = (1:2200)/1000;
- t2 = (1:9200)/4182;
- stimvec_norm_synch_Fs1000 = interp1(t2',stimvec_norm_synch,t1','spline');
- %% Figure 1A - Waveform
- figure , plot((1:2200)/1000,100*stimvec_norm_synch_Fs1000,'LineWidth',1,'Color','k');
- title('Figure 1A - Waveform');
- figure , plot((1:9200)/4182,100*stimvec_norm_synch,'LineWidth',1,'Color','r');
- baselineTimes = 1:190;
- tempstim = stimvec_norm_synch_Fs1000;
- tempstim(tempstim>0.4*ones(2200,1)) = 0;
- [pks,locs] = findpeaks(tempstim,'MinPeakHeight',0.2);
- % beglocs = locs(1:2:end);
- % New BegLocs
- beglocs = [205 306 406 506 606 706 806 905 1004 1104 1204 1304 1404 1502 1602 1702 1802 1902 2000 2100 ];
- %%
- colorBarrel = [50,50,50]/255;%[31,120,180]/255;%[252 216 134]/255;
- colorSepta = [206,18,86]/255;%[51,160,44]/255;%[235 38 31]/255;
- colorNeigh = [8,81,156]/255;%[227,26,28]/255;%[188 128 219]/255;
- colorBarrelKO = [150,150,150]/255;%[177,89,40]/255;%[247 136 154]/255;
- colorSeptaKO = [201,148,199]/255;%[106,61,154]/255;%[31 38 235]/255;
- colorNeighKO = [78,179,211]/255;%[245,225,75]/255;%[162 238 135]/255;
- colorBarrel_MW = colorBarrel/2;%color1/2;%[252 216 134]/255;
- colorSepta_MW = colorSepta/2;%color2/2;%[235 38 31]/255;
- colorNeigh_MW = [];%color3/2;%[188 128 219]/255;
- colorBarrelKO_MW = colorBarrelKO/2;%color1ko/2;%[247 136 154]/255;
- colorSeptaKO_MW = colorSeptaKO/2;%color2ko/2;%[31 38 235]/255;
- colorNeighKO_MW = [];%color3ko/2;%[162 238 135]/255;
- %% MW Data Etraction
- counter = 1;
- temp_L23_WT_MW = [];
- for i = 1:size(jenqData.wt.barrel.L23.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.barrel.L23.multi.spktimes{i}{j}) = 1;
- temp_L23_WT_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L4_WT_MW = [];
- for i = 1:size(jenqData.wt.barrel.L4.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.barrel.L4.multi.spktimes{i}{j}) = 1;
- temp_L4_WT_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L5_WT_MW = [];
- for i = 1:size(jenqData.wt.barrel.L5.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.barrel.L5.multi.spktimes{i}{j}) = 1;
- temp_L5_WT_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L23_WT_MW_septa = [];
- for i = 1:size(jenqData.wt.septa.L23.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.septa.L23.multi.spktimes{i}{j}) = 1;
- temp_L23_WT_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L4_WT_MW_septa = [];
- for i = 1:size(jenqData.wt.septa.L4.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.septa.L4.multi.spktimes{i}{j}) = 1;
- temp_L4_WT_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L5_WT_MW_septa = [];
- for i = 1:size(jenqData.wt.septa.L5.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.wt.septa.L5.multi.spktimes{i}{j}) = 1;
- temp_L5_WT_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L23_KO_MW = [];
- for i = 1:size(jenqData.ko.barrel.L23.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.barrel.L23.multi.spktimes{i}{j}) = 1;
- temp_L23_KO_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L4_KO_MW = [];
- for i = 1:size(jenqData.ko.barrel.L4.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.barrel.L4.multi.spktimes{i}{j}) = 1;
- temp_L4_KO_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L5_KO_MW = [];
- for i = 1:size(jenqData.ko.barrel.L5.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.barrel.L5.multi.spktimes{i}{j}) = 1;
- temp_L5_KO_MW(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L23_KO_MW_septa = [];
- for i = 1:size(jenqData.ko.septa.L23.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.septa.L23.multi.spktimes{i}{j}) = 1;
- temp_L23_KO_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L4_KO_MW_septa = [];
- for i = 1:size(jenqData.ko.septa.L4.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.septa.L4.multi.spktimes{i}{j}) = 1;
- temp_L4_KO_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- counter = 1;
- temp_L5_KO_MW_septa = [];
- for i = 1:size(jenqData.ko.septa.L5.multi.spktimes,2)
- for j = 1:20
- temp = zeros(1,2200);
- temp(jenqData.ko.septa.L5.multi.spktimes{i}{j}) = 1;
- temp_L5_KO_MW_septa(counter,:) = temp;
- counter = counter + 1;
- end
- end
- %% Spontaneous Analysis
- LFP_Barrel_WT_L23_SW = cat(1,jenqData.wt.barrel.L23.single.LFP,jenqData.wt.barrel.L23.multi.LFP);
- MUA_Barrel_WT_L23_SW = cat(2,jenqData.wt.barrel.L23.single.MUA,jenqData.wt.barrel.L23.multi.MUA);
- MUA_Barrel_KO_L23_SW = cat(2,jenqData.ko.barrel.L23.single.MUA,jenqData.ko.barrel.L23.multi.MUA);
- MUA_Septa_WT_L23_SW = cat(2,jenqData.wt.septa.L23.single.MUA,jenqData.wt.septa.L23.multi.MUA);
- MUA_Septa_KO_L23_SW = cat(2,jenqData.ko.septa.L23.single.MUA,jenqData.ko.septa.L23.multi.MUA);
- MUA_Barrel_WT_L4_SW = cat(2,jenqData.wt.barrel.L4.single.MUA,jenqData.wt.barrel.L4.multi.MUA);
- MUA_Barrel_KO_L4_SW = cat(2,jenqData.ko.barrel.L4.single.MUA,jenqData.ko.barrel.L4.multi.MUA);
- MUA_Septa_WT_L4_SW = cat(2,jenqData.wt.septa.L4.single.MUA,jenqData.wt.septa.L4.multi.MUA);
- MUA_Septa_KO_L4_SW = cat(2,jenqData.ko.septa.L4.single.MUA,jenqData.ko.septa.L4.multi.MUA);
- MUA_Barrel_WT_L5_SW = cat(2,jenqData.wt.barrel.L5.single.MUA,jenqData.wt.barrel.L5.multi.MUA);
- MUA_Barrel_KO_L5_SW = cat(2,jenqData.ko.barrel.L5.single.MUA,jenqData.ko.barrel.L5.multi.MUA);
- MUA_Septa_WT_L5_SW = cat(2,jenqData.wt.septa.L5.single.MUA,jenqData.wt.septa.L5.multi.MUA);
- MUA_Septa_KO_L5_SW = cat(2,jenqData.ko.septa.L5.single.MUA,jenqData.ko.septa.L5.multi.MUA);
- ranksum(mean(MUA_Barrel_WT_L23_SW(1:200,:),1),mean(MUA_Barrel_KO_L23_SW(1:200,:),1))
- ranksum(mean(MUA_Septa_WT_L23_SW(1:200,:),1),mean(MUA_Septa_KO_L23_SW(1:200,:),1))
- ranksum(mean(MUA_Barrel_WT_L4_SW(1:200,:),1),mean(MUA_Barrel_KO_L4_SW(1:200,:),1))
- ranksum(mean(MUA_Septa_WT_L4_SW(1:200,:),1),mean(MUA_Septa_KO_L4_SW(1:200,:),1))
- ranksum(mean(MUA_Barrel_WT_L23_SW(1:200,:),1),mean(MUA_Septa_WT_L23_SW(1:200,:),1))
- ranksum(mean(MUA_Barrel_KO_L23_SW(1:200,:),1),mean(MUA_Septa_KO_L23_SW(1:200,:),1))
- %% Remove Baseline
- noBase_temp_L23_WT = temp_L23_WT-repmat(mean(temp_L23_WT(:,1:200),2),1,2200);
- noBase_temp_L23_WT_neigh = temp_L23_WT_neigh-repmat(mean(temp_L23_WT_neigh(:,1:200),2),1,2201);
- noBase_temp_L23_WT_septa = temp_L23_WT_septa-repmat(mean(temp_L23_WT_septa(:,1:200),2),1,2200);
- noBase_temp_L23_ko = temp_L23_ko-repmat(mean(temp_L23_ko(:,1:200),2),1,2200);
- noBase_temp_L23_KO_neigh = temp_L23_KO_neigh-repmat(mean(temp_L23_KO_neigh(:,1:200),2),1,2201);
- noBase_temp_L23_ko_septa = temp_L23_ko_septa-repmat(mean(temp_L23_ko_septa(:,1:200),2),1,2200);
- noBase_temp_L23_WT_MW = temp_L23_WT_MW-repmat(mean(temp_L23_WT_MW(:,1:200),2),1,2200);
- noBase_temp_L23_WT_MW_septa = temp_L23_WT_MW_septa-repmat(mean(temp_L23_WT_MW_septa(:,1:200),2),1,2200);
- noBase_temp_L23_KO_MW = temp_L23_KO_MW-repmat(mean(temp_L23_KO_MW(:,1:200),2),1,2200);
- noBase_temp_L23_KO_MW_septa = temp_L23_KO_MW_septa-repmat(mean(temp_L23_KO_MW_septa(:,1:200),2),1,2200);
- noBase_temp_L4_WT = temp_L4_WT-repmat(mean(temp_L4_WT(:,1:200),2),1,2200);
- noBase_temp_L4_WT_neigh = temp_L4_WT_neigh-repmat(mean(temp_L4_WT_neigh(:,1:200),2),1,2201);
- noBase_temp_L4_WT_septa = temp_L4_WT_septa-repmat(mean(temp_L4_WT_septa(:,1:200),2),1,2200);
- noBase_temp_L4_ko = temp_L4_ko-repmat(mean(temp_L4_ko(:,1:200),2),1,2200);
- noBase_temp_L4_KO_neigh = temp_L4_KO_neigh-repmat(mean(temp_L4_KO_neigh(:,1:200),2),1,2201);
- noBase_temp_L4_ko_septa = temp_L4_ko_septa-repmat(mean(temp_L4_ko_septa(:,1:200),2),1,2200);
- noBase_temp_L4_WT_MW = temp_L4_WT_MW-repmat(mean(temp_L4_WT_MW(:,1:200),2),1,2200);
- noBase_temp_L4_WT_MW_septa = temp_L4_WT_MW_septa-repmat(mean(temp_L4_WT_MW_septa(:,1:200),2),1,2200);
- noBase_temp_L4_KO_MW = temp_L4_KO_MW-repmat(mean(temp_L4_KO_MW(:,1:200),2),1,2200);
- noBase_temp_L4_KO_MW_septa = temp_L4_KO_MW_septa-repmat(mean(temp_L4_KO_MW_septa(:,1:200),2),1,2200);
- noBase_temp_L5_WT = temp_L5_WT-repmat(mean(temp_L5_WT(:,1:200),2),1,2200);
- noBase_temp_L5_WT_neigh = temp_L5_WT_neigh-repmat(mean(temp_L5_WT_neigh(:,1:200),2),1,2201);
- noBase_temp_L5_WT_septa = temp_L5_WT_septa-repmat(mean(temp_L5_WT_septa(:,1:200),2),1,2200);
- noBase_temp_L5_ko = temp_L5_ko-repmat(mean(temp_L5_ko(:,1:200),2),1,2200);
- noBase_temp_L5_KO_neigh = temp_L5_KO_neigh-repmat(mean(temp_L5_KO_neigh(:,1:200),2),1,2201);
- noBase_temp_L5_ko_septa = temp_L5_ko_septa-repmat(mean(temp_L5_ko_septa(:,1:200),2),1,2200);
- noBase_temp_L5_WT_MW = temp_L5_WT_MW-repmat(mean(temp_L5_WT_MW(:,1:200),2),1,2200);
- noBase_temp_L5_WT_MW_septa = temp_L5_WT_MW_septa-repmat(mean(temp_L5_WT_MW_septa(:,1:200),2),1,2200);
- noBase_temp_L5_KO_MW = temp_L5_KO_MW-repmat(mean(temp_L5_KO_MW(:,1:200),2),1,2200);
- noBase_temp_L5_KO_MW_septa = temp_L5_KO_MW_septa-repmat(mean(temp_L5_KO_MW_septa(:,1:200),2),1,2200);
- %% Figures
- % Figure 1 Figure Supplement 3A - Barrel
- figure , bar(mean(temp_L23_WT),2,'FaceColor',colorBarrel,'LineWidth',15);
- set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_Barrel_spikes.png'),"Resolution",600);
- % Figure 1 Figure Supplement 3A - Septa
- figure, bar(smooth(mean(temp_L23_WT_septa),3),3,'FaceColor',...
- colorSepta,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_Septa_spikes.png'),"Resolution",600);
- % Figure 1D - Barrel
- figure , bar(smooth(mean(temp_L4_WT),3),3,'FaceColor',...
- colorBarrel,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_Barrel_spikes.png'),"Resolution",600);
- % Figure 1D - Septa
- figure, bar(smooth(mean(temp_L4_WT_septa),3),3,'FaceColor',...
- colorSepta,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_Septa_spikes.png'),"Resolution",600);
- % Figure 1D - Neighbour
- figure, bar(smooth(mean(temp_L4_WT_neigh),3),3,'FaceColor',...
- colorNeigh,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_Neighbour_spikes.png'),"Resolution",600);
- % Figure 4B - Barrel
- figure , bar(smooth(mean(temp_L4_ko),3),3,'FaceColor',...
- colorBarrelKO,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_Barrel_spikes.png'),"Resolution",600);
- % Figure 4B - Septa
- figure, bar(smooth(mean(temp_L4_ko_septa),3),3,'FaceColor',...
- colorSeptaKO,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_Septa_spikes.png'),"Resolution",600);
- % Figure 4B - Neighbour
- figure, bar(smooth(mean(temp_L4_KO_neigh),3),3,'FaceColor',...
- colorNeighKO,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_Neighbour_spikes.png'),"Resolution",600);
- % Figure 1 Figure Supplement 3B - Barrel
- figure , bar(mean(temp_L23_WT_MW),2,'FaceColor',colorBarrel,'LineWidth',15);
- set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_Barrel_spikes_MW.png'),"Resolution",600);
- % Figure 1 Figure Supplement 3B - Septa
- figure, bar(smooth(mean(temp_L23_WT_MW_septa),3),3,'FaceColor',...
- colorSepta,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_Septa_spikes_MW.png'),"Resolution",600);
- % Figure 1F - Barrel
- figure , bar(smooth(mean(temp_L4_WT_MW),3),3,'FaceColor',...
- colorBarrel,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_Barrel_spikes_MW.png'),"Resolution",600);
- % Figure 1F - Septa
- figure, bar(smooth(mean(temp_L4_WT_MW_septa),3),3,'FaceColor',...
- colorSepta,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_Septa_spikes_MW.png'),"Resolution",600);
- % Figure 4D - Barrel
- figure , bar(smooth(mean(temp_L4_KO_MW),3),3,'FaceColor',...
- colorBarrelKO,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_Barrel_spikes_MW.png'),"Resolution",600);
- % Figure 4D - Septa
- figure, bar(smooth(mean(temp_L4_KO_MW_septa),3),3,'FaceColor',...
- colorSeptaKO,'LineWidth',15); set(gca,'visible','off'); set(gcf,'Position',[100 100 500 250]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_Septa_spikes_MW.png'),"Resolution",600);
- % Data Rearrabgement
- clear stimtrials_L23_WT;
- clear stimtrialsAverage_L23_WT;
- clear diff_stimtrialsAverage_L23_WT;
- % figure; hold on;
- rgbColors = zeros(3,20);
- rgbColors(3,:) = linspace(1,255,20)/255;
- rgbColors(2,:) = linspace(1,155,20)/255;
- for s = 1:20
- stimtrials_L23_WT(:,:,s) = temp_L23_WT(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_WT(:,:,s) = temp_L4_WT(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_WT(:,:,s) = temp_L5_WT(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_WT_septa(:,:,s) = temp_L23_WT_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_WT_septa(:,:,s) = temp_L4_WT_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_WT_septa(:,:,s) = temp_L5_WT_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_WT_neigh(:,:,s) = temp_L23_WT_neigh(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_WT_neigh(:,:,s) = temp_L4_WT_neigh(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_WT_neigh(:,:,s) = temp_L5_WT_neigh(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_KO(:,:,s) = temp_L23_ko(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_KO(:,:,s) = temp_L4_ko(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_KO(:,:,s) = temp_L5_ko(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_KO_septa(:,:,s) = temp_L23_ko_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_KO_septa(:,:,s) = temp_L4_ko_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_KO_septa(:,:,s) = temp_L5_ko_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_KO_neigh(:,:,s) = temp_L23_KO_neigh(:,beglocs(s):beglocs(s)+94);
- stimtrials_L4_KO_neigh(:,:,s) = temp_L4_KO_neigh(:,beglocs(s):beglocs(s)+94);
- stimtrials_L5_KO_neigh(:,:,s) = temp_L5_KO_neigh(:,beglocs(s):beglocs(s)+94);
- end
- % Normalized
- for s = 1:20
- norm_stimtrials_L23_WT(:,:,s) = temp_L23_WT(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_WT(:,201:230)));
- norm_stimtrials_L4_WT(:,:,s) = temp_L4_WT(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_WT(:,201:230)));
- norm_stimtrials_L5_WT(:,:,s) = temp_L5_WT(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_WT(:,201:230)));
- norm_stimtrials_L23_WT_septa(:,:,s) = temp_L23_WT_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_WT_septa(:,201:230)));
- norm_stimtrials_L4_WT_septa(:,:,s) = temp_L4_WT_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_WT_septa(:,201:230)));
- norm_stimtrials_L5_WT_septa(:,:,s) = temp_L5_WT_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_WT_septa(:,201:230)));
- norm_stimtrials_L23_WT_neigh(:,:,s) = temp_L23_WT_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_WT_neigh(:,201:230)));
- norm_stimtrials_L4_WT_neigh(:,:,s) = temp_L4_WT_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_WT_neigh(:,201:230)));
- norm_stimtrials_L5_WT_neigh(:,:,s) = temp_L5_WT_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_WT_neigh(:,201:230)));
- norm_stimtrials_L23_KO(:,:,s) = temp_L23_ko(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_ko(:,201:230)));
- norm_stimtrials_L4_KO(:,:,s) = temp_L4_ko(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_ko(:,201:230)));
- norm_stimtrials_L5_KO(:,:,s) = temp_L5_ko(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_ko(:,201:230)));
- norm_stimtrials_L23_KO_septa(:,:,s) = temp_L23_ko_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_ko_septa(:,201:230)));
- norm_stimtrials_L4_KO_septa(:,:,s) = temp_L4_ko_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_ko_septa(:,201:230)));
- norm_stimtrials_L5_KO_septa(:,:,s) = temp_L5_ko_septa(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_ko_septa(:,201:230)));
- norm_stimtrials_L23_KO_neigh(:,:,s) = temp_L23_KO_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L23_KO_neigh(:,201:230)));
- norm_stimtrials_L4_KO_neigh(:,:,s) = temp_L4_KO_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L4_KO_neigh(:,201:230)));
- norm_stimtrials_L5_KO_neigh(:,:,s) = temp_L5_KO_neigh(:,beglocs(s):beglocs(s)+94)/max(mean(temp_L5_KO_neigh(:,201:230)));
- end
- % MW
- for s = 1:20
- %
- stimtrials_MW_L23_WT(:,:,s) = temp_L23_WT_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L4_WT(:,:,s) = temp_L4_WT_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L5_WT(:,:,s) = temp_L5_WT_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L23_WT_septa(:,:,s) = temp_L23_WT_MW_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L4_WT_septa(:,:,s) = temp_L4_WT_MW_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L5_WT_septa(:,:,s) = temp_L5_WT_MW_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L23_KO(:,:,s) = temp_L23_KO_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L4_KO(:,:,s) = temp_L4_KO_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L5_KO(:,:,s) = temp_L5_KO_MW(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L23_KO_septa(:,:,s) = temp_L23_KO_MW_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L4_KO_septa(:,:,s) = temp_L4_KO_MW_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_MW_L5_KO_septa(:,:,s) = temp_L5_KO_MW_septa(:,beglocs(s):beglocs(s)+94);
- end
- %% Peak Comparison L2/3 WT
- % Figure 1D Figure Supplement 3A - Image - Barrel
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L23_WT,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Barrel_WT_Image.png'),"Resolution",600);
- % Figure 1D Figure Supplement 3A - Image - Septa
- figure; set(gcf,'Position',[100 100 500 300]);
- imagesc(squeeze(mean(stimtrials_L23_WT_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',24); xticks([1 20 40 60 80]);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',22); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Septa_WT_Image.png'),"Resolution",600);
- % Figure 1D - Image - Barrel
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_WT,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Barrel_WT_Image.png'),"Resolution",600);
- % Figure 1D - Image - Septa
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_WT_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Septa_WT_Image.png'),"Resolution",600);
- % Figure 1D - Image - Neighbour
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_WT_neigh,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Neigh_WT_Image.png'),"Resolution",600);
- % Figure 4B - Image - Barrel
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_KO,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Barrel_KO_Image.png'),"Resolution",600);
- % Figure 4B - Image - Septa
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_KO_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Septa_KO_Image.png'),"Resolution",600);
- % Figure 4B - Image - Neighbour
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_L4_KO_neigh,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Neigh_KO_Image.png'),"Resolution",600);
- % Figure 1 Figure Supplement 3B - Image - Barrel
- figure; set(gcf,'Position',[100 100 500 300]);
- imagesc(squeeze(mean(stimtrials_MW_L23_WT,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',24); xticks([1 20 40 60 80]);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',22); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Barrel_WT_Image_MW.png'),"Resolution",600);
- % Figure 1 Figure Supplement 3B - Image - Septa
- figure; set(gcf,'Position',[100 100 500 300]);
- imagesc(squeeze(mean(stimtrials_MW_L23_WT_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',24); xticks([1 20 40 60 80]);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',22); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Septa_WT_Image_MW.png'),"Resolution",600);
- % Figure 1F - Image - Barrel
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_MW_L4_WT,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Barrel_WT_Image_MW.png'),"Resolution",600);
- % Figure 1F - Image - Septa
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_MW_L4_WT_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Septa_WT_Image_MW.png'),"Resolution",600);
- % Figure 4D - Image - Barrel
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_MW_L4_KO,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Barrel_KO_Image_MW.png'),"Resolution",600);
- % Figure 4D - Image - Septa
- figure; set(gcf,'Position',[100 100 350 300]);
- imagesc(squeeze(mean(stimtrials_MW_L4_KO_septa,1))',[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',18); xticks([1 20 40 60 80]);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',18); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L4_Septa_KO_Image_MW.png'),"Resolution",600);
- %% MW/SW Extraction
- for i = 1:size(temp_L4_WT,1)
- temp_L4_WT_smooth(i,:) = smooth(temp_L4_WT(i,:),3);
- temp_L4_WT_MW_smooth(i,:) = smooth(temp_L4_WT_MW(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L4_WT,1)
- temp_L4_WT_smooth_trials(c,:) = mean(temp_L4_WT_smooth(t:t+19,:),1);
- temp_L4_WT_MW_smooth_trials(c,:) = mean(temp_L4_WT_MW_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for i = 1:size(temp_L4_WT_septa,1)
- temp_L4_WT_septa_smooth(i,:) = smooth(temp_L4_WT_septa(i,:),3);
- temp_L4_WT_MW_septa_smooth(i,:) = smooth(temp_L4_WT_MW_septa(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L4_WT_septa,1)
- temp_L4_WT_septa_smooth_trials(c,:) = mean(temp_L4_WT_septa_smooth(t:t+19,:),1);
- temp_L4_WT_MW_septa_smooth_trials(c,:) = mean(temp_L4_WT_MW_septa_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for b = 1:size(temp_L4_WT_smooth_trials,1)
- for s = 1:20
- L4_WT_SW_Barrel_Max(b,s) = trapz(nanmean(temp_L4_WT_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L4_WT_MW_Barrel_Max(b,s) = trapz(nanmean(temp_L4_WT_MW_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- for b = 1:size(temp_L4_WT_septa_smooth_trials,1)
- for s = 1:20
- L4_WT_SW_Septa_Max(b,s) = trapz(nanmean(temp_L4_WT_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L4_WT_MW_Septa_Max(b,s) = trapz(nanmean(temp_L4_WT_MW_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- L4_WT_MW_div_SW_Barrel_mean = 100*mean(L4_WT_MW_Barrel_Max./L4_WT_SW_Barrel_Max);
- L4_WT_MW_div_SW_Barrel_sem = 100*std(L4_WT_MW_Barrel_Max./L4_WT_SW_Barrel_Max,[],1)/sqrt(size(L4_WT_MW_Barrel_Max,1));
- L4_WT_MW_div_SW_Septa_mean = 100*mean(L4_WT_MW_Septa_Max./L4_WT_SW_Septa_Max);
- L4_WT_MW_div_SW_Septa_sem = 100*std(L4_WT_MW_Septa_Max./L4_WT_SW_Septa_Max,[],1)/sqrt(size(L4_WT_MW_Septa_Max,1));
- for i = 1:size(temp_L4_ko,1)
- temp_L4_KO_smooth(i,:) = smooth(temp_L4_ko(i,:),3);
- temp_L4_KO_MW_smooth(i,:) = smooth(temp_L4_KO_MW(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L4_ko,1)
- temp_L4_KO_smooth_trials(c,:) = mean(temp_L4_KO_smooth(t:t+19,:),1);
- temp_L4_KO_MW_smooth_trials(c,:) = mean(temp_L4_KO_MW_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for i = 1:size(temp_L4_ko_septa,1)
- temp_L4_KO_septa_smooth(i,:) = smooth(temp_L4_ko_septa(i,:),3);
- temp_L4_KO_MW_septa_smooth(i,:) = smooth(temp_L4_KO_MW_septa(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L4_ko_septa,1)
- temp_L4_KO_septa_smooth_trials(c,:) = mean(temp_L4_KO_septa_smooth(t:t+19,:),1);
- temp_L4_KO_MW_septa_smooth_trials(c,:) = mean(temp_L4_KO_MW_septa_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for b = 1:size(temp_L4_KO_smooth_trials,1)
- for s = 1:20
- L4_KO_SW_Barrel_Max(b,s) = trapz(nanmean(temp_L4_KO_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L4_KO_MW_Barrel_Max(b,s) = trapz(nanmean(temp_L4_KO_MW_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- for b = 1:size(temp_L4_KO_septa_smooth_trials,1)
- for s = 1:20
- L4_KO_SW_Septa_Max(b,s) = trapz(nanmean(temp_L4_KO_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L4_KO_MW_Septa_Max(b,s) = trapz(nanmean(temp_L4_KO_MW_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- L4_KO_MW_div_SW_Barrel_mean = 100*mean(L4_KO_MW_Barrel_Max./L4_KO_SW_Barrel_Max);
- L4_KO_MW_div_SW_Barrel_sem = 100*std(L4_KO_MW_Barrel_Max./L4_KO_SW_Barrel_Max,[],1)/sqrt(size(L4_KO_MW_Barrel_Max,1));
- L4_KO_MW_div_SW_Septa_mean = 100*mean(L4_KO_MW_Septa_Max./L4_KO_SW_Septa_Max);
- L4_KO_MW_div_SW_Septa_sem = 100*std(L4_KO_MW_Septa_Max./L4_KO_SW_Septa_Max,[],1)/sqrt(size(L4_KO_MW_Septa_Max,1));
- % Figure 1H
- figure; set(gcf,'Position',[500 500 610 400]);
- hold on; errorbar(1:20,L4_WT_MW_div_SW_Barrel_mean,L4_WT_MW_div_SW_Barrel_sem,'LineWidth',3,'Color',colorBarrel);
- hold on; errorbar(1:20,L4_WT_MW_div_SW_Septa_mean,L4_WT_MW_div_SW_Septa_sem,'LineWidth',3,'Color',colorSepta);
- plot(1:20,100*ones(1,20),'--','Color',[.1 .1 .1]);
- xlim([0 21]); ylim([50 225]);
- yticks(0:50:250);
- xticks([1:20]); ylabel('AUC_{MW}/AUC_{SW}','FontWeight','normal'); xlabel('Pulse Number','FontSize',22);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- legend('Barrel WT','Septa WT','Location','NorthWest');
- title('L4 Multi/Single','FontWeight','normal');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_div_SW_Barrel.png'),"Resolution",600);
- % Figure 4F
- figure; set(gcf,'Position',[500 500 610 400]);
- hold on; errorbar(1:20,L4_KO_MW_div_SW_Barrel_mean,L4_KO_MW_div_SW_Barrel_sem,'LineWidth',3,'Color',colorBarrelKO);
- hold on; errorbar(1:20,L4_KO_MW_div_SW_Septa_mean,L4_KO_MW_div_SW_Septa_sem,'LineWidth',3,'Color',colorSeptaKO);
- plot(1:20,100*ones(1,20),'--','Color',[.1 .1 .1]);
- xlim([0 21]); ylim([50 225]);
- yticks(0:50:250);
- xticks([1:20]); ylabel('AUC_{MW}/AUC_{SW}','FontWeight','normal'); xlabel('Pulse Number','FontSize',22);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- legend('Barrel KO','Septa KO','Location','NorthWest');
- title('L4 Multi/Single','FontWeight','normal');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_div_SW_Barrel.png'),"Resolution",600);
- % Figure 1I - 1-20 Pulses
- all_L4_WT_ratio_Barrel = 100*mean(L4_WT_MW_Barrel_Max./L4_WT_SW_Barrel_Max,2);
- all_L4_WT_ratio_Septa = 100*mean(L4_WT_MW_Septa_Max./L4_WT_SW_Septa_Max,2);
- all_L4_KO_ratio_Barrel = 100*mean(L4_KO_MW_Barrel_Max./L4_KO_SW_Barrel_Max,2);
- all_L4_KO_ratio_Septa = 100*mean(L4_KO_MW_Septa_Max./L4_KO_SW_Septa_Max,2);
- t1 = all_L4_WT_ratio_Barrel;
- t2 = all_L4_WT_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- hold on; plot([1 2],[200 200],'LineWidth',3,'Color','k');
- text(1.5,205,'*','HorizontalAlignment','center','FontSize',48);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('1-20');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_div_SW_Barrel_Septa_AllPulses.png'),"Resolution",600);
- % Figure 4G - 1-20 Pulses
- t1 = all_L4_KO_ratio_Barrel;
- t2 = all_L4_KO_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('1-20');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_div_SW_Barrel_Septa_AllPulses.png'),"Resolution",600);
- % Figure 1I - 1-6 Pulses
- all_L4_WT_ratio_Barrel = 100*mean(L4_WT_MW_Barrel_Max(:,1:6)./L4_WT_SW_Barrel_Max(:,1:6),2);
- all_L4_WT_ratio_Septa = 100*mean(L4_WT_MW_Septa_Max(:,1:6)./L4_WT_SW_Septa_Max(:,1:6),2);
- all_L4_KO_ratio_Barrel = 100*mean(L4_KO_MW_Barrel_Max(:,1:6)./L4_KO_SW_Barrel_Max(:,1:6),2);
- all_L4_KO_ratio_Septa = 100*mean(L4_KO_MW_Septa_Max(:,1:6)./L4_KO_SW_Septa_Max(:,1:6),2);
- t1 = all_L4_WT_ratio_Barrel;
- t2 = all_L4_WT_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('1-6');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_div_SW_Barrel_Septa_Pulses1_6.png'),"Resolution",600);
- % Figure 4G - 1-6 Pulses
- t1 = all_L4_KO_ratio_Barrel;
- t2 = all_L4_KO_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('1-6');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_div_SW_Barrel_Septa_Pulses1_6.png'),"Resolution",600);
- % Figure 1I - 7-20 Pulses
- all_L4_WT_ratio_Barrel = 100*mean(L4_WT_MW_Barrel_Max(:,7:20)./L4_WT_SW_Barrel_Max(:,7:20),2);
- all_L4_WT_ratio_Septa = 100*mean(L4_WT_MW_Septa_Max(:,7:20)./L4_WT_SW_Septa_Max(:,7:20),2);
- all_L4_KO_ratio_Barrel = 100*mean(L4_KO_MW_Barrel_Max(:,7:20)./L4_KO_SW_Barrel_Max(:,7:20),2);
- all_L4_KO_ratio_Septa = 100*mean(L4_KO_MW_Septa_Max(:,7:20)./L4_KO_SW_Septa_Max(:,7:20),2);
- t1 = all_L4_WT_ratio_Barrel;
- t2 = all_L4_WT_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- hold on; plot([1 2],[200 200],'LineWidth',3,'Color','k');
- text(1.5,205,'**','HorizontalAlignment','center','FontSize',48);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('7-20');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_div_SW_Barrel_Septa_Pulses7_20.png'),"Resolution",600);
- % Figure 4G - 7-20 Pulses
- t1 = all_L4_KO_ratio_Barrel;
- t2 = all_L4_KO_ratio_Septa;
- ranksum((t1),(t2))
- ranksum(rmoutliers(t1),rmoutliers(t2))
- figure; set(gcf,'Position',[1200 100 300 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 270]);
- yticks(0:50:250);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC(MW/SW)%'); title('7-20');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_div_SW_Barrel_Septa_Pulses7_20.png'),"Resolution",600);
- %% WT L23
- for i = 1:size(temp_L23_WT,1)
- temp_L23_WT_smooth(i,:) = smooth(temp_L23_WT(i,:),3);
- temp_L23_WT_MW_smooth(i,:) = smooth(temp_L23_WT_MW(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L23_WT,1)
- temp_L23_WT_smooth_trials(c,:) = mean(temp_L23_WT_smooth(t:t+19,:),1);
- temp_L23_WT_MW_smooth_trials(c,:) = mean(temp_L23_WT_MW_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for i = 1:size(temp_L23_WT_septa,1)
- temp_L23_WT_septa_smooth(i,:) = smooth(temp_L23_WT_septa(i,:),3);
- temp_L23_WT_MW_septa_smooth(i,:) = smooth(temp_L23_WT_MW_septa(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L23_WT_septa,1)
- temp_L23_WT_septa_smooth_trials(c,:) = mean(temp_L23_WT_septa_smooth(t:t+19,:),1);
- temp_L23_WT_MW_septa_smooth_trials(c,:) = mean(temp_L23_WT_MW_septa_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for b = 1:size(temp_L23_WT_smooth_trials,1)
- for s = 1:20
- L23_WT_SW_Barrel_Max(b,s) = trapz(nanmean(temp_L23_WT_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L23_WT_MW_Barrel_Max(b,s) = trapz(nanmean(temp_L23_WT_MW_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- for b = 1:size(temp_L23_WT_septa_smooth_trials,1)
- for s = 1:20
- L23_WT_SW_Septa_Max(b,s) = trapz(nanmean(temp_L23_WT_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L23_WT_MW_Septa_Max(b,s) = trapz(nanmean(temp_L23_WT_MW_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- % KO L23
- for i = 1:size(temp_L23_ko,1)
- temp_L23_KO_smooth(i,:) = smooth(temp_L23_ko(i,:),3);
- temp_L23_KO_MW_smooth(i,:) = smooth(temp_L23_KO_MW(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L23_ko,1)
- temp_L23_KO_smooth_trials(c,:) = mean(temp_L23_KO_smooth(t:t+19,:),1);
- temp_L23_KO_MW_smooth_trials(c,:) = mean(temp_L23_KO_MW_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for i = 1:size(temp_L23_ko_septa,1)
- temp_L23_KO_septa_smooth(i,:) = smooth(temp_L23_ko_septa(i,:),3);
- temp_L23_KO_MW_septa_smooth(i,:) = smooth(temp_L23_KO_MW_septa(i,:),3);
- end
- c = 1;
- for t = 1:20:size(temp_L23_ko_septa,1)
- temp_L23_KO_septa_smooth_trials(c,:) = mean(temp_L23_KO_septa_smooth(t:t+19,:),1);
- temp_L23_KO_MW_septa_smooth_trials(c,:) = mean(temp_L23_KO_MW_septa_smooth(t:t+19,:),1);
- c = c + 1;
- end
- for b = 1:size(temp_L23_KO_smooth_trials,1)
- for s = 1:20
- L23_KO_SW_Barrel_Max(b,s) = trapz(nanmean(temp_L23_KO_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L23_KO_MW_Barrel_Max(b,s) = trapz(nanmean(temp_L23_KO_MW_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- for b = 1:size(temp_L23_KO_septa_smooth_trials,1)
- for s = 1:20
- L23_KO_SW_Septa_Max(b,s) = trapz(nanmean(temp_L23_KO_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- L23_KO_MW_Septa_Max(b,s) = trapz(nanmean(temp_L23_KO_MW_septa_smooth_trials(b,beglocs(s):beglocs(s)+49),1));
- end
- end
- L23_WT_MW_div_SW_Barrel_mean = 100*mean(L23_WT_MW_Barrel_Max./L23_WT_SW_Barrel_Max);
- L23_WT_MW_div_SW_Barrel_sem = 100*std(L23_WT_MW_Barrel_Max./L23_WT_SW_Barrel_Max,[],1)/sqrt(size(L23_WT_MW_Barrel_Max,1));
- L23_WT_MW_div_SW_Septa_mean = 100*mean(L23_WT_MW_Septa_Max./L23_WT_SW_Septa_Max);
- L23_WT_MW_div_SW_Septa_sem = 100*std(L23_WT_MW_Septa_Max./L23_WT_SW_Septa_Max,[],1)/sqrt(size(L23_WT_MW_Septa_Max,1));
- L23_KO_MW_div_SW_Barrel_mean = 100*mean(L23_KO_MW_Barrel_Max./L23_KO_SW_Barrel_Max);
- L23_KO_MW_div_SW_Barrel_sem = 100*std(L23_KO_MW_Barrel_Max./L23_KO_SW_Barrel_Max,[],1)/sqrt(size(L23_KO_MW_Barrel_Max,1));
- L23_KO_MW_div_SW_Septa_mean = 100*mean(L23_KO_MW_Septa_Max./L23_KO_SW_Septa_Max);
- L23_KO_MW_div_SW_Septa_sem = 100*std(L23_KO_MW_Septa_Max./L23_KO_SW_Septa_Max,[],1)/sqrt(size(L23_KO_MW_Septa_Max,1));
- % Figure 1 Figure SUpplement 3C
- figure; set(gcf,'Position',[500 500 610 400]);
- hold on; errorbar(1:20,L23_WT_MW_div_SW_Barrel_mean,L23_WT_MW_div_SW_Barrel_sem,'LineWidth',3,'Color',colorBarrel);
- hold on; errorbar(1:20,L23_WT_MW_div_SW_Septa_mean,L23_WT_MW_div_SW_Septa_sem,'LineWidth',3,'Color',colorSepta);
- plot(1:20,100*ones(1,20),'--','Color',[.1 .1 .1]);
- xlim([0 21]); ylim([50 400]);
- yticks(0:50:350);
- xticks([1:20]); ylabel('AUC_{MW}/AUC_{SW}','FontWeight','normal'); xlabel('Pulse Number','FontSize',22);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- legend('Barrel WT','Septa WT','Location','NorthWest');
- title('Layer_{2/3} Multi/Single','FontWeight','normal');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_MW_div_SW_Barrel.png'),"Resolution",600);
- figure; set(gcf,'Position',[500 500 610 400]);
- hold on; errorbar(1:20,L23_KO_MW_div_SW_Barrel_mean,L23_KO_MW_div_SW_Barrel_sem,'LineWidth',3,'Color',colorBarrelKO);
- hold on; errorbar(1:20,L23_KO_MW_div_SW_Septa_mean,L23_KO_MW_div_SW_Septa_sem,'LineWidth',3,'Color',colorSeptaKO);
- plot(1:20,100*ones(1,20),'--','Color',[.1 .1 .1]);
- xlim([0 21]); ylim([50 400]);
- yticks(0:50:350);
- xticks([1:20]); ylabel('AUC_{MW}/AUC_{SW}','FontWeight','normal'); xlabel('Pulse Number','FontSize',22);
- set(gca,'FontSize',18); set(gca,'TickDir','out');
- legend('Barrel KO','Septa KO','Location','NorthWest');
- title('Layer_{2/3} Multi/Single','FontWeight','normal');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_MW_div_SW_Barrel.png'),"Resolution",600);
- % % Figure 4G - 7-20 Pulses
- %
- % t1 = all_L4_KO_ratio_Barrel;
- % t2 = all_L4_KO_ratio_Septa;
- % ranksum(t1,t2)
- % figure; set(gcf,'Position',[1200 100 200 300]); hold on;
- % bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- % plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- % bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- % plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- %
- % hold on; plot([1 2],[240 240],'LineWidth',3,'Color','w');
- % text(1.5,245,'NS','HorizontalAlignment','center','FontSize',64,'Color','w');
- %
- % axis([0.5 2.5 0 270]);
- % yticks(0:50:250);
- % xticks([1 2]); xticklabels({'B' 'S'}); ylabel('Peak(MW/SW)%');
- % set(gca,'FontSize',30); set(gca,'TickDir','out');
- % exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_div_SW_Barrel_Septa.png'),"Resolution",600);
- %%
- %% Statistical Comparisons
- %% L2/3 WT
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_L23_WT,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_L23_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_WT_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_L23_WT_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_WT_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:50,stimtrials_L23_WT_neigh(ii,1:50,jj));
- end
- end
- %%
- %% All Pulse Stats
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,p),20,length(tempN(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t1,t3);
- pValues(3,p) = ranksum(t2,t3);
- end
- colorMapDiscrete = [];
- colorMapDiscrete = hot(10);
- figure; set(gcf,'Position',[100 100 250 800]);
- imagesc(pValues',[0 0.1]); colormap(flipud(colorMapDiscrete)); colorbar;
- set(gca,'FontSize',20); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',20); yticks((1:20));
- xlabel('Stats','FontSize',20); xticks([1 2 3]); xticklabels({'BS','BN','SN'}); xtickangle(90);
- exportgraphics(gcf,fullfile(saveFolder,'L23_BSN_WT_Stats_SW.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,1),20,length(tempN(:,20))/20),1);
- %
- % clc;
- % ranksum(t1,t2)
- % ranksum(t1,t3)
- % ranksum(t2,t3)
- %
- % figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- % bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- % plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- % bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- % plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % bar(3, mean(t3), 'FaceColor', colorNeigh, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- % plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeigh/2);
- %
- % plot([2 3],[19 19],'LineWidth',3,'Color','k');
- % text(2.5,19.1,'*','HorizontalAlignment','center','FontSize',64);
- %
- % axis([0.5 3.5 0 20]);
- % yticks(0:4:20);
- % xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- % set(gca,'FontSize',30); set(gca,'TickDir','out');
- % exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_first_pulse.png'),"Resolution",600);
- %
- % % Second Pulse
- % t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- % t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- % t3 = mean(reshape(tempN(:,2),20,length(tempN(:,20))/20),1);
- %
- % clc;
- % ranksum(t1,t2)
- % ranksum(t1,t3)
- % ranksum(t2,t3)
- %
- % figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- % bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- % plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- % bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- % plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % bar(3, mean(t3), 'FaceColor', colorNeigh, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- % plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeigh/2);
- %
- % % plot([2 3],[19 19],'LineWidth',3,'Color','k');
- % % text(2.5,19.1,'*','HorizontalAlignment','center','FontSize',64);
- %
- % axis([0.5 3.5 0 20]);
- % yticks(0:4:20);
- % xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- % set(gca,'FontSize',30); set(gca,'TickDir','out');
- % exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_second_pulse.png'),"Resolution",600);
- %
- % % Third Pulse
- % t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- % t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- % t3 = mean(reshape(tempN(:,3),20,length(tempN(:,20))/20),1);
- %
- % clc;
- % ranksum(t1,t2)
- % ranksum(t1,t3)
- % ranksum(t2,t3)
- %
- % figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- % bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- % plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- % bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- % plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % bar(3, mean(t3), 'FaceColor', colorNeigh, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- % plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeigh/2);
- %
- % plot([1 2],[12 12],'LineWidth',3,'Color','k');
- % text(1.5,12.1,'*','HorizontalAlignment','center','FontSize',64);
- %
- % axis([0.5 3.5 0 20]);
- % yticks(0:4:20);
- % xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- % set(gca,'FontSize',30); set(gca,'TickDir','out');
- % exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_third_pulse.png'),"Resolution",600);
- %
- % % 20th Pulse
- % t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- % t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- % t3 = mean(reshape(tempN(:,20),20,length(tempN(:,20))/20),1);
- %
- % clc;
- % ranksum(t1,t2)
- % ranksum(t1,t3)
- % ranksum(t2,t3)
- %
- % figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- % bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- % plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- % bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- % plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % bar(3, mean(t3), 'FaceColor', colorNeigh, 'EdgeColor', 'none', 'BarWidth', 0.6);
- % plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- % plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeigh/2);
- %
- % plot([1 2],[7.5 7.5],'LineWidth',3,'Color','k');
- % text(1.5,7.7,'**','HorizontalAlignment','center','FontSize',64);
- % plot([2 3],[5.5 5.5],'LineWidth',3,'Color','k');
- % text(2.5,5.7,'*','HorizontalAlignment','center','FontSize',64);
- %
- % axis([0.5 3.5 0 20]);
- % yticks(0:4:20);
- % xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- % set(gca,'FontSize',30); set(gca,'TickDir','out');
- % exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% L4 WT
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_L4_WT,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_L4_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_WT_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_L4_WT_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_WT_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:50,stimtrials_L4_WT_neigh(ii,1:50,jj));
- end
- end
- %% All Pulse Stats
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,p),20,length(tempN(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t1,t3);
- pValues(3,p) = ranksum(t2,t3);
- end
- colorMapDiscreteTemp = [];
- colorMapDiscreteTemp = hot(10);
- colorMapDiscrete(10,:) = colorMapDiscreteTemp(10,:);
- colorMapDiscrete(9,:) = colorMapDiscreteTemp(8,:);
- colorMapDiscrete(8,:) = colorMapDiscreteTemp(6,:);
- colorMapDiscrete(7,:) = colorMapDiscreteTemp(4,:);
- colorMapDiscrete(6,:) = colorMapDiscreteTemp(2,:);
- colorMapDiscrete(5,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(4,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(3,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(2,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(1,:) = [0 0 0];
- colorMapDiscrete = 1-colorMapDiscrete;
- % Figure 1E
- figure; set(gcf,'Position',[100 100 1000 200]);
- imagesc(pValues,[0 0.05]); cmap = colormap(flipud(colorMapDiscrete)); cbh = colorbar;
- cbh.Ticks = [0, 0.01, 0.05]; cbh.TickLabels = {'0','0.01','>0.05'} ;
- set(gca,'FontSize',20); set(gca,'TickDir','out');
- xlabel('Pulse Number','FontSize',20); xticks((1:20));
- yticks([1 2 3]); yticklabels({'B vs S','B vs N','S vs N'}); %xtickangle(45);
- exportgraphics(gcf,fullfile(saveFolder, 'L4_BSN_WT_Stats_SW.png'),"Resolution",300);
- %% MW Stats
- %% L2/3 WT MW
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_MW_L23_WT,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_MW_L23_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L23_WT_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_MW_L23_WT_septa(ii,1:50,jj));
- end
- end
- pValuesL23 = [];
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- pValuesL23(p) = ranksum(t1,t2);
- end
- figure; set(gcf,'Position',[100 100 150 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1]); xticklabels({'BS'});
- exportgraphics(gcf,fullfile(saveFolder,'L23_BS_WT_Stats_MW.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_MW_BSN_stat_first_pulse.png'),"Resolution",600);
- % Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_MW_BSN_stat_second_pulse.png'),"Resolution",600);
- % Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_MW_BSN_stat_third_pulse.png'),"Resolution",600);
- % 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_MW_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% L4 WT MW
- %%
- tempB = []; tempS = [];
- for ii = 1:size(stimtrials_MW_L4_WT,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_MW_L4_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L4_WT_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_MW_L4_WT_septa(ii,1:50,jj));
- end
- end
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- pValuesMW(p) = ranksum(t1,t2);
- end
- % colorMapDiscrete = [];
- % colorMapDiscrete = hot(10);
- figure; set(gcf,'Position',[100 100 100 700]); set(gcf,'OuterPosition',[100 100 180 700]);
- imagesc(pValuesMW',[0 0.1]); colormap(flipud(colorMapDiscrete)); colorbar;
- set(gca,'FontSize',20); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',20); yticks((1:20));
- xlabel('Stats','FontSize',20); xticks([1]); xticklabels({'B vs S'});
- exportgraphics(gcf,fullfile(saveFolder, 'L4_BSN_WT_Stats_MW.png'),"Resolution",300);
- %%
- pValuesL4 = [];
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- pValuesL4(p) = ranksum(t1,t2);
- end
- figure; set(gcf,'Position',[100 100 150 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1]); xticklabels({'BS'});
- exportgraphics(gcf,fullfile(saveFolder,'L4_BS_WT_Stats_MW.png'),"Resolution",600);
- % Figure 1G - First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 200 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_BSN_stat_first_pulse.png'),"Resolution",600);
- % Figure 1G - Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 200 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- plot([1 2],[12 12],'LineWidth',3,'Color','k');
- text(1.5,12.1,'**','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_BSN_stat_second_pulse.png'),"Resolution",600);
- % Figure 1G - Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 200 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- plot([1 2],[11 11],'LineWidth',3,'Color','k');
- text(1.5,11.1,'**','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_BSN_stat_third_pulse.png'),"Resolution",600);
- % Figure 1G - 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 200 400]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrel, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrel/2);
- bar(2, mean(t2), 'FaceColor', colorSepta, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSepta/2);
- plot([1 2],[9.3 9.3],'LineWidth',3,'Color','k');
- text(1.5,9.4,'**','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_WT_MW_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% MW Stats - KO
- %% L2/3 KO MW
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_MW_L23_KO,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_MW_L23_KO(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L23_KO_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_MW_L23_KO_septa(ii,1:50,jj));
- end
- end
- pValuesL23KO = [];
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- pValuesL23KO(p) = ranksum(t1,t2);
- end
- figure; set(gcf,'Position',[100 100 150 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1]); xticklabels({'BS'});
- exportgraphics(gcf,fullfile(saveFolder,'L23_BS_KO_Stats_MW.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_MW_BSN_stat_first_pulse.png'),"Resolution",600);
- % Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_MW_BSN_stat_second_pulse.png'),"Resolution",600);
- % Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_MW_BSN_stat_third_pulse.png'),"Resolution",600);
- % 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- % plot([1 2],[8 8],'LineWidth',3,'Color','k');
- % text(1.5,8.1,'***','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_MW_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% L4 KO MW
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_MW_L4_KO,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_MW_L4_KO(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L4_KO_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_MW_L4_KO_septa(ii,1:50,jj));
- end
- end
- pValuesL4KO = [];
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- pValuesL4KO(p) = ranksum(t1,t2);
- end
- figure; set(gcf,'Position',[100 100 150 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1]); xticklabels({'BS'});
- exportgraphics(gcf,fullfile(saveFolder,'L4_BS_KO_Stats_MW.png'),"Resolution",600);
- % Figure 4E - First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_BSN_stat_first_pulse.png'),"Resolution",600);
- % Figure 4E - Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_BSN_stat_second_pulse.png'),"Resolution",600);
- % Figure 4E - Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_BSN_stat_third_pulse.png'),"Resolution",600);
- % Figure 4E - 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- plot([1 2],[10 10],'LineWidth',3,'Color','k');
- text(1.5,10.1,'**','HorizontalAlignment','center','FontSize',64);
- axis([0.5 2.5 0 13]);
- yticks(0:4:20);
- xticks([1 2]); xticklabels({'B' 'S'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_MW_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% L4 KO
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_L4_KO,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_L4_KO(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_KO_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_L4_KO_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_KO_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:50,stimtrials_L4_KO_neigh(ii,1:50,jj));
- end
- end
- % Figure 4C
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,p),20,length(tempN(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t1,t3);
- pValues(3,p) = ranksum(t2,t3);
- end
- colorMapDiscreteTemp = [];
- colorMapDiscreteTemp = hot(10);
- colorMapDiscrete(10,:) = colorMapDiscreteTemp(10,:);
- colorMapDiscrete(9,:) = colorMapDiscreteTemp(8,:);
- colorMapDiscrete(8,:) = colorMapDiscreteTemp(6,:);
- colorMapDiscrete(7,:) = colorMapDiscreteTemp(4,:);
- colorMapDiscrete(6,:) = colorMapDiscreteTemp(2,:);
- colorMapDiscrete(5,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(4,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(3,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(2,:) = colorMapDiscreteTemp(1,:);
- colorMapDiscrete(1,:) = [0 0 0];
- colorMapDiscrete = 1-colorMapDiscrete;
- figure; set(gcf,'Position',[100 100 1000 200]);
- imagesc(pValues,[0 0.05]); cmap = colormap(flipud(colorMapDiscrete)); cbh = colorbar;
- cbh.Ticks = [0, 0.01, 0.05]; cbh.TickLabels = {'0','0.01','>0.05'} ;
- set(gca,'FontSize',20); set(gca,'TickDir','out');
- xlabel('Pulse Number','FontSize',20); xticks((1:20));
- yticks([1 2 3]); yticklabels({'B vs S','B vs N','S vs N'}); %xtickangle(45);
- exportgraphics(gcf,fullfile(saveFolder, 'L4_BSN_KO_Stats_SW.png'),"Resolution",300);
- %% WT vs KO SW and MW p Values
- tempB_WT = []; tempB_KO = [];
- for ii = 1:size(stimtrials_L5_WT,1)
- for jj = 1:20
- tempB_WT(ii,jj) = trapz(1:50,stimtrials_L5_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L5_KO,1)
- for jj = 1:20
- tempB_KO(ii,jj) = trapz(1:50,stimtrials_L5_KO(ii,1:50,jj));
- end
- end
- tempS_WT = []; tempS_KO = [];
- for ii = 1:size(stimtrials_L5_WT_septa,1)
- for jj = 1:20
- tempS_WT(ii,jj) = trapz(1:50,stimtrials_L5_WT_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L5_KO_septa,1)
- for jj = 1:20
- tempS_KO(ii,jj) = trapz(1:50,stimtrials_L5_KO_septa(ii,1:50,jj));
- end
- end
- tempN_WT = []; tempN_KO = [];
- for ii = 1:size(stimtrials_L5_WT_neigh,1)
- for jj = 1:20
- tempN_WT(ii,jj) = trapz(1:50,stimtrials_L5_WT_neigh(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L5_KO_neigh,1)
- for jj = 1:20
- tempN_KO(ii,jj) = trapz(1:50,stimtrials_L5_KO_neigh(ii,1:50,jj));
- end
- end
- %% All Pulse Stats
- for p = 1:20
- t1 = mean(reshape(tempB_WT(:,p),20,length(tempB_WT(:,20))/20),1);
- t2 = mean(reshape(tempB_KO(:,p),20,length(tempB_KO(:,20))/20),1);
- t3 = mean(reshape(tempS_WT(:,p),20,length(tempS_WT(:,20))/20),1);
- t4 = mean(reshape(tempS_KO(:,p),20,length(tempS_KO(:,20))/20),1);
- t5 = mean(reshape(tempN_WT(:,p),20,length(tempN_WT(:,20))/20),1);
- t6 = mean(reshape(tempN_KO(:,p),20,length(tempN_KO(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t3,t4);
- pValues(3,p) = ranksum(t5,t6);
- end
- figure; hold on;
- plot(pValues(1,:)','Color',(colorBarrel+colorBarrelKO)/2,'LineWidth',3);
- plot(pValues(2,:)','Color',(colorSepta+colorSeptaKO)/2,'LineWidth',3);
- plot(pValues(3,:)','Color',(colorNeigh+colorNeighKO)/2,'LineWidth',3);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- legend({'Barrel','Septa','Neighbor'},'FontSize',14,'AutoUpdate','off');
- plot(0:21,0.05*ones(1,22),'Color','r','LineWidth',1)
- xlabel('Pulse Number','FontSize',24);
- ylabel('p','FontSize',24);
- title('WT vs KO','FontSize',24); axis([1 20 0 1]);
- saveas(gcf, fullfile(saveFolder,'L5_p_WT_vs_KO_1-50ms.png','epsc'));
- %% MW
- tempB_WT = []; tempB_KO = [];
- for ii = 1:size(stimtrials_MW_L23_WT,1)
- for jj = 1:20
- tempB_WT(ii,jj) = trapz(1:50,stimtrials_MW_L23_WT(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L23_KO,1)
- for jj = 1:20
- tempB_KO(ii,jj) = trapz(1:50,stimtrials_MW_L23_KO(ii,1:50,jj));
- end
- end
- tempS_WT = []; tempS_KO = [];
- for ii = 1:size(stimtrials_MW_L23_WT_septa,1)
- for jj = 1:20
- tempS_WT(ii,jj) = trapz(1:50,stimtrials_MW_L23_WT_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_MW_L23_KO_septa,1)
- for jj = 1:20
- tempS_KO(ii,jj) = trapz(1:50,stimtrials_MW_L23_KO_septa(ii,1:50,jj));
- end
- end
- %% All Pulse Stats
- for p = 1:20
- t1 = mean(reshape(tempB_WT(:,p),20,length(tempB_WT(:,20))/20),1);
- t2 = mean(reshape(tempB_KO(:,p),20,length(tempB_KO(:,20))/20),1);
- t3 = mean(reshape(tempS_WT(:,p),20,length(tempS_WT(:,20))/20),1);
- t4 = mean(reshape(tempS_KO(:,p),20,length(tempS_KO(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t3,t4);
- end
- figure; hold on;
- plot(pValues(1,:)','Color',(colorBarrel+colorBarrelKO)/2,'LineWidth',3);
- plot(pValues(2,:)','Color',(colorSepta+colorSeptaKO)/2,'LineWidth',3);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- legend({'Barrel','Septa'},'FontSize',14,'AutoUpdate','off');
- plot(0:21,0.05*ones(1,22),'Color','r','LineWidth',1)
- xlabel('Pulse Number','FontSize',24);
- ylabel('p','FontSize',24);
- title('WT vs KO','FontSize',24); axis([1 20 0 1]);
- saveas(gcf, fullfile(saveFolder,'L23_p_WT_vs_KO_MW_1-50ms.png','epsc'));
- %%
- one = squeeze(mean(stimtrials_L23_WT_neigh,1))';
- two = squeeze(mean(stimtrials_L23_KO_neigh,1))';
- [ds,ix,iy] = dtw(one,two);
- onewarp = one(:,ix);
- twowarp = two(:,iy);
- figure; set(gcf,'Position',[100 100 500 300]);
- imagesc(onewarp,[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',24); xticks([1 20 40 60 80]);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',22); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Neigh_WT_Image_Warped.png'),"Resolution",600);
- figure; set(gcf,'Position',[100 100 500 300]);
- imagesc(twowarp,[0 0.35]);
- colormap turbo; colorbar;
- colorbar('Ticks',[0 0.1 0.2 0.3 0.4],'TickLabels',{'0','0.1','0.2','0.3','0.4'});
- xlabel('Time (ms)','FontSize',24); xticks([1 20 40 60 80]);
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',22); yticks([1 5 10 15 20]);
- exportgraphics(gcf,fullfile(saveFolder,'L23_Neigh_KO_Image_Warped.png'),"Resolution",600);
- %% L2/3 KO
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_L23_KO,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_L23_KO(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_KO_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_L23_KO_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_KO_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:50,stimtrials_L23_KO_neigh(ii,1:50,jj));
- end
- end
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,p),20,length(tempN(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t1,t3);
- pValues(3,p) = ranksum(t2,t3);
- end
- figure; set(gcf,'Position',[100 100 250 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1 2 3]); xticklabels({'BS','BN','SN'});
- exportgraphics(gcf,fullfile(saveFolder,'L23_BSN_KO_Stats_SW.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,1),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- plot([2 3],[17.8 17.8],'LineWidth',3,'Color','k');
- text(2.5,17.8,'*','HorizontalAlignment','center','FontSize',64);
- plot([1 3],[19 19],'LineWidth',3,'Color','k');
- text(2,19,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_BSN_stat_first_pulse.png'),"Resolution",600);
- % Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,2),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- % plot([2 3],[19 19],'LineWidth',3,'Color','k');
- % text(2.5,19.1,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_BSN_stat_second_pulse.png'),"Resolution",600);
- % Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,3),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- % plot([1 2],[12 12],'LineWidth',3,'Color','k');
- % text(1.5,12.1,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_BSN_stat_third_pulse.png'),"Resolution",600);
- % 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,20),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- % plot([1 2],[7.5 7.5],'LineWidth',3,'Color','k');
- % text(1.5,7.7,'**','HorizontalAlignment','center','FontSize',64);
- % plot([2 3],[5.5 5.5],'LineWidth',3,'Color','k');
- % text(2.5,5.7,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_KO_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% L4 KO
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(stimtrials_L4_KO,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:50,stimtrials_L4_KO(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_KO_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:50,stimtrials_L4_KO_septa(ii,1:50,jj));
- end
- end
- for ii = 1:size(stimtrials_L4_KO_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:50,stimtrials_L4_KO_neigh(ii,1:50,jj));
- end
- end
- for p = 1:20
- t1 = mean(reshape(tempB(:,p),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,p),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,p),20,length(tempN(:,20))/20),1);
- pValues(1,p) = ranksum(t1,t2);
- pValues(2,p) = ranksum(t1,t3);
- pValues(3,p) = ranksum(t2,t3);
- end
- figure; set(gcf,'Position',[100 100 250 800]);
- imagesc(pValues',[0 0.05]); colormap gray; colorbar;
- colorbar('Ticks',[0 0.01 0.05],'TickLabels',{'***','**','*'});
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- ylabel('Pulse Number','FontSize',28); yticks((1:20));
- xlabel('pValue','FontSize',22); xticks([1 2 3]); xticklabels({'BS','BN','SN'});
- exportgraphics(gcf,fullfile(saveFolder,'L4_BSN_KO_Stats_SW.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(tempB(:,1),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,1),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,1),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- plot([2 3],[15 15],'LineWidth',3,'Color','k');
- text(2.5,15.1,'*','HorizontalAlignment','center','FontSize',64);
- plot([1 3],[17 17],'LineWidth',3,'Color','k');
- text(2,17.1,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_BSN_stat_first_pulse.png'),"Resolution",600);
- % Second Pulse
- t1 = mean(reshape(tempB(:,2),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,2),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,2),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- % plot([2 3],[19 19],'LineWidth',3,'Color','k');
- % text(2.5,19.1,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_BSN_stat_second_pulse.png'),"Resolution",600);
- % Third Pulse
- t1 = mean(reshape(tempB(:,3),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,3),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,3),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- % plot([1 2],[12.5 12.5],'LineWidth',3,'Color','k');
- % text(1.5,12.7,'**','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_BSN_stat_third_pulse.png'),"Resolution",600);
- % 20th Pulse
- t1 = mean(reshape(tempB(:,20),20,length(tempB(:,20))/20),1);
- t2 = mean(reshape(tempS(:,20),20,length(tempS(:,20))/20),1);
- t3 = mean(reshape(tempN(:,20),20,length(tempN(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', colorBarrelKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorBarrelKO/2);
- bar(2, mean(t2), 'FaceColor', colorSeptaKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorSeptaKO/2);
- bar(3, mean(t3), 'FaceColor', colorNeighKO, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',colorNeighKO/2);
- plot([1 2],[12 12],'LineWidth',3,'Color','k');
- text(1.5,12.2,'*','HorizontalAlignment','center','FontSize',64);
- plot([1 3],[14 14],'LineWidth',3,'Color','k');
- text(2,14.2,'*','HorizontalAlignment','center','FontSize',64);
- axis([0.5 3.5 0 20]);
- yticks(0:4:20);
- xticks([1 2 3]); xticklabels({'B' 'S' 'N'}); ylabel('AUC');
- set(gca,'FontSize',30); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L4_KO_BSN_stat_20th_pulse.png'),"Resolution",600);
- %% ANOVA Calculations - July 2025
- % Compate WT Barrel vs Septa
- % SW
- tempB_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_WT);
- tempS_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_WT_septa);
- tempN_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_WT_neigh);
- [rm, ranovaResults, timeResults] = calculate3ANOVA(tempB_perBarrel,tempS_perBarrel,tempN_perBarrel)
- size(tempB_perBarrel)
- size(tempS_perBarrel)
- size(tempN_perBarrel)
- % MW
- tempB_MW_perBarrel = convertTrialtoPerBarrel(stimtrials_MW_L4_WT);
- tempS_MW_perBarrel = convertTrialtoPerBarrel(stimtrials_MW_L4_WT_septa);
- [rm, ranovaResults, timeResults] = calculateANOVA(tempB_MW_perBarrel,tempS_MW_perBarrel)
- size(tempB_MW_perBarrel)
- size(tempS_MW_perBarrel)
- % MW_SW
- mw_sw_L4_WT_Barrel = (tempB_MW_perBarrel./tempB_perBarrel);
- mw_sw_L4_WT_Septa = (tempS_MW_perBarrel./tempS_perBarrel);
- [rm, ranovaResults, timeResults] = calculateANOVA(mw_sw_L4_WT_Barrel,mw_sw_L4_WT_Septa)
- size(mw_sw_L4_WT_Barrel)
- size(mw_sw_L4_WT_Septa)
- % Compate KO Barrel vs Septa
- % SW
- tempB_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_KO);
- tempS_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_KO_septa);
- tempN_perBarrel = convertTrialtoPerBarrel(stimtrials_L4_KO_neigh);
- [rm, ranovaResults, timeResults] = calculate3ANOVA(tempB_perBarrel,tempS_perBarrel,tempN_perBarrel)
- size(tempB_perBarrel)
- size(tempS_perBarrel)
- size(tempN_perBarrel)
- % MW
- tempB_MW_perBarrel = convertTrialtoPerBarrel(stimtrials_MW_L4_KO);
- tempS_MW_perBarrel = convertTrialtoPerBarrel(stimtrials_MW_L4_KO_septa);
- [rm, ranovaResults, timeResults] = calculateANOVA(tempB_MW_perBarrel,tempS_MW_perBarrel)
- size(tempB_MW_perBarrel)
- size(tempS_MW_perBarrel)
- % MW_SW
- mw_sw_L4_KO_Barrel = (tempB_MW_perBarrel./tempB_perBarrel);
- mw_sw_L4_KO_Septa = (tempS_MW_perBarrel./tempS_perBarrel);
- [rm, ranovaResults, timeResults] = calculateANOVA(mw_sw_L4_KO_Barrel,mw_sw_L4_KO_Septa)
- size(mw_sw_L4_KO_Barrel)
- size(mw_sw_L4_KO_Septa)
- %% ANOVA Stats June 2025
- all_L4_WT_ratio_Barrel_Combined = (L4_WT_MW_Barrel_Max./L4_WT_SW_Barrel_Max);
- all_L4_WT_ratio_Septa_Combined = (L4_WT_MW_Septa_Max./L4_WT_SW_Septa_Max);
- all_L4_KO_ratio_Barrel_Combined = (L4_KO_MW_Barrel_Max./L4_KO_SW_Barrel_Max);
- all_L4_KO_ratio_Septa_Combined = (L4_KO_MW_Septa_Max./L4_KO_SW_Septa_Max);
- dataA = all_L4_WT_ratio_Barrel_Combined; % Condition A : 14 Barrels, 20 time points
- dataB = all_L4_WT_ratio_Septa_Combined; % Condition B : 9 Septa, 20 time points
- data = [dataA; dataB]; % Combine : 23 BS x 20 time points
- condition = [repmat({'A'}, 13, 1); repmat({'B'}, 8, 1)];
- % Create table
- timeNames = arrayfun(@(x) sprintf('Time%d', x), 1:20, 'UniformOutput', false);
- T = array2table(data, 'VariableNames', timeNames);
- T.Condition = condition;
- % Define within-subject factor
- withinDesign = table((1:20)', 'VariableNames', {'Time'});
- withinDesign.Time = categorical(withinDesign.Time);
- % Fit repeated measures model
- rm = fitrm(T, 'Time1-Time20 ~ Condition', 'WithinDesign', withinDesign);
- % Run ANOVA
- ranovaResults = ranova(rm, 'WithinModel', 'Time');
- disp(ranovaResults);
- % Post-hoc tests (if needed)
- timeResults = multcompare(rm, 'Time', 'By', 'Condition');
- disp(timeResults);
- % Post-hoc test for Condition at each Time point
- rm = fitrm(T, 'Time1-Time20 ~ Condition', 'WithinDesign', table(categorical(1:20)', 'VariableNames', {'Time'}));
- timeResults = multcompare(rm, 'Condition', 'By', 'Time');
- disp(timeResults);
- %%
- dataA = all_L4_KO_ratio_Barrel_Combined; % Condition A: 13 subjects, 20 time points
- dataB = all_L4_KO_ratio_Septa_Combined; % Condition B: 8 subjects, 20 time points
- data = [dataA; dataB]; % Combine: 21 subjects x 20 time points
- condition = [repmat({'A'}, size(dataA,1), 1); repmat({'B'}, size(dataB,1), 1)];
- % Create table
- timeNames = arrayfun(@(x) sprintf('Time%d', x), 1:20, 'UniformOutput', false);
- T = array2table(data, 'VariableNames', timeNames);
- T.Condition = condition;
- % Define within-subject factor
- withinDesign = table((1:20)', 'VariableNames', {'Time'});
- withinDesign.Time = categorical(withinDesign.Time);
- % Fit repeated measures model
- rm = fitrm(T, 'Time1-Time20 ~ Condition', 'WithinDesign', withinDesign);
- % Run ANOVA
- ranovaResults = ranova(rm, 'WithinModel', 'Time');
- disp(ranovaResults);
- % Post-hoc tests (if needed)
- timeResults = multcompare(rm, 'Time', 'By', 'Condition');
- disp(timeResults);
- % Post-hoc test for Condition at each Time point
- rm = fitrm(T, 'Time1-Time20 ~ Condition', 'WithinDesign', table(categorical(1:20)', 'VariableNames', {'Time'}));
- timeResults = multcompare(rm, 'Condition', 'By', 'Time');
- disp(timeResults);
- %% SW_MW Ratios
- %%
- for s = 1:20
- stimtrials_L23_WT(:,:,s) = temp_L23_WT(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_WT_septa(:,:,s) = temp_L23_WT_septa(:,beglocs(s):beglocs(s)+94);
- stimtrials_L23_WT_neigh(:,:,s) = temp_L23_WT_neigh(:,beglocs(s):beglocs(s)+94);
- end
- tempB = []; tempS = []; tempN = [];
- for ii = 1:size(noBase_stimtrials_L23_WT,1)
- for jj = 1:20
- tempB(ii,jj) = trapz(1:94,stimtrials_L23_WT(ii,1:94,jj));
- end
- end
- for ii = 1:size(noBase_stimtrials_L23_WT_septa,1)
- for jj = 1:20
- tempS(ii,jj) = trapz(1:94,stimtrials_L23_WT_septa(ii,1:94,jj));
- end
- end
- for ii = 1:size(noBase_stimtrials_L23_WT_neigh,1)
- for jj = 1:20
- tempN(ii,jj) = trapz(1:94,stimtrials_L23_WT_neigh(ii,1:94,jj));
- end
- end
- figure , errorbar((1:20)+rand(1,20)/5,mean(tempB),std(temp,[],1)/sqrt(size(noBase_stimtrials_L23_WT,1)/20),'Color',colorBarrel,'LineWidth',4);
- hold on , errorbar((1:20)+rand(1,20)/5,mean(tempS),std(temp3,[],1)/sqrt(size(noBase_stimtrials_L23_WT_septa,1)/20),'Color',colorSepta,'LineWidth',4);
- hold on , errorbar((1:20)+rand(1,20)/5,mean(tempN),std(temp2,[],1)/sqrt(size(noBase_stimtrials_L23_WT_neigh,1)/20),'Color',colorNeigh,'LineWidth',4);
- legend({'Barrel','Septa','Neighbour'},'FontSize',20);
- axis([0.5 20.5 0 1.1]);
- yticks([0 0.05 0.1 0.15 0.20]); yticklabels({'0','0.05','0.10','0.15','0.20'});
- xticks([1 5 10 15 20]); ylabel('MUA'); xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN.png'),"Resolution",600);
- %% Average of Everything
- m1 = squeeze(mean(mean(stimtrials_L4_WT(:,:,1:20),3),1));
- m1 = m1 - m1(1); m1 = m1/max(m1);
- m2 = squeeze(mean(mean(stimtrials_L4_WT_septa(:,:,1:20),3),1));
- m2 = m2 - m2(1); m2 = m2/max(m2);
- m3 = squeeze(mean(mean(stimtrials_L4_WT_neigh(:,:,1:20),3),1));
- m3 = m3 - m3(1); m3 = m3/max(m3);
- figure , plot(m1,'Color',colorBarrel,'LineWidth',4);
- hold on, plot(m2,'Color',colorSepta,'LineWidth',4);
- hold on, plot(m3,'Color',colorNeigh,'LineWidth',4);
- m1ko = squeeze(mean(mean(stimtrials_L4_KO(:,:,1:20),3),1));
- m1ko = m1ko - m1ko(1); m1ko = m1ko/max(m1ko);
- m2ko = squeeze(mean(mean(stimtrials_L4_KO_septa(:,:,1:20),3),1));
- m2ko = m2ko - m2ko(1); m2ko = m2ko/max(m2ko);
- m3ko = squeeze(mean(mean(stimtrials_L4_KO_neigh(:,:,1:20),3),1));
- m3ko = m3ko - m3ko(1); m3ko = m3ko/max(m3ko);
- figure , plot(m1ko,'Color',colorBarrelKO,'LineWidth',4);
- hold on, plot(m2ko,'Color',colorSeptaKO,'LineWidth',4);
- hold on, plot(m3ko,'Color',colorNeighKO,'LineWidth',4);
- %% T-SNE PLOTS December 2024
- dataset1 = stimtrials_L4_WT(:,1:45,:);
- dataset2 = stimtrials_L4_WT_septa(:,1:45,:);
- dataset3 = stimtrials_L4_WT_neigh(:,1:45,:);
- dataset4 = stimtrials_L4_KO(:,1:45,:);
- dataset5 = stimtrials_L4_KO_septa(:,1:45,:);
- dataset6 = stimtrials_L4_KO_neigh(:,1:45,:);
- ds1 = []; ds2 = []; ds3 = []; ds4 = []; ds5 = []; ds6 = [];
- ch = 1;
- for h = 1:20:size(dataset1,1)
- temp1 = mean(dataset1(h:h+19,:,:),1);
- ds1(ch,:) = temp1(:);
- ch = ch + 1;
- end
- ch = 1;
- for h = 1:20:size(dataset2,1)
- temp2 = mean(dataset2(h:h+19,:,:),1);
- ds2(ch,:) = temp2(:);
- ch = ch + 1;
- end
- ch = 1;
- for h = 1:20:size(dataset3,1)
- temp3 = mean(dataset3(h:h+19,:,:),1);
- ds3(ch,:) = temp3(:);
- ch = ch + 1;
- end
- ch = 1;
- for h = 1:20:size(dataset4,1)
- temp4 = mean(dataset4(h:h+19,:,:),1);
- ds4(ch,:) = temp4(:);
- ch = ch + 1;
- end
- ch = 1;
- for h = 1:20:size(dataset5,1)
- temp5 = mean(dataset5(h:h+19,:,:),1);
- ds5(ch,:) = temp5(:);
- ch = ch + 1;
- end
- ch = 1;
- for h = 1:20:size(dataset6,1)
- temp6 = mean(dataset6(h:h+19,:,:),1);
- ds6(ch,:) = temp6(:);
- ch = ch + 1;
- end
- Y = tsne([ds1; ds2; ds3; ds4; ds5; ds6],...
- 'Algorithm','barneshut','Perplexity',3,'NumPCAComponents',2,'Exaggeration',6);
- genotype = [ones(1,size(ds1,1)) 2*ones(1,size(ds2,1)) 3*ones(1,size(ds3,1))...
- 4*ones(1,size(ds4,1)) 5*ones(1,size(ds5,1)) 6*ones(1,size(ds6,1))];
- figure; gscatter(Y(:,1),Y(:,2),genotype);
- %%
- m1 = squeeze(mean(mean(stimtrials_MW_L4_WT_septa(:,:,1:20),3),1));
- m1 = m1 - m1(1); m1 = m1/max(m1);
- m2 = squeeze(mean(mean(stimtrials_MW_L4_KO_septa(:,:,1:20),3),1));
- m2 = m2 - m2(1); m2 = m2/max(m2);
- figure , plot(m1,'Color',colorSepta,'LineWidth',4);
- hold on, plot(m2,'Color',colorSepta/2,'LineWidth',4);
- %% L2/3 WT
- temp = [];
- temp2 = [];
- temp3 = [];
- for ii = 1:size(stimtrials_L23_WT,1)
- for jj = 1:20
- temp(ii,jj) = max(stimtrials_L23_WT(ii,1:25,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_WT_neigh,1)
- for jj = 1:20
- temp2(ii,jj) = max(stimtrials_L23_WT_neigh(ii,1:25,jj));
- end
- end
- for ii = 1:size(stimtrials_L23_WT_septa,1)
- for jj = 1:20
- temp3(ii,jj) = max(stimtrials_L23_WT_septa(ii,1:25,jj));
- end
- end
- figure , errorbar((1:20)+rand(1,20)/5,mean(temp) ,std(temp,[],1)/sqrt(size(stimtrials_L23_WT,1)/20),'Color',colorBarrel,'LineWidth',4);
- hold on , errorbar((1:20)+rand(1,20)/5,mean(temp3),std(temp3,[],1)/sqrt(size(stimtrials_L23_WT_septa,1)/20),'Color',colorSepta,'LineWidth',4);
- hold on , errorbar((1:20)+rand(1,20)/5,mean(temp2),std(temp2,[],1)/sqrt(size(stimtrials_L23_WT_neigh,1)/20),'Color',colorNeigh,'LineWidth',4);
- legend({'Barrel','Septa','Neighbour'},'FontSize',20);
- axis([0.5 20.5 0 0.245]);
- yticks([0 0.05 0.1 0.15 0.20]); yticklabels({'0','0.05','0.10','0.15','0.20'});
- xticks([1 5 10 15 20]); ylabel('MUA'); xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN.png'),"Resolution",600);
- figure , bar(mean(temp_L23_WT),5,'FaceColor',color1,'LineWidth',15); set(gca,'visible','off');
- hold on, bar(mean(temp_L23_WT_neigh),5,'FaceColor',color2,'LineWidth',15);
- hold on, bar(mean(temp_L23_WT_septa),5,'FaceColor',color3,'LineWidth',15);
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_spikes.png'),"Resolution",600);
- % First Pulse
- t1 = mean(reshape(temp(:,1),20,length(temp(:,20))/20),1);
- t2 = mean(reshape(temp2(:,1),20,length(temp2(:,20))/20),1);
- t3 = mean(reshape(temp3(:,1),20,length(temp3(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', color1, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color1/2);
- bar(2, mean(t2), 'FaceColor', color2, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color2/2);
- bar(3, mean(t3), 'FaceColor', color3, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color3/2);
- % legend({'Barrel','Neighbour','Septa'},'FontSize',24);
- axis([0.5 3.5 0 0.45]);
- yticks([0 0.05 0.1 0.15 0.20 0.25 0.30 0.35 0.40]); yticklabels({'0' '0.05' '0.10' '0.15' '0.20' '0.25' '0.30' '0.35' '0.40'});
- yticks([0 0.05 0.1 0.15 0.20 0.25 0.30 0.35 0.40]); yticklabels({'0' '0.05' '0.10' '0.15' '0.20' '0.25' '0.30' '0.35' '0.40'}); xticks([1 2 3]); xticklabels({'B' 'N' 'S'}); ylabel('MUA'); %xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_first_pulse.png'),"Resolution",600);
- % Second Pulse
- t1 = mean(reshape(temp(:,2),20,length(temp(:,20))/20),1);
- t2 = mean(reshape(temp2(:,2),20,length(temp2(:,20))/20),1);
- t3 = mean(reshape(temp3(:,2),20,length(temp3(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', color1, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color1/2);
- bar(2, mean(t2), 'FaceColor', color2, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color2/2);
- bar(3, mean(t3), 'FaceColor', color3, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color3/2);
- plot([1 2],[0.27 0.27],'LineWidth',3,'Color','k');
- text(1.5,0.271,'***','HorizontalAlignment','center','FontSize',64);
- % plot([1 3],[0.27 0.27],'LineWidth',3,'Color','k');
- % text(2,0.271,'*','HorizontalAlignment','center','FontSize',64);
- % legend({'Barrel','Neighbour','Septa'},'FontSize',24);
- axis([0.5 3.5 0 0.3]);
- yticks([0 0.05 0.1 0.15 0.20 0.25 0.30 0.35 0.40]); yticklabels({'0' '0.05' '0.10' '0.15' '0.20' '0.25' '0.30' '0.35' '0.40'}); xticks([1 2 3]); xticklabels({'B' 'N' 'S'}); ylabel('MUA'); %xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_second_pulse.png'),"Resolution",600);
- % Third Pulse
- t1 = mean(reshape(temp(:,3),20,length(temp(:,20))/20),1);
- t2 = mean(reshape(temp2(:,3),20,length(temp2(:,20))/20),1);
- t3 = mean(reshape(temp3(:,3),20,length(temp3(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', color1, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color1/2);
- bar(2, mean(t2), 'FaceColor', color2, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color2/2);
- bar(3, mean(t3), 'FaceColor', color3, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color3/2);
- plot([1 2],[0.27 0.27],'LineWidth',3,'Color','k');
- text(1.5,0.271,'***','HorizontalAlignment','center','FontSize',64);
- % plot([1 3],[0.27 0.27],'LineWidth',3,'Color','k');
- % text(2,0.271,'*','HorizontalAlignment','center','FontSize',64);
- % legend({'Barrel','Neighbour','Septa'},'FontSize',24);
- axis([0.5 3.5 0 0.3]);
- yticks([0 0.05 0.1 0.15 0.20 0.25 0.30 0.35 0.40]); yticklabels({'0' '0.05' '0.10' '0.15' '0.20' '0.25' '0.30' '0.35' '0.40'}); xticks([1 2 3]); xticklabels({'B' 'N' 'S'}); ylabel('MUA'); %xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_second_pulse.png'),"Resolution",600);
- % Last Pulse
- t1 = mean(reshape(temp(:,20),20,length(temp(:,20))/20),1);
- t2 = mean(reshape(temp2(:,20),20,length(temp2(:,20))/20),1);
- t3 = mean(reshape(temp3(:,20),20,length(temp3(:,20))/20),1);
- clc;
- ranksum(t1,t2)
- ranksum(t1,t3)
- ranksum(t2,t3)
- figure; set(gcf,'Position',[1200 100 300 500]); hold on;
- bar(1, mean(t1), 'FaceColor', color1, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1)-std(t1)/sqrt(length(t1)) mean(t1)+std(t1)/sqrt(length(t1))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1))-0.1+rand(1,length(t1))/5,t1,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color1/2);
- bar(2, mean(t2), 'FaceColor', color2, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2)-std(t2)/sqrt(length(t2)) mean(t2)+std(t2)/sqrt(length(t2))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2))-0.1+rand(1,length(t2))/5,t2,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color2/2);
- bar(3, mean(t3), 'FaceColor', color3, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3)-std(t3)/sqrt(length(t3)) mean(t3)+std(t3)/sqrt(length(t3))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3))-0.1+rand(1,length(t3))/5,t3,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color3/2);
- plot([1 2],[0.25 0.25],'LineWidth',3,'Color','k');
- text(1.5,0.251,'***','HorizontalAlignment','center','FontSize',64);
- plot([1 3],[0.27 0.27],'LineWidth',3,'Color','k');
- text(2,0.271,'*','HorizontalAlignment','center','FontSize',64);
- % legend({'Barrel','Neighbour','Septa'},'FontSize',24);
- axis([0.5 3.5 0 0.3]);
- yticks([0 0.05 0.1 0.15 0.20 0.25 0.30 0.35 0.40]); yticklabels({'0' '0.05' '0.10' '0.15' '0.20' '0.25' '0.30' '0.35' '0.40'}); xticks([1 2 3]); xticklabels({'B' 'N' 'S'}); ylabel('MUA'); %xlabel('Pulse Number');
- set(gca,'FontSize',24); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_last_pulse.png'),"Resolution",600);
- t1_sw = mean(reshape(temp(:,1),20,length(temp(:,20))/20),1);
- t2_sw = mean(reshape(temp2(:,1),20,length(temp2(:,20))/20),1);
- t3_sw = mean(reshape(temp3(:,1),20,length(temp3(:,20))/20),1);
- t1_mw = 100-100*mean(reshape(temp(:,20),20,length(temp(:,20))/20),1)./t1_sw;
- t2_mw = 100-100*mean(reshape(temp2(:,20),20,length(temp2(:,20))/20),1)./t2_sw;
- t3_mw = 100-100*mean(reshape(temp3(:,20),20,length(temp3(:,20))/20),1)./t3_sw;
- signrank(t1_sw,t1_mw)
- signrank(t2_sw,t2_mw)
- signrank(t3_sw,t3_mw)
- figure; set(gcf,'Position',[1200 100 450 400]); hold on;
- bar(1, mean(t1_mw), 'FaceColor', color1, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([1 1],[mean(t1_mw)-std(t1_mw)/sqrt(length(t1_mw)) mean(t1_mw)+std(t1_mw)/sqrt(length(t1_mw))],'LineWidth',5,'Color','k');
- plot(ones(1,length(t1_mw))-0.1+rand(1,length(t1_mw))/5,t1_mw,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color1/2);
- bar(2, mean(t2_mw), 'FaceColor', color2, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([2 2],[mean(t2_mw)-std(t2_mw)/sqrt(length(t2_mw)) mean(t2_mw)+std(t2_mw)/sqrt(length(t2_mw))],'LineWidth',5,'Color','k');
- plot(2*ones(1,length(t2_mw))-0.1+rand(1,length(t2_mw))/5,t2_mw,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color2/2);
- bar(3, mean(t3_mw), 'FaceColor', color3, 'EdgeColor', 'none', 'BarWidth', 0.6);
- plot([3 3],[mean(t3_mw)-std(t3_mw)/sqrt(length(t3_mw)) mean(t3_mw)+std(t3_mw)/sqrt(length(t3_mw))],'LineWidth',5,'Color','k');
- plot(3*ones(1,length(t3_mw))-0.1+rand(1,length(t3_mw))/5,t3_mw,'Marker','.','MarkerSize',38,'LineStyle','none','Color',color3/2);
- text(1,30,'***','HorizontalAlignment','center','FontSize',52,'Color','w');
- text(2,30,'***','HorizontalAlignment','center','FontSize',52,'Color','w');
- text(3,30,'**','HorizontalAlignment','center','FontSize',52,'Color','w');
- % legend({'Barrel','Neighbour','Septa'},'FontSize',24);
- axis([0.5 3.5 0 100]);
- yticks(0:20:100);
- xticks([1 2 3]); xticklabels({'B' 'N' 'S'}); ylabel('%Adaptation'); %xlabel('Pulse Number');
- set(gca,'FontSize',36); set(gca,'TickDir','out');
- exportgraphics(gcf,fullfile(saveFolder,'L23_WT_BSN_stat_Adaptation.png'),"Resolution",600);
- %%
- allPred_WT_L23 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L23_WT(:,:,stimNum);
- d_WT_Septa = stimtrials_L23_WT_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L23_WT_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L23_WT_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_WT_L23(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- allPred_KO_L23 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L23_KO(:,:,stimNum);
- d_WT_Septa = stimtrials_L23_KO_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L23_KO_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L23_KO_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_KO_L23(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- allPred_WT_L4 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L4_WT(:,:,stimNum);
- d_WT_Septa = stimtrials_L4_WT_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L4_WT_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L4_WT_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_WT_L4(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- allPred_KO_L4 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L4_KO(:,:,stimNum);
- d_WT_Septa = stimtrials_L4_KO_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L4_KO_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L4_KO_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_KO_L4(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- allPred_WT_L5 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L5_WT(:,:,stimNum);
- d_WT_Septa = stimtrials_L5_WT_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L5_WT_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L5_WT_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_WT_L5(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- allPred_KO_L5 = [];
- for stimNum = 1:20
- d_WT = stimtrials_L5_KO(:,:,stimNum);
- d_WT_Septa = stimtrials_L5_KO_septa(:,:,stimNum);
- d_WT_Neigh = stimtrials_L5_KO_neigh(:,:,stimNum);
- y1 = ones(1,size(d_WT,1));
- y2 = 2*ones(1,size(d_WT_Septa,1));
- y3 = 3*ones(1,size(d_WT_Neigh,1));
- labelVector = repelem([{'Barrel'}, {'Septa'}, {'Neighbor'}],...
- [size(d_WT,1) size(d_WT_Septa,1) size(d_WT_Neigh,1)])';
- Y = labelVector;
- X = [d_WT; d_WT_Septa; d_WT_Neigh];
- tmp = templateEnsemble('GentleBoost',100,templateTree('surrogate','on'));
- opt = statset('UseParallel',true);
- ecoc = fitcecoc(X,Y,'Coding','onevsall','Learners',tmp,...
- 'Prior','uniform','Options',opt);
- cvecoc = crossval(ecoc,'Options',opt);
- Yhat = kfoldPredict(cvecoc,'Options',opt);
- figure;
- ConfMat = confusionchart(Y,Yhat,'Title',sprintf('Pulse Number: %d',stimNum), ...
- 'RowSummary','row-normalized', ...
- 'ColumnSummary','column-normalized');
- ConfMat.InnerPosition = [0.20 0.15 0.75 0.75];
- ConfMat.FontSize = 24;
- saveas(gcf, fullfile(saveFolder,sprintf('L5_KO_BSN_Decode_%d.png',stimNum),"Resolution",600));
- close all;
- allPred_KO_L5(:,:,stimNum) = confusionmat(Y,Yhat);
- end
- figure , plot(allPred_WT_L23(:));
- hold on, plot(allPred_KO_L23(:));
- figure; hold on;
- for i = 1:9
- plot(allPred_WT_L23(i,:));
- end
- figure , plot(squeeze(allPred_WT_L23(1,1,:))/allPred_WT_L23(1,1,1),'Color',colorBarrel,'LineWidth',3);
- hold on, plot(squeeze(allPred_WT_L23(2,2,:))/allPred_WT_L23(2,2,1),'Color',colorNeigh ,'LineWidth',3);
- hold on, plot(squeeze(allPred_WT_L23(3,3,:))/allPred_WT_L23(3,3,1),'Color',colorSepta ,'LineWidth',3);
- figure , plot(squeeze(allPred_KO_L23(1,1,:))/allPred_KO_L23(1,1,1),'Color',colorBarrelKO,'LineWidth',3);
- hold on, plot(squeeze(allPred_KO_L23(2,2,:))/allPred_KO_L23(2,2,1),'Color',colorNeighKO ,'LineWidth',3);
- hold on, plot(squeeze(allPred_KO_L23(3,3,:))/allPred_KO_L23(3,3,1),'Color',colorSeptaKO ,'LineWidth',3);
- %%
- [Y2, scores] = kfoldPredict(cvecoc,'Options',opt);
- %% plot ROCs
- figure; hold on;
- for i = 1:length(ecoc.ClassNames)
- [xr, yr, ~, auc] = perfcurve(Y2,scores(:, i), ecoc.ClassNames(i));
- auc
- plot(xr, yr, 'linewidth', 1);
- legends{i} = sprintf('AUC for %s class: %.3f', ecoc.ClassNames(i), auc);
- end
- legend(legends, 'location', 'southeast')
- line([0 1], [0 1], 'linestyle', ':', 'color', 'k');
- xlabel('FPR'), ylabel('TPR')
- title('ROC for Iris Classification (1 vs Others)')
- axis square
- [~,score_nb] = resubPredict(ecoc);
- mdlSVM = fitPosterior(ecoc);
- [Xnb,Ynb,Tnb,AUCnb] = perfcurve(Y,score_nb(:,ecoc.ClassNames),'true');
- [X,Y,T,AUC] = perfcurve(species(51:end,:),scores,'virginica');
- figure , plot(squeeze(allPred_WT(1,1,:)),'Color',colorBarrel,'LineWidth',3);
- hold on, plot(squeeze(allPred_WT(2,2,:)),'Color',colorSepta,'LineWidth',3);
- hold on, plot(squeeze(allPred_WT(3,3,:)),'Color',colorNeigh,'LineWidth',3);
- figure , plot(squeeze(allPred_KO(1,1,:)),'Color',colorBarrelKO,'LineWidth',3);
- hold on, plot(squeeze(allPred_KO(2,2,:)),'Color',colorSeptaKO,'LineWidth',3);
- hold on, plot(squeeze(allPred_KO(3,3,:)),'Color',colorNeighKO,'LineWidth',3);
- %%
- figure , plot(squeeze(mean(norm_stimtrials_L23_WT(:,:,1),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_WT_septa(:,:,1),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_WT_neigh(:,:,1),1)),'LineWidth',2);
- figure , plot(squeeze(mean(norm_stimtrials_L23_WT(:,:,2),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_WT_septa(:,:,2),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_WT_neigh(:,:,2),1)),'LineWidth',2);
- figure , plot(squeeze(mean(norm_stimtrials_L23_KO(:,:,1),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_KO_septa(:,:,1),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_KO_neigh(:,:,1),1)),'LineWidth',2);
- figure , plot(squeeze(mean(norm_stimtrials_L23_KO(:,:,2),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_KO_septa(:,:,2),1)),'LineWidth',2);
- hold on, plot(squeeze(mean(norm_stimtrials_L23_KO_neigh(:,:,2),1)),'LineWidth',2);
- %%
- figure , imagesc(squeeze(mean(norm_stimtrials_L23_WT,1))',[0 0.5]); colormap hot;
- hold on, imagesc(squeeze(mean(norm_stimtrials_L23_WT_septa,1))',[0 0.5]); colormap hot;
- hold on, imagesc(squeeze(mean(norm_stimtrials_L23_WT_neigh,1))',[0 0.5]); colormap hot;
- figure, imagesc(squeeze(mean(norm_stimtrials_L23_KO,1))'-squeeze(mean(norm_stimtrials_L23_WT,1))',[-0.25 0.25]); colormap hot;
- figure, imagesc(squeeze(mean(norm_stimtrials_L4_KO,1))'-squeeze(mean(norm_stimtrials_L4_WT,1))',[-0.25 0.25]); colormap hot;
- figure, imagesc(squeeze(mean(norm_stimtrials_L5_KO,1))'-squeeze(mean(norm_stimtrials_L5_WT,1))',[-0.25 0.25]); colormap hot;
- figure, imagesc((squeeze(mean(norm_stimtrials_L23_KO,1))'-squeeze(mean(norm_stimtrials_L23_WT,1))')...
- -(squeeze(mean(norm_stimtrials_L4_KO,1))'-squeeze(mean(norm_stimtrials_L4_WT,1))'),[-0.25 0.25]); colormap hot;
- gprMdl = fitrgp((1:96)',squeeze(mean(norm_stimtrials_L23_KO(:,:,1),1)),'Basis','linear',...
- 'FitMethod','exact','PredictMethod','exact');
- ypred = resubPredict(gprMdl);
- figure;
- plot(1:96,squeeze(mean(norm_stimtrials_L23_KO(:,:,1),1))','b.');
- hold on;
- plot(1:96,ypred,'r','LineWidth',1.5);
Source Code 3.m, no license · at the source
Overview
- Laboratory of Neural Circuit Assembly, Brain Research Institute, University of Zurich Winterthurerstrasse, Zurich, Switzerland
- Neuroscience Center Zurich, University of Zurich and ETH Zurich, Winterthurerstrasse, Zurich, Switzerland
- Division of Biomedical Sciences, Faculty of Medicine, Memorial University of Newfoundland, St. John's, Canada
- Department of Stem Cell & Regenerative Biology, Harvard University, Cambridge, United States
- University Research Priority Program (URPP), Adaptive Brain Circuits in Development and Learning, University of Zurich, Zurich, Switzerland
Abstract
Mice, like humans, enhance tactile perception through repeated sampling of spatially segregated sensory inputs. In the whisker system, individual whisker identity is preserved along the whisker-brainstem-thalam
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
supp:PMC13485306/elife-107099-code1.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
1 file
- eLife-VOR-RA-2025-107099
/ , MATLAB, 224 linesSource Code 1.m
supp:PMC13485306/elife-107099-code2.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
1 file
- eLife-VOR-RA-2025-107099
/ , MATLAB, 191 linesSource Code 2.m
supp:PMC13485306/elife-107099-code3.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
1 file
- eLife-VOR-RA-2025-107099
/ , MATLAB, 2,922 lines, 2 matchesSource Code 3.m
supp:PMC13485306/elife-107099-code5.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
1 file
- eLife-VOR-RA-2025-107099
/ , MATLAB, 82 lines, 1 matchSource Code 5.m
supp:PMC13485306/elife-107099-code6.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
1 file
- eLife-VOR-RA-2025-107099
/ , MATLAB, 184 linesanova_rm.m
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 5 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 5 scripts, each with its path and the digest of its content;
- 3 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
- doi:10.5061/
dryad.4qrfj6qt8 , at Dryad; found in DataCite
Data availability
All data generated and analyzed during this study are available in the Dryad Digital Repository at https://
The following dataset was generated:
Argunşah A, Stachniak T, Yang J, Cai L, van der Bourg A, Kastli R, Karayannis T. 2026. Data from: Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex. Dryad Digital Repository.
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 7 authors, 1 keyword, 7 MeSH terms, 2 funders, 80 references, 11 RRIDs.
Cite
This paper
Argunşah, A. Ö., Stachniak, T. J., Yang, J.-W., Cai, L., van der Bourg, A., Kastli, R., & Karayannis, T. (2026). Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex. eLife, 14, RP107099. https://
BibTeX
@article{argunsah2026loc
author = {Argunşah, Ali Özgür and Stachniak, Tevye Jason and Yang, Jenq-Wei and Cai, Linbi and van der Bourg, Alexander and Kastli, Rahel and Karayannis, Theofanis},
title = {{Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex}},
journal = {eLife},
year = {2026},
month = aug,
volume = {14},
pages = {RP107099},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/
url = {https://
pmid = {42610441},
pmcid = {PMC13485306}
}
RIS
TY - JOUR
AU - Argunşah, Ali Özgür
AU - Stachniak, Tevye Jason
AU - Yang, Jenq-Wei
AU - Cai, Linbi
AU - van der Bourg, Alexander
AU - Kastli, Rahel
AU - Karayannis, Theofanis
TI - Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex
T2 - eLife
J2 - Elife
PY - 2026
DA - 2026/
VL - 14
SP - RP107099
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.7554/
"type": "article-journal",
"title": "Local inhibitory dynamics underpin temporal integration and functional segregation between barrels and septa in the mouse barrel cortex",
"container-title": "eLife",
"author": [
{
"family": "Argunşah",
"given": "Ali Özgür"
},
{
"family": "Stachniak",
"given": "Tevye Jason"
},
{
"family": "Yang",
"given": "Jenq-Wei"
},
{
"family": "Cai",
"given": "Linbi"
},
{
"family": "van der Bourg",
"given": "Alexander"
},
{
"family": "Kastli",
"given": "Rahel"
},
{
"family": "Karayannis",
"given": "Theofanis"
}
],
"container-title-short":
"volume": "14",
"page": "RP107099",
"DOI": "10.7554/
"PMID": "42610441",
"PMCID": "PMC13485306",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
18
]
]
}
}
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.34133/research.1295
- A Corticotectal Pathway Regulates Vibrissal Somatosensory-Mediated Predatory Hunting Learning.Journal: Research (Washington, D.C.)In common: 6 references
- [2] doi:10.3389/fnins.2026.1605209 [code]
- Spiking neural networks provide accurate and time-efficient models for whisker stimulus classification of the awake mouse.Journal: Frontiers in neuroscienceIn common: Signal Processing Toolbox, mouse, 4 references
- [3] doi:10.1038/s42003-026-10418-2 [code]
- Cortical PV and VIP interneurons similarly influence SST neuron output despite distinct unitary properties.Journal: Communications biologyIn common: mouse, 5 references
- [4] doi:10.1038/s41467-026-73622-y [code]
- Contextual gating of whisker-evoked responses by frontal cortex supports flexible decision making.Journal: Nature communicationsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, mouse, 3 references
- [5] doi:10.1038/s41467-026-71331-0 [code]
- A multimodal approach for visualizing and identifying electrophysiological cell types in vivo.Journal: Nature communicationsIn common: mouse, 4 references
- [6] doi:10.1371/journal.pcbi.1014164 [code]
- 'Backpropagation and the brain' realized in cortical error neuron microcircuits.Journal: PLoS computational biologyIn common: 4 references
- [7] doi:10.1016/j.crmeth.2026.101481 [code]
- A hybrid micro-ECoG for functionally targeted multi-site and multi-scale investigation.Journal: Cell reports methodsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, systems, 2 references
- [8] doi:10.1371/journal.pbio.3003789 [code]
- Encoding performance of cortical neurons critically depends on their morphological and neurophysiological properties.Journal: PLoS biologyIn common: systems, mouse, 3 references
- [9] doi:10.1038/s41467-026-77800-w [code]
- Learning reorganizes dendritic and stabilizes axon initial segment inhibitory synapses in CA1 pyramidal neurons.Journal: Nature communicationsIn common: mouse, author Ali Öztürk Argunşah
- [10] doi:10.1038/s41586-026-10877-x [code]
- Human brain organoids record the passage of time over multiple years.Journal: NatureIn common: author Rahel Kastli
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: 5 repositories of the authors' code, each at its verified commit and with its license, 5 scripts, and 3 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:61c4714ebe114c7c…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
