|
|
|
|
|
clear; clc; close all;
|
|
|
|
|
|
cwd = pwd;
|
|
|
addpath(cwd);
|
|
|
|
|
|
datalocation = [cwd '\ALL_DATA\ALL_Processed_Data\']; % Data are here
|
|
|
% cd(datalocation);
|
|
|
|
|
|
% % sort all subject groups
|
|
|
[~, ~, groupTable] = xlsread([ cwd '\Patients_MS.xlsx'],'ALL_GROUP');
|
|
|
groupIDs = cell2mat(groupTable(2:end,:) );
|
|
|
|
|
|
% % load clinical scores for correlation analysis
|
|
|
[~, ~, groupInfo] = xlsread([ cwd '\Patients_MS.xlsx'],'Ped_Subjs');
|
|
|
|
|
|
CTLids = groupIDs(:,1); CTLids (isnan(CTLids)) = [];
|
|
|
PD_NFZids = groupIDs(:,2); PD_NFZids(isnan(PD_NFZids)) = [];
|
|
|
PD_FZids = groupIDs(:,3); PD_FZids(isnan(PD_FZids)) = [];
|
|
|
clear groupIDs
|
|
|
|
|
|
% % Import all analysis results here to plot
|
|
|
% #################### CONTROLS #####################################
|
|
|
for n = 1:length(CTLids)
|
|
|
|
|
|
disp([datalocation,'Control',num2str(CTLids(n)),'_ANALYZED.mat']);
|
|
|
load([datalocation,'Control',num2str(CTLids(n)),'_ANALYZED.mat']);
|
|
|
|
|
|
CTL.POWER(n,:,:,:,:) = MainOuts.POWER;
|
|
|
clear MainOuts
|
|
|
end
|
|
|
|
|
|
% % #################### PD NON-FREEZERS #############################
|
|
|
for n = 1:length(PD_NFZids)
|
|
|
disp([datalocation,'PD',num2str(PD_NFZids(n)),'_ANALYZED.mat']);
|
|
|
load([datalocation,'PD',num2str(PD_NFZids(n)),'_ANALYZED.mat']);
|
|
|
|
|
|
NFZ.POWER(n,:,:,:,:) = MainOuts.POWER;
|
|
|
clear MainOuts
|
|
|
end
|
|
|
|
|
|
% % #################### PD FREEZERS #################################
|
|
|
for n = 1:length(PD_FZids)
|
|
|
disp([datalocation,'PD',num2str(PD_FZids(n)),'_ANALYZED.mat']);
|
|
|
load([datalocation,'PD',num2str(PD_FZids(n)),'_ANALYZED.mat']);
|
|
|
|
|
|
FZ.POWER(n,:,:,:,:) = MainOuts.POWER;
|
|
|
clear MainOuts
|
|
|
end
|
|
|
|
|
|
|
|
|
%% Time-FREQUENCY POWER
|
|
|
tx2disp=-500:2:2000;
|
|
|
XLIM = [-500 2000];
|
|
|
|
|
|
min_freq = 1.0233; max_freq = 50; num_freqs=50;
|
|
|
frex = logspace(log10(min_freq),log10(max_freq),num_freqs);
|
|
|
|
|
|
CONDI = 1; % 1=GO cue;
|
|
|
CHANI(1) = find(strcmpi('Cz',{chanlocs.labels}));
|
|
|
|
|
|
% % %%%%%% POWER
|
|
|
% % % POWER Statistics: NFZ-CTL and FZ-CTL
|
|
|
YLIM = [1 50];
|
|
|
|
|
|
|
|
|
figure('rend','painters','pos',[10 10 1000 600])
|
|
|
ch=1;
|
|
|
CTLPOWER = CTL.POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
NFZPOWER = NFZ.POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
FZPOWER = FZ. POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
|
|
|
%%%% TF plots
|
|
|
clim = [-6 6];
|
|
|
subplot(2,3,1); imagesc(tx2disp,[], squeeze(mean(CTLPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
plot([0 0],YLIM,'k:'); title('Controls (CTL)'); set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end))); colorbar
|
|
|
|
|
|
subplot(2,3,2); imagesc(tx2disp,[], squeeze(mean(NFZPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
plot([0 0],YLIM,'k:'); title('PDFOG- (NFZ)'); set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end)));colorbar
|
|
|
|
|
|
subplot(2,3,3); imagesc(tx2disp,[], squeeze(mean(FZPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
plot([0 0],YLIM,'k:'); title('PDFOG+ (FZ)'); set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end)));colorbar
|
|
|
|
|
|
%%%% TF with ttest2: runthreshold2
|
|
|
clim = [-3 3];
|
|
|
subplot(2,3,4); imagesc(tx2disp,[], squeeze(mean(NFZPOWER,1)) - squeeze(mean(CTLPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
[Corrected_P] = Run_Thresh_2D_AS(squeeze(NFZPOWER) , squeeze(CTLPOWER),'between');
|
|
|
contour(tx2disp,1:50,Corrected_P,'k','linewidth',2); clear thresh ; plot([0 0],YLIM,'k:'); title('NFZ-CTL'); set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end))); colorbar
|
|
|
clear Corrected_P
|
|
|
|
|
|
subplot(2,3,5); imagesc(tx2disp,[], squeeze(mean(FZPOWER,1)) - squeeze(mean(CTLPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
[Corrected_P] = Run_Thresh_2D_AS( squeeze(FZPOWER) , squeeze(CTLPOWER),'between');
|
|
|
contour(tx2disp,1:50,Corrected_P,'k','linewidth',2); clear thresh ; plot([0 0],YLIM,'k:'); title('FZ-CTL');set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end)));colorbar
|
|
|
clear Corrected_P
|
|
|
|
|
|
subplot(2,3,6); imagesc(tx2disp,[], squeeze(mean(FZPOWER,1)) - squeeze(mean(NFZPOWER,1)) ); axis xy; hold on; colormap jet;
|
|
|
[Corrected_P] = Run_Thresh_2D_AS( squeeze(FZPOWER) , squeeze(NFZPOWER),'between');
|
|
|
contour(tx2disp,1:50,Corrected_P,'k','linewidth',2); clear thresh ; plot([0 0],YLIM,'k:'); title('FZ-NFZ');set(gca,'xlim',XLIM,'ylim',YLIM,'clim',clim,'YTick',1:4:length(frex),'YTickLabel',round(frex(1:4:end)));colorbar
|
|
|
clear Corrected_P
|
|
|
|
|
|
clear CTLPOWER NFZPOWER FZPOWER
|
|
|
|
|
|
suptitle ('Figure 3A and 3B : Cz: GoCue-locked POWER Difference');
|
|
|
|
|
|
%% % Save power values for frequency bands values for correlation analysis
|
|
|
ExpPOWER.CTL{ch} = CTL.POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
ExpPOWER.NFZ{ch} = NFZ.POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
ExpPOWER.FZ{ch} = FZ. POWER(:,CHANI(ch),:,:,CONDI);
|
|
|
|
|
|
ExpPOWER.groups = groupTable;
|
|
|
% % save POW_CTLNFZFZ_Subjs.mat ExpPOWER % save for correlation analysis
|
|
|
|
|
|
% % %%%% Define: Delta and Beta for pedaling Initiation
|
|
|
SubjIDs = cell2mat(ExpPOWER.groups(2:end,:) );
|
|
|
ch = 1;
|
|
|
|
|
|
% Theta Frequnecy band: pedaling Initiation
|
|
|
fqidx1 = max(find(frex <=3.5) ) ; fqidx2 = max(find(frex <=7.5) );
|
|
|
tmidx1 = find(round(tx2disp)==0); tmidx2 = find(round(tx2disp)==400);
|
|
|
|
|
|
% Beta Frequnecy band: pedaling execution
|
|
|
fqidx3 = max(find(frex <=12.5) ); fqidx4 = max(find(frex <=30) );
|
|
|
tmidx3 = find(round(tx2disp)==400); tmidx4 = find(round(tx2disp)==2000);
|
|
|
|
|
|
% pedaling Initiation (0-400 ms)
|
|
|
powCTL_GI.Te(:,ch) = squeeze(mean(mean(ExpPOWER.CTL{ch}(:,:,fqidx1:fqidx2,tmidx1:tmidx2),3),4 )); powCTL_GI.Be(:,ch) = squeeze(mean(mean(ExpPOWER.CTL{ch}(:,:,fqidx3:fqidx4,tmidx1:tmidx2),3),4 ));
|
|
|
powNFZ_GI.Te(:,ch) = squeeze(mean(mean(ExpPOWER.NFZ{ch}(:,:,fqidx1:fqidx2,tmidx1:tmidx2),3),4 )); powNFZ_GI.Be(:,ch) = squeeze(mean(mean(ExpPOWER.NFZ{ch}(:,:,fqidx3:fqidx4,tmidx1:tmidx2),3),4 ));
|
|
|
powFZ_GI.Te(:,ch) = squeeze(mean(mean(ExpPOWER.FZ{ch} (:,:,fqidx1:fqidx2,tmidx1:tmidx2),3),4 )); powFZ_GI.Be(:,ch) = squeeze(mean(mean(ExpPOWER.FZ{ch} (:,:,fqidx3:fqidx4,tmidx1:tmidx2),3),4 ));
|
|
|
|
|
|
powCTL_GI.Te(:,2) = SubjIDs(:,1); powCTL_GI.Be(:,2) = SubjIDs(:,1);
|
|
|
powNFZ_GI.Te(:,2) = SubjIDs(:,2); powNFZ_GI.Be(:,2) = SubjIDs(:,2);
|
|
|
powFZ_GI.Te(:,2) = SubjIDs(:,3); powFZ_GI.Be(:,2) = SubjIDs(:,3);
|
|
|
|
|
|
%%% pedaling (0-2000 ms)
|
|
|
powCTL_ped.Te(:,ch) = squeeze(mean(mean(ExpPOWER.CTL{ch}(:,:,fqidx1:fqidx2,tmidx1:tmidx4),3),4 )); powCTL_ped.Be(:,ch) = squeeze(mean(mean(ExpPOWER.CTL{ch}(:,:,fqidx3:fqidx4,tmidx1:tmidx4),3),4 ));
|
|
|
powNFZ_ped.Te(:,ch) = squeeze(mean(mean(ExpPOWER.NFZ{ch}(:,:,fqidx1:fqidx2,tmidx1:tmidx4),3),4 )); powNFZ_ped.Be(:,ch) = squeeze(mean(mean(ExpPOWER.NFZ{ch}(:,:,fqidx3:fqidx4,tmidx1:tmidx4),3),4 ));
|
|
|
powFZ_ped.Te(:,ch) = squeeze(mean(mean(ExpPOWER.FZ{ch} (:,:,fqidx1:fqidx2,tmidx1:tmidx4),3),4 )); powFZ_ped.Be(:,ch) = squeeze(mean(mean(ExpPOWER.FZ{ch} (:,:,fqidx3:fqidx4,tmidx1:tmidx4),3),4 ));
|
|
|
|
|
|
powCTL_ped.Te(:,2) = SubjIDs(:,1); powCTL_ped.Be(:,2) = SubjIDs(:,1);
|
|
|
powNFZ_ped.Te(:,2) = SubjIDs(:,2); powNFZ_ped.Be(:,2) = SubjIDs(:,2);
|
|
|
powFZ_ped.Te(:,2) = SubjIDs(:,3); powFZ_ped.Be(:,2) = SubjIDs(:,3);
|
|
|
|
|
|
% % Topo plots
|
|
|
figure('rend','painters','pos',[10 10 800 500])
|
|
|
pvl = 0.01;
|
|
|
|
|
|
[~,P,~,~]= ttest2( mean(mean(FZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI,1),3),4), mean(mean(CTL.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI,1),3),4) );
|
|
|
P(P>=pvl)=NaN; P(P<pvl)=1; P(isnan(P))=0;
|
|
|
subplot(221); topoplot( mean(mean(squeeze(mean(FZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI),1 )),2),3) - mean(mean(squeeze(mean(CTL.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI),1 )),2),3),...
|
|
|
chanlocs,'maplimits',[-4 4],'electrodes','on','emarker2', {find(P),'d','k',5,1}); title('Theta; PDFOG+ - Controls'); clear P; colormap jet;
|
|
|
|
|
|
[~,P,~,~]= ttest2( mean(mean(FZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI,1),3),4), mean(mean(NFZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI,1),3),4) );
|
|
|
P(P>=pvl)=NaN; P(P<pvl)=1; P(isnan(P))=0;
|
|
|
subplot(222); topoplot( mean(mean(squeeze(mean(FZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI),1 )),2),3) - mean(mean(squeeze(mean(NFZ.POWER(:,:,fqidx1:fqidx2,tmidx1:tmidx2,CONDI),1 )),2),3),...
|
|
|
chanlocs,'maplimits',[-4 4],'electrodes','on','emarker2', {find(P),'d','k',5,1}); title('Theta; PDFOG+ - PDFOG-'); clear P; colormap jet;
|
|
|
|
|
|
[~,P,~,~]= ttest2( mean(mean(FZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI,1),3),4), mean(mean(CTL.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI,1),3),4) );
|
|
|
P(P>=pvl)=NaN; P(P<pvl)=1; P(isnan(P))=0;
|
|
|
subplot(223); topoplot( mean(mean(squeeze(mean(FZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI),1 )),2),3) - mean(mean(squeeze(mean(CTL.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI),1 )),2),3),...
|
|
|
chanlocs,'maplimits',[-1 1],'electrodes','on','emarker2', {find(P),'d','k',5,1}); title('Beta; PDFOG+ - Controls'); clear P; colormap jet;
|
|
|
|
|
|
[~,P,~,~]= ttest2( mean(mean(FZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI,1),3),4), mean(mean(NFZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI,1),3),4) );
|
|
|
P(P>=pvl)=NaN; P(P<pvl)=1; P(isnan(P))=0;
|
|
|
subplot(224); topoplot( mean(mean(squeeze(mean(FZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI),1 )),2),3) - mean(mean(squeeze(mean(NFZ.POWER(:,:,fqidx3:fqidx4,tmidx1:tmidx2,CONDI),1 )),2),3),...
|
|
|
chanlocs,'maplimits',[-1 1],'electrodes','on','emarker2', {find(P),'d','k',5,1}); title('Beta; PDFOG+ - PDFOG-'); clear P; colormap jet;
|
|
|
|
|
|
suptitle('Figure 3E and 3F : Topo plots (Theta and beta power; 0-400 ms time window)');
|
|
|
|
|
|
%% % Plot selcted band for boxplot with scatter plot to see each values
|
|
|
%%%% for pedaling ROIs
|
|
|
ThetabandBox1Ped = [powCTL_ped.Te(:,1); powNFZ_ped.Te(:,1); powFZ_ped.Te(:,1) ];
|
|
|
BetabandBox2Ped = [powCTL_ped.Be(:,1); powNFZ_ped.Be(:,1); powFZ_ped.Be(:,1) ];
|
|
|
|
|
|
%%%% group data
|
|
|
nCTL = length(powCTL_ped.Te(:,1));
|
|
|
nNFZ = length(powNFZ_ped.Te(:,1));
|
|
|
nFZ = length(powFZ_ped.Te(:,1));
|
|
|
|
|
|
for nn = 1:nCTL
|
|
|
bandMdVar1{nn,1} = sprintf('
|
|
|
bandMdVar1{nn,2} =1 ;
|
|
|
end
|
|
|
for nn = nCTL+1: nNFZ+ nNFZ
|
|
|
bandMdVar1{nn,1} = sprintf('%s', 'NFZ');
|
|
|
bandMdVar1{nn,2}=2;
|
|
|
end
|
|
|
|
|
|
for nn = nCTL+nNFZ+1:nCTL+nNFZ+nFZ
|
|
|
bandMdVar1{nn,1} = sprintf('%s', 'FZ');
|
|
|
bandMdVar1{nn,2}=3;
|
|
|
end
|
|
|
|
|
|
figure('rend','painters','pos',[10 10 800 900]);
|
|
|
|
|
|
|
|
|
ThetabandBox1GI = [powCTL_GI.Te(:,1); powNFZ_GI.Te(:,1); powFZ_GI.Te(:,1) ];
|
|
|
BetabandBox2GI = [powCTL_GI.Be(:,1); powNFZ_GI.Be(:,1); powFZ_GI.Be(:,1) ];
|
|
|
|
|
|
subplot(221);
|
|
|
boxplot(ThetabandBox1GI,bandMdVar1(:,1), 'OutlierSize',12); hold on;
|
|
|
gscatter( cell2mat(bandMdVar1(:,2)) , ThetabandBox1GI, bandMdVar1(:,1), 'kgr'); hold off; ylabel('POWER (dB)'); title('0-400 ms: Theta power'); ylim([-2 6]);
|
|
|
|
|
|
subplot(222);
|
|
|
boxplot(BetabandBox2GI,bandMdVar1(:,1), 'OutlierSize',12); hold on;
|
|
|
gscatter( cell2mat(bandMdVar1(:,2)) , BetabandBox2GI, bandMdVar1(:,1), 'kgr'); hold off; ylabel('POWER (dB)'); title('0-400 ms: Beta power');ylim([-6 3]);
|
|
|
|
|
|
|
|
|
subplot(223);
|
|
|
boxplot(ThetabandBox1Ped,bandMdVar1(:,1), 'OutlierSize',12); hold on;
|
|
|
gscatter( cell2mat(bandMdVar1(:,2)) , ThetabandBox1Ped, bandMdVar1(:,1), 'kgr'); hold off; ylabel('POWER (dB)'); title('0-2000 ms: Theta power'); ylim([-2 6]);
|
|
|
|
|
|
subplot(224);
|
|
|
boxplot(BetabandBox2Ped,bandMdVar1(:,1), 'OutlierSize',12); hold on;
|
|
|
gscatter( cell2mat(bandMdVar1(:,2)) , BetabandBox2Ped, bandMdVar1(:,1), 'kgr'); hold off; ylabel('POWER (dB)'); title('0-2000 ms: Beta power'); ylim([-6 3]);
|
|
|
|
|
|
suptitle('Figure 3C and 3D : Theta and Beta tf-ROI power');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
groupIDs = cell2mat(groupInfo(2:end,2:end) );
|
|
|
|
|
|
idx1 = find(groupIDs(:,1)==1); idx2 = find(groupIDs(:,1)==2); idx3 = find(groupIDs(:,1)==3);
|
|
|
CTLids = groupIDs(idx1,:);
|
|
|
NFZids = groupIDs(idx2,:);
|
|
|
FZids = groupIDs(idx3,:);
|
|
|
|
|
|
MOCA = groupIDs([idx2; idx3],3);
|
|
|
FOG = groupIDs([idx2; idx3],4);
|
|
|
UPDRS = groupIDs([idx2; idx3],5);
|
|
|
|
|
|
Clinical_Score = [MOCA FOG UPDRS];
|
|
|
|
|
|
corrType = 'Spearman';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thetadata = [powNFZ_GI.Te(:,1); powFZ_GI.Te(:,1) ];
|
|
|
Betadata = [powNFZ_GI.Be(:,1); powFZ_GI.Be(:,1) ];
|
|
|
|
|
|
POWER_BANDS = [Thetadata Betadata];
|
|
|
|
|
|
for var = 1:2
|
|
|
figure('rend','painters','pos',[10 10 400 900]);
|
|
|
|
|
|
subplot(311); SS = plot( FOG, POWER_BANDS(:,var), 'k+');hold on;
|
|
|
[R,P] = corr( FOG, POWER_BANDS(:,var),'type',corrType); set(SS, 'MarkerSize', 8, 'LineWidth', 2); l = lsline ; set(l,'LineWidth', 2); hold off;
|
|
|
xlabel('FOG Score', 'FontSize', 10); set(gca, 'FontSize', 10, 'YMinorTick','on','XMinorTick','on');
|
|
|
title(['\color{black} rho=' num2str(R,'%3.2f'),'; P=' num2str(P,'%3.3f')]); clear SS R P l; xlim([min(FOG)-1 max(FOG)+1]);
|
|
|
|
|
|
|
|
|
subplot(312); SS = plot( UPDRS, POWER_BANDS(:,var), 'k+');hold on;
|
|
|
[R,P] = corr( UPDRS, POWER_BANDS(:,var),'type',corrType); set(SS, 'MarkerSize', 8, 'LineWidth', 2); l = lsline ; set(l,'LineWidth', 2); hold off;
|
|
|
xlabel('UPDRS Score', 'FontSize', 10); set(gca, 'FontSize', 10, 'YMinorTick','on','XMinorTick','on');
|
|
|
title(['\color{black} rho=' num2str(R,'%3.2f'),'; P=' num2str(P,'%3.3f')]); clear SS R P l; xlim([min(UPDRS)-1 max(UPDRS)+1]);
|
|
|
|
|
|
|
|
|
subplot(313); SS = plot( MOCA, POWER_BANDS(:,var), 'k+');hold on;
|
|
|
[R,P] = corr( MOCA, POWER_BANDS(:,var),'type',corrType); set(SS, 'MarkerSize', 8, 'LineWidth', 2); l = lsline ; set(l,'LineWidth', 2); hold off;
|
|
|
xlabel('MOCA Score', 'FontSize', 10); set(gca, 'FontSize', 10, 'YMinorTick','on','XMinorTick','on');
|
|
|
title(['\color{black} rho=' num2str(R,'%3.2f'),'; P=' num2str(P,'%3.3f')]); clear SS R P l; xlim([min(MOCA)-1 max(MOCA)+1]);
|
|
|
|
|
|
if var ==1
|
|
|
suptitle('Figure 4A: Correlation against Theta band values')
|
|
|
elseif var ==2
|
|
|
suptitle('Figure 4B: Correlation against Beta band values')
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|