A cortico-subthalamic circuit rapidly engages and releases inhibition of specific movements depending on the environmental context.
The 5 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Materials and methods › Connectivity analyses ↔ Step2BetaCorrelations.m, lines 25–117 · score 0.71 · beta power, post SSRT, pre SSRT, correlated, Hilbert, zero
- [2] § Materials and methods › Connectivity analyses ↔ Step2BetaCorrelations.m, lines 216–342 · score 0.69 · beta power, SSRT locked, lagged, ROI, locations, correlated
- [3] § Materials and methods › Motoric independent component selection ↔ helper_functions/get_motor_ic.m, the whole file · a weak match · score 0.56 · pre response period, backprojected, beta burst, components, motor, stimulus
- [4] § Materials and methods › Time–frequency analyses ↔ helper_functions/convert_to_bursts.m, lines 15–92 · score 0.53 · imregional, median, burst rate, convolved, wavelet, cycles
- [5] § Materials and methods › Time–frequency analyses ↔ Step1STNLFP.m, lines 24–101 · score 0.53 · Full spectrum, 125 Hz, ERSP, Hilbert, transforming, event
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 · 547 lines · 26 KB · no license · 2 matches
- %% initialize (EEGLAB has to be on path)
- eeglab; clear; clc; close all;
- % files and folders;
- eeginfolder = '/data/backed_up/PERCEPT_SST/jan/MergedFiles'; % use CSD transformed EEG data
- eegfiles = dir(fullfile(eeginfolder,'*.set')); eegfiles = {eegfiles.name};
- % load essential info
- load('/data/backed_up/PERCEPT_SST/chanlocs.mat'); % chanlocs for this study workspace
- load('/data/backed_up/PERCEPT_SST/jan/FINAL/helper_functions/AGF_cmap.mat'); % colormap that has whites for zero
- load('/data/backed_up/PERCEPT_SST/SSssrt.mat'); % behavior for selective stopping
- load('/data/backed_up/PERCEPT_SST/GSssrt.mat'); % behavior for non-selective stopping
- % global settings
- epochlength = [-.5 1.5]; % in secs
- baseline = [-100 0]; % in ms
- srate = 500; % in hz
- frequencies = 13:30; % in hz
- % settings
- preSSRTwindow = 25; % in sample points before SSRT
- postSSRTwindow = 50; % in sample points after SSRT
- presteps = fliplr(0:25:100); % in samples before SSRT
- poststeps = 0:25:250; % in samples after SSRT
- %% Which scalp locations correlate with preSSRT beta / postSSRT beta
- % preassign: global stop
- LPREwind = nan(length(eegfiles),length(chanlocs),length(presteps)-1);
- RPREwind = nan(length(eegfiles),length(chanlocs),length(presteps)-1);
- LPOSTwind = nan(length(eegfiles),length(chanlocs),length(poststeps)-1);
- RPOSTwind = nan(length(eegfiles),length(chanlocs),length(poststeps)-1);
- % go through files
- for is = 1:length(eegfiles)
- % load
- EEG = pop_loadset(fullfile(eeginfolder,eegfiles{is}));
- % find STN channels indices
- leftstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'LEFT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- rightstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'RIGHT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- % Beta power conversion
- for ic = 1:EEG.nbchan
- EEG.data(ic,:) = abs(hilbert(eegfilt(double(EEG.data(ic,:)),srate,frequencies(1),frequencies(end),0,[],0,'fir1')'))'.^2;
- end
- % events
- events = EEG.event; % get all events
- % get events
- ssrt_signal = events(strcmpi({events.type},'STOP_Global_SSRT')); % find ssrt locked stop trials
- ssrt_signal = ssrt_signal(strcmpi({ssrt_signal.ACC},'SS')); % successful only
- stgEEG = pop_epoch(EEG,'STOP_Global_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([stgEEG.event.nr]),[ssrt_signal.nr]); % retain trials that weren't removed based on EEG
- stgEEG = pop_select(stgEEG,'trial',[stgEEG.event(keep).epoch]); % keep only those trials
- ssrt_signal = ssrt_signal(keep2); % keep only those trials
- % get events
- ignore_signal = events(strcmpi({events.type},'IGNORE_Global_SSRT')); % find ssrt matched ignore trials
- ignore_signal = ignore_signal(strcmpi({ignore_signal.ACC},'CORRECT')); % correct only
- ignEEG = pop_epoch(EEG,'IGNORE_Global_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([ignEEG.event.nr]),[ignore_signal.nr]); % retain trials that weren't removed based on EEG
- ignEEG = pop_select(ignEEG,'trial',[ignEEG.event(keep).epoch]); % keep only those trials
- ignore_signal = ignore_signal(keep2); % keep only those trials
- % get events
- select_signal = events(strcmpi({events.type},'STOP_Select_SSRT')); % find ssrt matched select stop trials
- select_signal = select_signal(strcmpi({select_signal.ACC},'SS')); % successful only
- stsEEG = pop_epoch(EEG,'STOP_Select_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([stsEEG.event.nr]),[select_signal.nr]); % retain trials that weren't removed based on EEG
- stsEEG = pop_select(stsEEG,'trial',[stsEEG.event(keep).epoch]); % keep only those trials
- select_signal = select_signal(keep2); % keep only those trials
- % merge
- allEEG = pop_mergeset(stsEEG,ignEEG); % merge select stop and ignore
- allEEG = pop_mergeset(allEEG,stgEEG); % merge global stop with that
- % get pre and post SSRT STN signal
- preSSRTleft = nan(allEEG.trials,1); % preassign
- postSSRTleft = nan(allEEG.trials,1);
- preSSRTright = preSSRTleft;
- postSSRTright = postSSRTleft;
- % go through trials of merged dataset
- for ie = 1:allEEG.trials
- % find zero sample in epoch
- evlat = find(allEEG.times==0);
- % mean STN data right before SSRT
- preSSRTleft(ie,1) = mean(allEEG.data(leftstn,evlat-preSSRTwindow:evlat,ie));
- preSSRTright(ie,1) = mean(allEEG.data(rightstn,evlat-preSSRTwindow:evlat,ie));
- % mean STN data right after SSRT
- postSSRTleft(ie,1) = mean(allEEG.data(leftstn,evlat:evlat+postSSRTwindow,ie));
- postSSRTright(ie,1) = mean(allEEG.data(rightstn,evlat:evlat+postSSRTwindow,ie));
- end
- % go through EEG channels and correlate with that STN signal
- for ic = 1:allEEG.nbchan-2
- % get channel data
- cdata = squeeze(allEEG.data(ic,:,:))';
- % go through timewindows before SSRT, get mean channel data in those windows, zscore, and correlate with STN
- for iw = 1:length(presteps)-1
- LPREwind(is,ic,iw) = regress(zscore(mean(cdata(:,evlat-presteps(iw):evlat-presteps(iw+1)),2)),zscore(preSSRTleft));
- RPREwind(is,ic,iw) = regress(zscore(mean(cdata(:,evlat-presteps(iw):evlat-presteps(iw+1)),2)),zscore(preSSRTright));
- end
- % go through timewindows after SSRT, get mean channel data in those windows, zscore, and correlate with STN
- for iw = 1:length(poststeps)-1
- LPOSTwind(is,ic,iw) = regress(zscore(mean(cdata(:,evlat+poststeps(iw):evlat+poststeps(iw+1)),2)),zscore(postSSRTleft));
- RPOSTwind(is,ic,iw) = regress(zscore(mean(cdata(:,evlat+poststeps(iw):evlat+poststeps(iw+1)),2)),zscore(postSSRTright));
- end
- end
- end
- % save
- save(fullfile('/data/backed_up/PERCEPT_SST/WindowedBetaCorrelations.mat'),'LPREwind','RPREwind','LPOSTwind','RPOSTwind');
- %% Plot whole-scalp windowed beta band correlation
- clc; close all;
- % load
- load(fullfile('/data/backed_up/PERCEPT_SST/WindowedBetaCorrelations.mat'));
- % alpha level correct for number of windows
- preSSRT_alpha = .05 / (size(RPREwind,3) + size(LPREwind,3));
- postSSRT_alpha = .05 / (size(LPOSTwind,3) + size(RPOSTwind,3));
- % fisher's z transform
- LPREwind = atanh(LPREwind);
- RPREwind = atanh(RPREwind);
- LPOSTwind = atanh(LPOSTwind);
- RPOSTwind = atanh(RPOSTwind);
- % stats
- [~,p] = ttest(LPREwind); pLpre = squeeze(p);
- [~,p] = ttest(RPREwind); pRpre = squeeze(p);
- [~,p] = ttest(LPOSTwind); pLpost = squeeze(p);
- [~,p] = ttest(RPOSTwind); pRpost = squeeze(p);
- % open figure: preSSRT
- h = figure('Position',[1 1 1400 860],'color','w'); CLIMS = [0 0];
- % go through time windows
- for ip = 1:size(pLpre,2)
- % make subplot: left STN
- subplot(2,size(pLpre,2),ip);
- data = squeeze(mean(LPREwind(:,:,ip),1)); % get window data
- data(pLpre(:,ip)>preSSRT_alpha) = 0; % mask with significance
- topoplot(data,chanlocs,'electrodes','off','style','map','shading','interp'); % make topooplot
- % topoplot(data,chanlocs,'electrodes','off'); % make topooplot
- %topoplot_jjf(data, chanlocs,'style','map','electrodes','on','nosedir','+X','emarker2',{find(pLpre(:,ip)<preSSRT_alpha),'o','k',7,1}); % 'electrodes','ptslabels', 'plotrad',.7
- clims = get(gca,'clim'); if max(abs(clims)) > max(abs(CLIMS)); CLIMS = clims; end % scale clims to max on the fly
- title(['L STN:' num2str(presteps(ip)*1000/srate) '-' num2str(presteps(ip+1)*1000/srate) 'ms']); % plot title
- % make subplot: right STN
- subplot(2,size(pRpre,2),size(pRpre,2)+ip);
- data = squeeze(mean(RPREwind(:,:,ip),1)); % get window data
- data(pRpre(:,ip)>preSSRT_alpha) = 0; % mask with significance
- topoplot(data,chanlocs,'electrodes','off','style','map','shading','interp'); % make topooplot
- % topoplot(data,chanlocs,'electrodes','off'); % make topooplot
- %topoplot_jjf(data, chanlocs,'style','map','electrodes','on','nosedir','+X','emarker2',{find(pRpre(:,ip)<preSSRT_alpha),'o','k',7,1}); % 'electrodes','ptslabels', 'plotrad',.7
- clims = get(gca,'clim'); if max(abs(clims)) > max(abs(CLIMS)); CLIMS = clims; end % scale clims to max on the fly
- title(['R STN:' num2str(presteps(ip)*1000/srate) '-' num2str(presteps(ip+1)*1000/srate) 'ms']); % plot title
- end
- % format
- for ip = 1:size(pRpre,2)
- colormap(AGF_cmap); % colormap
- set(gca,'clim',[-max(CLIMS) max(CLIMS)]); % color limits
- end
- % overlay a new axis to make overall figure title
- a = axes; t1 = title('Correlation STN and Cortex relative to SSRT');
- a.Visible = 'off'; t1.Visible = 'on'; set(gcf,'color','w')
- % open figure: postSSRT
- h = figure('Position',[1 1 1900 860],'color','w'); CLIMS = [0 0];
- % go through time windows
- for ip = 1:size(pLpost,2)
- % make subplot: left STN
- subplot(2,size(pLpost,2),ip);
- data = squeeze(mean(LPOSTwind(:,:,ip),1)); % get window data
- data(pLpost(:,ip)>postSSRT_alpha) = 0; % mask with significance
- topoplot(data,chanlocs,'electrodes','off','style','map'); % make topooplot
- % topoplot(data,chanlocs,'electrodes','off'); % make topooplot
- clims = get(gca,'clim'); if max(abs(clims)) > max(abs(CLIMS)); CLIMS = clims; end % scale clims to max on the fly
- title(['L STN:' num2str(poststeps(ip)*1000/srate) '-' num2str(poststeps(ip+1)*1000/srate) 'ms']);
- % make subplot: right STN
- subplot(2,size(pRpost,2),size(pRpost,2)+ip);
- data = squeeze(mean(RPOSTwind(:,:,ip),1)); % get window data
- data(pRpost(:,ip)>postSSRT_alpha) = 0; % mask with significance
- topoplot(data,chanlocs,'electrodes','off','style','map','shading','interp'); % make topooplot
- % topoplot(data,chanlocs,'electrodes','off'); % make topooplot
- clims = get(gca,'clim'); if max(abs(clims)) > max(abs(CLIMS)); CLIMS = clims; end % scale clims to max on the fly
- title(['R STN:' num2str(poststeps(ip)*1000/srate) '-' num2str(poststeps(ip+1)*1000/srate) 'ms']);
- end
- % format
- for ip = 1:size(pRpre,2)
- colormap(AGF_cmap);
- set(gca,'clim',[-max(CLIMS) max(CLIMS)]);
- end
- % overlay a new axis to make overall figure title
- a = axes; t1 = title('Correlation STN and Cortex relative to SSRT');
- a.Visible = 'off'; t1.Visible = 'on'; set(gcf,'color','w');
- % exportgraphics(figure(1), fullfile('/data/backed_up/PERCEPT_SST/CS_perceptSST/Figs/', ...
- % 'Fig5_topo1.eps'), 'ContentType', 'vector');
- % exportgraphics(figure(2), fullfile('/data/backed_up/PERCEPT_SST/CS_perceptSST/Figs/', ...
- % 'Fig5_topo2.eps'), 'ContentType', 'vector');
- %% ROI based time-lagged correlations
- CCroi = {'FC1','FC2','FCz','C1','C2','Cz','CP1','CP2','Cpz'};
- FCroi = {'F1','F2','Fz','Fp1','Fp2','Fpz','AF3','AF4'};
- PCroi = {'P1','P2','PO3','PO4','POz','O1','O2','Oz'};
- CLroi = {'FT7','FC5','FC3','TP7','CP5','CP3','T7','C5','C3'};
- CRroi = {'FT8','FC6','FC4','TP8','CP6','CP4','T8','C6','C4'};
- FLroi = {'AF7','F7','F3','F5'};
- FRroi = {'AF8','F8','F4','F6'};
- PLroi = {'P5','P7','PO7'};
- PRroi = {'P6','P8','PO8'};
- % preassign
- LCC = nan(length(eegfiles),diff(epochlength)*srate,diff(epochlength)*srate);
- LFC = LCC; LPC = LCC; LCL = LCC; LCR = LCC; LFL = LCC; LFR = LCC; LPL = LCC; LPR = LCC;
- RCC = nan(length(eegfiles),diff(epochlength)*srate,diff(epochlength)*srate);
- RFC = LCC; RPC = LCC; RCL = LCC; RCR = LCC; RFL = LCC; RFR = LCC; RPL = LCC; RPR = LCC;
- % go through files
- for is = 1:length(eegfiles)
- % load
- EEG = pop_loadset(fullfile(eeginfolder,eegfiles{is}));
- oEEG = EEG; % make a copy so you can replace channels with ROIs
- % find STN channels indices
- leftstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'LEFT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- rightstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'RIGHT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- % get labels
- leftstn = chanlocs(leftstn).labels;
- rightstn = chanlocs(rightstn).labels;
- % Make new datasets with ROI channels only. Then get average of activity and channel locations, and replace the original EEG data
- CC = pop_select(oEEG,'channel',CCroi); EEG.data(1,:) = mean(CC.data,1); chanlocs(1).labels = 'CC';
- FC = pop_select(oEEG,'channel',FCroi); EEG.data(2,:) = mean(FC.data,1); chanlocs(2).labels = 'FC';
- PC = pop_select(oEEG,'channel',PCroi); EEG.data(3,:) = mean(PC.data,1); chanlocs(3).labels = 'PC';
- CL = pop_select(oEEG,'channel',CLroi); EEG.data(4,:) = mean(CL.data,1); chanlocs(4).labels = 'CL';
- CR = pop_select(oEEG,'channel',CRroi); EEG.data(5,:) = mean(CR.data,1); chanlocs(5).labels = 'CR';
- FL = pop_select(oEEG,'channel',FLroi); EEG.data(6,:) = mean(FL.data,1); chanlocs(6).labels = 'FL';
- FR = pop_select(oEEG,'channel',FRroi); EEG.data(7,:) = mean(FR.data,1); chanlocs(7).labels = 'FR';
- PL = pop_select(oEEG,'channel',PLroi); EEG.data(8,:) = mean(PL.data,1); chanlocs(8).labels = 'PL';
- PR = pop_select(oEEG,'channel',PRroi); EEG.data(9,:) = mean(PR.data,1); chanlocs(9).labels = 'PR';
- % remove all but ROI data and LFP channels
- EEG = pop_select(EEG,'channel',{'CC','FC','PC','CL','CR','FL','FR','PL','PR',leftstn,rightstn});
- % check eeg integrity
- EEG = eeg_checkset(EEG);
- % delete superfluous
- clear oEEG
- % Beta power conversion
- for ic = 1:EEG.nbchan
- EEG.data(ic,:) = abs(hilbert(eegfilt(double(EEG.data(ic,:)),srate,frequencies(1),frequencies(end),0,[],0,'fir1')'))'.^2;
- end
- % find stn channel indices in new file
- leftstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'LEFT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- rightstn = find(~cellfun(@isempty,strfind({chanlocs.labels},'RIGHT')) & cellfun(@isempty,strfind({chanlocs.labels},'EMG')));
- events = EEG.event;
- % get events
- ssrt_signal = events(strcmpi({events.type},'STOP_Global_SSRT')); % find ssrt locked stop trials
- ssrt_signal = ssrt_signal(strcmpi({ssrt_signal.ACC},'SS')); % successful only
- stgEEG = pop_epoch(EEG,'STOP_Global_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([stgEEG.event.nr]),[ssrt_signal.nr]); % retain trials that weren't removed based on EEG
- stgEEG = pop_select(stgEEG,'trial',[stgEEG.event(keep).epoch]); % keep only those trials
- ssrt_signal = ssrt_signal(keep2); % keep only those trials
- % get events
- ignore_signal = events(strcmpi({events.type},'IGNORE_Global_SSRT')); % find ssrt matched ignore trials
- ignore_signal = ignore_signal(strcmpi({ignore_signal.ACC},'CORRECT')); % correct only
- ignEEG = pop_epoch(EEG,'IGNORE_Global_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([ignEEG.event.nr]),[ignore_signal.nr]); % retain trials that weren't removed based on EEG
- ignEEG = pop_select(ignEEG,'trial',[ignEEG.event(keep).epoch]); % keep only those trials
- ignore_signal = ignore_signal(keep2); % keep only those trials
- % get events
- select_signal = events(strcmpi({events.type},'STOP_Select_SSRT')); % find ssrt matched select stop trials
- select_signal = select_signal(strcmpi({select_signal.ACC},'SS')); % successful only
- stsEEG = pop_epoch(EEG,'STOP_Select_SSRT',epochlength); % epoch
- [~,keep,keep2] = intersect(([stsEEG.event.nr]),[select_signal.nr]); % retain trials that weren't removed based on EEG
- stsEEG = pop_select(stsEEG,'trial',[stsEEG.event(keep).epoch]); % keep only those trials
- select_signal = select_signal(keep2); % keep only those trials
- % merge
- allEEG = pop_mergeset(stsEEG,ignEEG); % merge select stop and ignore
- allEEG = pop_mergeset(allEEG,stgEEG); % merge global stop with that
- % go through lag samples and correlate
- for it1 = 1:allEEG.pnts
- for it2 = 1:allEEG.pnts
- % get ROI EEG data and zscore
- dataCC = zscore(squeeze(allEEG.data(1,it1,:)));
- dataFC = zscore(squeeze(allEEG.data(2,it1,:)));
- dataPC = zscore(squeeze(allEEG.data(3,it1,:)));
- dataCL = zscore(squeeze(allEEG.data(4,it1,:)));
- dataCR = zscore(squeeze(allEEG.data(5,it1,:)));
- dataFL = zscore(squeeze(allEEG.data(6,it1,:)));
- dataFR = zscore(squeeze(allEEG.data(7,it1,:)));
- dataPL = zscore(squeeze(allEEG.data(8,it1,:)));
- dataPR = zscore(squeeze(allEEG.data(9,it1,:)));
- % get LFP data and zscore
- dataR = zscore(squeeze(allEEG.data(rightstn,it2,:)));
- dataL = zscore(squeeze(allEEG.data(leftstn,it2,:)));
- % store. EEG data along first dim, LFP data along second dim
- LCC(is,it1,it2) = corr(dataCC,dataL);
- LFC(is,it1,it2) = corr(dataFC,dataL);
- LPC(is,it1,it2) = corr(dataPC,dataL);
- LCL(is,it1,it2) = corr(dataCL,dataL);
- LCR(is,it1,it2) = corr(dataCR,dataL);
- LFL(is,it1,it2) = corr(dataFL,dataL);
- LFR(is,it1,it2) = corr(dataFR,dataL);
- LPL(is,it1,it2) = corr(dataPL,dataL);
- LPR(is,it1,it2) = corr(dataPR,dataL);
- RCC(is,it1,it2) = corr(dataCC,dataR);
- RFC(is,it1,it2) = corr(dataFC,dataR);
- RPC(is,it1,it2) = corr(dataPC,dataR);
- RCL(is,it1,it2) = corr(dataCL,dataR);
- RCR(is,it1,it2) = corr(dataCR,dataR);
- RFL(is,it1,it2) = corr(dataFL,dataR);
- RFR(is,it1,it2) = corr(dataFR,dataR);
- RPL(is,it1,it2) = corr(dataPL,dataR);
- RPR(is,it1,it2) = corr(dataPR,dataR);
- end
- end
- end
- save('/data/backed_up/PERCEPT_SST/ROIcorrelations.mat','L*','R*');
- %% Cluster-corrected statistics
- clear p;
- load('/data/backed_up/PERCEPT_SST/ROIcorrelations.mat');
- % settings
- pixel_p = .05/18; % pixel wise alpha, corrected for number of ROIs
- cluster_p = .05/18; % cluster wise alpha, corrected for number of ROIs
- nPerm = 5000; % number of permutations
- % fisher's z
- LCC = atanh(LCC); LFC = atanh(LFC); LPC = atanh(LPC);
- LCL = atanh(LCL); LFL = atanh(LFL); LPL = atanh(LPL);
- LCR = atanh(LCR); LFR = atanh(LFR); LPR = atanh(LPR);
- RCC = atanh(RCC); RFC = atanh(RFC); RPC = atanh(RPC);
- RCL = atanh(RCL); RFL = atanh(RFL); RPL = atanh(RPL);
- RCR = atanh(RCR); RFR = atanh(RFR); RPR = atanh(RPR);
- % run
- p.LCC = cPERM2(LCC, zeros(size(LCC)), nPerm, pixel_p, cluster_p);
- p.LFC = cPERM2(LFC, zeros(size(LFC)), nPerm, pixel_p, cluster_p);
- p.LPC = cPERM2(LPC, zeros(size(LPC)), nPerm, pixel_p, cluster_p);
- p.LCL = cPERM2(LCL, zeros(size(LCL)), nPerm, pixel_p, cluster_p);
- p.LCR = cPERM2(LCR, zeros(size(LCR)), nPerm, pixel_p, cluster_p);
- p.LFL = cPERM2(LFL, zeros(size(LFL)), nPerm, pixel_p, cluster_p);
- p.LFR = cPERM2(LFR, zeros(size(LFR)), nPerm, pixel_p, cluster_p);
- p.LPL = cPERM2(LPL, zeros(size(LPL)), nPerm, pixel_p, cluster_p);
- p.LPR = cPERM2(LPR, zeros(size(LPR)), nPerm, pixel_p, cluster_p);
- p.RCC = cPERM2(RCC, zeros(size(RCC)), nPerm, pixel_p, cluster_p);
- p.RFC = cPERM2(RFC, zeros(size(RFC)), nPerm, pixel_p, cluster_p);
- p.RPC = cPERM2(RPC, zeros(size(RPC)), nPerm, pixel_p, cluster_p);
- p.RCL = cPERM2(RCL, zeros(size(RCL)), nPerm, pixel_p, cluster_p);
- p.RCR = cPERM2(RCR, zeros(size(RCR)), nPerm, pixel_p, cluster_p);
- p.RFL = cPERM2(RFL, zeros(size(RFL)), nPerm, pixel_p, cluster_p);
- p.RFR = cPERM2(RFR, zeros(size(RFR)), nPerm, pixel_p, cluster_p);
- p.RPL = cPERM2(RPL, zeros(size(RPL)), nPerm, pixel_p, cluster_p);
- p.RPR = cPERM2(RPR, zeros(size(RPR)), nPerm, pixel_p, cluster_p);
- save('/data/backed_up/PERCEPT_SST/ROIcorrelationsP.mat','p');
- %% figure of ROI corrs
- close all;
- % settings
- ssrt = mean([GSssrt.SSRT_integ]); % get sample mean SSRT
- lw = 1.5; % line width for significance plot
- % load
- load(fullfile('/data/backed_up/PERCEPT_SST/ROIcorrelations.mat'));
- load(fullfile('/data/backed_up/PERCEPT_SST/ROIcorrelationsP.mat'));
- % fisher's z
- LCC = atanh(LCC); LFC = atanh(LFC); LPC = atanh(LPC);
- LCL = atanh(LCL); LFL = atanh(LFL); LPL = atanh(LPL);
- LCR = atanh(LCR); LFR = atanh(LFR); LPR = atanh(LPR);
- RCC = atanh(RCC); RFC = atanh(RFC); RPC = atanh(RPC);
- RCL = atanh(RCL); RFL = atanh(RFL); RPL = atanh(RPL);
- RCR = atanh(RCR); RFR = atanh(RFR); RPR = atanh(RPR);
- % Left figure first
- ROIs = {'LFL','LFC','LFR','LCL','LCC','LCR','LPL','LPC','LPR'}; % define ROIs
- h = figure('Position',[1 1 1000 1000],'Color','w'); % open figure
- clims = nan(length(ROIs),2); % preassing clim matrix
- % go through ROIs and plot
- for ir = 1:length(ROIs)
- % open subplot
- subplot(3,3,ir);
- % get data
- data = eval(['squeeze(mean(' ROIs{ir} ',1));']); % data
- eval(['px = p.' ROIs{ir} ';']); % pvalue
- % plot data
- contourf(1:1000,1:1000,data,60,'linecolor','none'); hold; % plot data
- % pcolor(data); hold; % plot data
- contour(px,[-.5 .5],'k','LineWidth',lw); % plot significance contour
- clims(ir,:) = get(gca,'clim'); % store clims
- title(ROIs{ir}); % put ROI in title
- %format
- % shading interp; % shading
- colormap(AGF_cmap); % colormap
- xlabel('STN: time (ms)'); % x label
- ylabel('EEG: time (ms)'); % y label
- % ticks
- set(gca,'XTick',[1 abs(epochlength(1))*srate+ssrt*srate/1000 diff(epochlength)*srate],'Xticklabel',{'S','SSRT',num2str(epochlength(2)*1000)});
- set(gca,'YTick',[1 abs(epochlength(1))*srate+ssrt*srate/1000 diff(epochlength)*srate],'Yticklabel',{'S','SSRT',num2str(epochlength(2)*1000)});
- % lines
- line([abs(epochlength(1))*srate+ssrt*srate/1000 abs(epochlength(1))*srate+ssrt*srate/1000],[1 diff(epochlength)*srate],'Color','k','LineWidth',.5,'LineStyle',':');
- line([1 diff(epochlength)*srate],[abs(epochlength(1))*srate+ssrt*srate/1000 abs(epochlength(1))*srate+ssrt*srate/1000],'Color','k','LineWidth',.5,'LineStyle',':');
- line([1 diff(epochlength)*srate],[1 diff(epochlength)*srate],'Color','k','LineWidth',.5,'LineStyle','-');
- % limits
- set(gca,'Xlim',[abs(epochlength(1))*srate diff(epochlength)*srate]);
- set(gca,'Ylim',[abs(epochlength(1))*srate diff(epochlength)*srate]);
- end
- % go through again and set climits to common max
- for ir = 1:length(ROIs)
- subplot(3,3,ir);
- set(gca,'Clim',[-max(max(abs(clims))) max(max(abs(clims)))]);
- end
- % Right figure second
- ROIs = {'RFL','RFC','RFR','RCL','RCC','RCR','RPL','RPC','RPR'}; % define ROIs
- h = figure('Position',[1 1 1000 1000],'Color','w'); % open figure
- clims = nan(length(ROIs),2); % preassing clim matrix
- % go through ROIs and plot
- for ir = 1:length(ROIs)
- % open subplot
- subplot(3,3,ir);
- % get data
- data = eval(['squeeze(mean(' ROIs{ir} ',1));']); % data
- eval(['px = p.' ROIs{ir} ';']); % pvalue
- % plot data
- contourf(1:1000,1:1000,data,60,'linecolor','none'); hold; % plot data
- % pcolor(data); hold; % plot data
- contour(px,[-.5 .5],'k','LineWidth',lw); % plot significance contour
- clims(ir,:) = get(gca,'clim'); % store clims
- title(ROIs{ir}); % put ROI in title
- %format
- % shading interp; % shading
- colormap(AGF_cmap); % colormap
- xlabel('STN: time (ms)'); % x label
- ylabel('EEG: time (ms)'); % y label
- % ticks
- set(gca,'XTick',[1 abs(epochlength(1))*srate+ssrt*srate/1000 diff(epochlength)*srate],'Xticklabel',{'S','SSRT',num2str(epochlength(2)*1000)});
- set(gca,'YTick',[1 abs(epochlength(1))*srate+ssrt*srate/1000 diff(epochlength)*srate],'Yticklabel',{'S','SSRT',num2str(epochlength(2)*1000)});
- % lines
- line([abs(epochlength(1))*srate+ssrt*srate/1000 abs(epochlength(1))*srate+ssrt*srate/1000],[1 diff(epochlength)*srate],'Color','k','LineWidth',.5,'LineStyle',':');
- line([1 diff(epochlength)*srate],[abs(epochlength(1))*srate+ssrt*srate/1000 abs(epochlength(1))*srate+ssrt*srate/1000],'Color','k','LineWidth',.5,'LineStyle',':');
- line([1 diff(epochlength)*srate],[1 diff(epochlength)*srate],'Color','k','LineWidth',.5,'LineStyle','-');
- % limits
- set(gca,'Xlim',[abs(epochlength(1))*srate diff(epochlength)*srate]);
- set(gca,'Ylim',[abs(epochlength(1))*srate diff(epochlength)*srate]);
- end
- % go through again and set climits to common max
- for ir = 1:length(ROIs)
- subplot(3,3,ir);
- set(gca,'Clim',[-max(max(abs(clims))) max(max(abs(clims)))]);
- end
- % exportgraphics(figure(1), fullfile('/data/backed_up/PERCEPT_SST/CS_perceptSST/Figs/', ...
- % 'Fig5_PLV1.eps'), 'ContentType', 'vector');
- %
- % exportgraphics(figure(2), fullfile('/data/backed_up/PERCEPT_SST/CS_perceptSST/Figs/', ...
- % 'Fig5_PLV2.eps'), 'ContentType', 'vector');
- %% TOPO plot with channels no data (CS added)
- % EEG = pop_loadset(fullfile(eeginfolder,eegfiles{1}));
- CCroi = {'FC1','FC2','FCz','C1','C2','Cz','CP1','CP2','Cpz'};
- FCroi = {'F1','F2','Fz','Fp1','Fp2','Fpz','AF3','AF4'};
- PCroi = {'P1','P2','PO3','PO4','POz','O1','O2','Oz'};
- CLroi = {'FT7','FC5','FC3','TP7','CP5','CP3','T7','C5','C3'};
- CRroi = {'FT8','FC6','FC4','TP8','CP6','CP4','T8','C6','C4'};
- FLroi = {'AF7','F7','F3','F5'};
- FRroi = {'AF8','F8','F4','F6'};
- PLroi = {'P5','P7','PO7'};
- PRroi = {'P6','P8','PO8'};
- dsize = 100;
- figure('Position',[1 1 1000 800]);
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},FCroi)),...
- 'emarker',{'.',[1 0 0],dsize,1}); axis square; hold on;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},FLroi)),...
- 'emarker',{'.',[1 .5 0],dsize,1}); axis square;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},FRroi)),...
- 'emarker',{'.',[1 0 .5 ],dsize,1}); axis square;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},CCroi)),...
- 'emarker',{'.',[0 1 0],dsize,1}); axis square;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},CLroi)),...
- 'emarker',{'.',[1 1 0],dsize,1}); axis square;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},CRroi)),...
- 'emarker',{'.',[0 1 1],dsize,1}); axis square;
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},PCroi)),...
- 'emarker',{'.',[0 0 1],dsize,1});
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},PLroi)),...
- 'emarker',{'.',[0 .5 1],dsize,1});
- topoplot(zeros(EEG.nbchan,1), EEG.chanlocs,'electrodes','on', ...
- 'plotchans',find(matches({EEG.chanlocs.labels},PRroi)),...
- 'emarker',{'.',[.5 0 1],dsize,1});
- print(fullfile('/data/backed_up/PERCEPT_SST/CS_perceptSST/Figs/','Fig5_emptyTOPO.eps'), ...
- '-depsc2','-r300','-painters');
Step2BetaCorrelations.m, no license · at the source
Overview
- Department of Psychological and Brain Sciences, University of Iowa, Iowa City, Iowa, United States of America
- Department of Neurology, University of Iowa Hospitals and Clinics, Iowa City, Iowa, United States of America
- Cognitive Control Collaborative, University of Iowa, Iowa City, Iowa, United States of America
- University of Grenoble, Grenoble, France
- Neurology Service, Iowa City VA Medical Center, Iowa City, Iowa, United States of America
- Department of Neurosurgery, University of Iowa Hospitals and Clinics, Iowa City, Iowa, United States of America
Abstract
Response inhibition is an important cognitive control mechanism that enables flexible behavior by stopping inappropriate actions. Intracranial recordings across species have identified a neural circuit that implements response inhibition via the subthalamic nucleus of the basal ganglia. However, this work has been limited to simple tasks, in which unequivocal, salient “stop”-signals require the inhibition of all ongoing responses. Notably, response inhibition in the real world is substantially different. Real-world response inhibition is selective: it occurs only after specific salient signals (‘stimulus-selectivity’)
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.
OSF bjd9n
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
14 files
- Step0MergeFiles.m, MATLAB, 166 lines
- Step1STNLFP.m, MATLAB, 536 lines, 1 match
- Step2BetaCorrelations.m, MATLAB, 547 lines, 2 matches
- Step3STNlateralization.m
, MATLAB, 591 lines - helper_functions/
Detect_and_visualize_mot , MATLAB, 296 linesorIC.m - helper_functions/
barplot.m , MATLAB, 94 lines - helper_functions/
cPERM2.m , MATLAB, 147 lines - helper_functions/
convert_to_bursts.m , MATLAB, 92 lines, 1 match - helper_functions/
erpplot.m , MATLAB, 88 lines - helper_functions/
ersp.m , MATLAB, 227 lines - helper_functions/
erspxaxis.m , MATLAB, 9 lines - helper_functions/
get_motor_ic.m , MATLAB, 91 lines, 1 match - helper_functions/
mc_ttest_cluster.m , MATLAB, 158 lines - helper_functions/
topo_segments_CS.m , MATLAB, 56 lines
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:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 14 scripts, each with its path and the digest of its content;
- 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability
All data and analysis code files are available from the OSF at https://
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 8 MeSH terms, 3 funders, 82 references.
Cite
This paper
Soh, C., Hervault, M., Chalkley, N. H., Huynh, K., Zhang, Q., Uc, E. Y., Greenlee, J. D. W., & Wessel, J. R. (2026). A cortico-subthalamic circuit rapidly engages and releases inhibition of specific movements depending on the environmental context. PLoS biology, 24(4), e3003635. https://
BibTeX
@article{soh2026cortico,
author = {Soh, Cheol and Hervault, Mario and Chalkley, Nathan H. and Huynh, Kien and Zhang, Qiang and Uc, Ergun Y. and Greenlee, Jeremy D. W. and Wessel, Jan R.},
title = {{A cortico-subthalamic circuit rapidly engages and releases inhibition of specific movements depending on the environmental context}},
journal = {PLoS biology},
year = {2026},
month = apr,
volume = {24},
number = {4},
pages = {e3003635},
publisher = {PLOS},
issn = {1544-9173},
doi = {10.1371/
url = {https://
pmid = {42030369},
pmcid = {PMC13132434}
}
RIS
TY - JOUR
AU - Soh, Cheol
AU - Hervault, Mario
AU - Chalkley, Nathan H.
AU - Huynh, Kien
AU - Zhang, Qiang
AU - Uc, Ergun Y.
AU - Greenlee, Jeremy D. W.
AU - Wessel, Jan R.
TI - A cortico-subthalamic circuit rapidly engages and releases inhibition of specific movements depending on the environmental context
T2 - PLoS biology
J2 - PLoS Biol
PY - 2026
DA - 2026/
VL - 24
IS - 4
SP - e3003635
SN - 1544-9173
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "A cortico-subthalamic circuit rapidly engages and releases inhibition of specific movements depending on the environmental context",
"container-title": "PLoS biology",
"author": [
{
"family": "Soh",
"given": "Cheol"
},
{
"family": "Hervault",
"given": "Mario"
},
{
"family": "Chalkley",
"given": "Nathan H."
},
{
"family": "Huynh",
"given": "Kien"
},
{
"family": "Zhang",
"given": "Qiang"
},
{
"family": "Uc",
"given": "Ergun Y."
},
{
"family": "Greenlee",
"given": "Jeremy D. W."
},
{
"family": "Wessel",
"given": "Jan R."
}
],
"container-title-short":
"volume": "24",
"issue": "4",
"page": "e3003635",
"DOI": "10.1371/
"PMID": "42030369",
"PMCID": "PMC13132434",
"ISSN": "1544-9173",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
24
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.isci.2026.116034
- Distinct temporal patterns of beta bursts differentiate successful and failed movement cancellation.Journal: iScienceIn common: 24 references
- [2] doi:10.1111/psyp.70397 [code]
- Cortical Contributions to Attentional Orienting and Response Cancellation in Action Stopping.Journal: PsychophysiologyIn common: 14 references
- [3] doi:10.1038/s41467-026-71502-z [code]
- Neurons of the human subthalamic nucleus engage with local delta frequency processes during action cancellation.Journal: Nature communicationsIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, 9 references
- [4] doi:10.1002/gps3.70042 [code]
- Effects of single-session transcranial direct current stimulation on response inhibition in stop-signal task performance: A meta-analysis and systematic review.Journal: General psychiatryIn common: 7 references
- [5] doi:10.1111/ejn.70528 [code]
- Dorsal Posterior Parietal Cortex Lesions Disrupt Spatial- but Not Motor-Based Inhibition.Journal: The European journal of neuroscienceIn common: 7 references
- [6] doi:10.1038/s41467-026-71404-0 [code]
- Nonergodicity and Simpson's paradox in neurocognitive dynamics of cognitive control.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 5 references
- [7] doi:10.1093/brain/awaf431 [code]
- Behavioural and clinical biomarkers of the human bed nucleus of stria terminalis from direct neural recordings.Journal: Brain : a journal of neurologyIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, 2 references
- [8] doi:10.1038/s41531-026-01421-9 [code]
- Cortico-pallidal beta dynamics underlie impaired turning in Parkinson's disease.Journal: NPJ Parkinson's diseaseIn common: Image Processing Toolbox, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, systems, 2 references
- [9] doi:10.1523/jneurosci.0154-26.2026 [code]
- Faster but less precise: expectation enhances response speed while reducing sensory fidelity.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, EEG, 1 reference
- [10] doi:10.1038/s41467-026-73916-1 [code]
- Learned statistical regularity modulates anticipatory micro-saccades toward suppressed distractor locations.Journal: Nature communicationsIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, EEG, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 14 scripts, and 5 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:817786d53863b143…
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.
