Closed-loop readout of anterior insula high-gamma activity steers value-based decisions.
The 2 matches
- [1] § Methods › Statistical analyses ↔ a1_behav_archoices_bci.m, lines 398–461 · score 0.67 · regression coefficients, random slopes, fitglme, linear, intercepts, predictor
- [2] § Methods › Statistical analyses › Behavioral effects of BCI-triggered neural states ↔ a1_behav_archoices_bci.m, lines 332–396 · score 0.54 · inter trial interval, reject, mixed, behavior, variables, aIns
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 · 837 lines · 40 KB · CC-BY-4.0 · 2 matches
- %% a1_behav_archoices_bci
- % Runs behavioural analyses for the simple choices stage.
- %
- % Input:
- % - analysis level: 1 for individual analyses, 2 for group analyses.
- % Lvl 1 must be run before lvl 2 (lvl 2 uses output saved during lvl 1).
- %
- % Output:
- % - none. Runs function of corresponding analysis level, which saves
- % its own output struct and plots to corresponding 'out' folder.
- %
- % Clarissa Baratin, April 2021 / G. Becq 20260603
- % parts of script adapted from Teddy Landron
- %% options struct
- options.smooth_fit = {'yes'}; % fit curve smoothing? 'yes' or 'no'
- options.n_eltBin = 10; %
- options.nBin = 7;
- options.prctile = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
- options.mean_med = 'mean'; % mean or median 'med'RT
- options.plot_optional_figI = false;
- options.plot_optional_figII = false;
- %% individual vs. multiple subjects scripts
- % subjects = importdata('./subjects.mat');
- subjects = get_subjects();
- [subjects, stats_Lvl1] = f_behav_archoices_lvl1_bci(options, subjects);
- f_behav_archoices_lvl2_bci(options, subjects, stats_Lvl1);
- %%
- % transform subjects. mat to readable csv files
- % change to true if you want to generate csv file from subjects.mat file.
- if false
- subids = ["sub-01", "sub-02", "sub-03", "sub-04", "sub-05", "sub-06", "sub-07", "sub-08", "sub-09", "sub-10", "sub-11", "sub-12"];
- colnames1 = {'stimnumber', 'type1', 'type2', 'value', 'RT', '1stRT', 'Z'};
- colnames3 = {'Spatial_configuration', 'Pleasant_stimulus_number', 'Unpleasant_stimulus_number', ...
- 'Pleasant_stimulus_value', 'Unpleasant_stimulus_value', 'Value_difference', ...
- 'Value_sum', 'Accept?', 'Reaction_time', 'Threshold_reached', 'Nothing', ...
- 'Trial_onset', 'Onset_of_confirmation_screen', 'col14'};
- for i = 1 : 12
- x1 = subjects(i).trial_characteristics1;
- T1 = array2table(x1, 'VariableNames', colnames1);
- fn1 = subids(i) + "_trialchar1.csv";
- writetable(T1, fn1);
- end
- rois = {'vmPFC', 'aIns'};
- for i = 1 : 12
- for iroi = 1 : 2
- roi = rois{iroi};
- if isfield(subjects(i).trial_characteristics3, roi)
- T3 = array2table(subjects(i).trial_characteristics3.(roi), 'VariableNames', colnames3);
- fn3 = subids(i) + "_trialchar3_" + roi + ".csv";
- writetable(T3, fn3);
- end
- end
- end
- end
- %%
- function subjects = get_subjects()
- subids = ["sub-01", "sub-02", "sub-03", "sub-04", "sub-05", "sub-06", "sub-07", "sub-08", "sub-09", "sub-10", "sub-11", "sub-12"];
- rois = {'vmPFC', 'aIns'};
- subjects = [];
- for isub = 1 : 12
- fn1 = subids(isub) + "_trialchar1.csv";
- T1 = readtable(fn1);
- subjects(isub).name = subids(isub);
- subjects(isub).trial_characteristics1 = table2array(T1);
- for iroi = 1 : 2
- roi = rois{iroi};
- fn3 = subids(isub) + "_trialchar3_" + roi + ".csv";
- disp(exist(fn3))
- if exist(fn3)
- T3 = readtable(fn3);
- subjects(isub).trial_characteristics3.(roi) = table2array(T3);
- end
- end
- end
- end
- %%
- function [subjects, stats_Lvl1] = f_behav_archoices_lvl1_bci(options, subjects)
- % # Initialize structures
- nSub = size(subjects, 2);
- stats = struct();
- stats_Lvl1 = [];
- % # MEDIAN PERCENTAGE YES RESPONSES
- % figure
- %
- % T_percentAccept = [];
- %
- % for iSub = 1:nSub
- %
- % % get percentage of trials where participant accepts
- % stats.percentAccept(iSub) = sum(subjects(iSub).trial_characteristics3(:,8) == 1)/length(subjects(iSub).trial_characteristics3(:,8))*100;
- %
- % % plot nb of trials where participant accepts
- % hold on
- % scatter(iSub, stats.percentAccept(iSub))
- % xlabel('Subjects')
- % ylabel('Acceptance %')
- % xlim([0 nSub + 1])
- % ylim([0 100])
- %
- % end
- %
- % f_saveToMultipleFormats(fullfile(PLOTS_PATH, 'AcceptancePercent'))
- % # P(accept) dependent on condition
- count_vmPFC = 0;
- count_aIns = 0;
- for iSub = 1:nSub
- fields = fieldnames(subjects(iSub).trial_characteristics3);
- for iROI = 1:size(fields, 1)
- roi_name = fields{iROI};
- switch roi_name
- case 'vmPFC'
- count_vmPFC = count_vmPFC + 1;
- count = count_vmPFC;
- case 'aIns'
- count_aIns = count_aIns + 1;
- count = count_aIns;
- end
- stats.(roi_name).subject{count} = subjects(iSub).name;
- UP_subset = find(subjects(iSub).trial_characteristics3.(roi_name)(:,10) == 2);
- DOWN_subset = find(subjects(iSub).trial_characteristics3.(roi_name)(:,10) == 1);
- stats.(roi_name).UP.percentAccept(count) = sum(subjects(iSub).trial_characteristics3.(roi_name)(UP_subset,8) == 1)/length(subjects(iSub).trial_characteristics3.(roi_name)(UP_subset,8))*100;
- UP_percentaccept = stats.(roi_name).UP.percentAccept(count);
- stats.(roi_name).DOWN.percentAccept(count) = sum(subjects(iSub).trial_characteristics3.(roi_name)(DOWN_subset,8) == 1)/length(subjects(iSub).trial_characteristics3.(roi_name)(DOWN_subset,8))*100;
- DOWN_percentaccept = stats.(roi_name).DOWN.percentAccept(count);
- %RT data
- stats.(roi_name).UP.RT(count) = mean(subjects(iSub).trial_characteristics3.(roi_name)(UP_subset,9));
- stats.(roi_name).DOWN.RT(count) = mean(subjects(iSub).trial_characteristics3.(roi_name)(DOWN_subset,9));
- if options.plot_optional_figI
- figure('Position',[100 100 150 150])
- X = categorical({'Up','Down'});
- b = bar(X, [UP_percentaccept, DOWN_percentaccept],0.5, 'EdgeColor',[0 0.4470 0.7410]);
- b.FaceColor = 'flat';
- b.CData(1,:) = [0.8500 0.3250 0.0980];
- ylim([0 100])
- title(sprintf('Subject %d', iSub))
- ylabel('Acceptance %')
- set(gca, 'box', 'off')
- % f_saveToMultipleFormats(fullfile(strcat(subjects(iSub).name,'_AcceptancePercent_UP_DOWN', roi_name)))
- end
- %%%%%%% Compare distributions of value differences between conditions
- value_diff_UP = subjects(iSub).trial_characteristics3.(roi_name)(UP_subset, 6);
- value_diff_DOWN = subjects(iSub).trial_characteristics3.(roi_name)(DOWN_subset, 6);
- if options.plot_optional_figI
- figure('Position',[100 100 250 170])
- histogram(value_diff_UP, 15, 'FaceColor',[0 0.4470 0.7410])
- hold on
- histogram(value_diff_DOWN, 15, 'FaceColor', [0.8500 0.3250 0.0980])
- xlabel('P-UP values')
- set(gca, 'box', 'off')
- % saveas(gcf, fullfile(strcat(subjects(iSub).name,'_ValueDistr_UP_DOWN', roi_name)),'epsc');
- end
- end
- end
- % # ANALYSES, per bin method, subject
- count_vmPFC = 0;
- count_aIns = 0;
- % supblot formatting
- binMethods = {'nBin', 'nElt', 'prctile'};
- % figure('Position',[100 100 11000 300]);
- for iSub = 1:nSub %GLMs per subject loop: layer 1
- fields = fieldnames(subjects(iSub).trial_characteristics3);
- for iROI = 1:size(fields, 1)
- roi_name = fields{iROI};
- switch roi_name
- case 'vmPFC'
- count_vmPFC = count_vmPFC + 1;
- count = count_vmPFC;
- case 'aIns'
- count_aIns = count_aIns + 1;
- count = count_aIns;
- end
- behav_data = subjects(iSub).trial_characteristics3.(roi_name);
- P_value = behav_data(:, 4);
- UP_value = behav_data(:, 5);
- P_UP_diff = behav_data(:, 6);
- RT = behav_data(:, 9);
- accept = behav_data(:, 8);
- P_value_zscored = normalize(behav_data(:, 4));
- UP_value_zscored = normalize(behav_data(:, 5));
- UP_subset = find(behav_data(:,10) == 2);
- DOWN_subset = find(behav_data(:,10) == 1);
- % DOWN trials
- % logistic regression: choice as a function of P-UP
- [DOWN_betas_P_UP_diff, ~, DOWN_stats_P_UP_diff] = glmfit(P_UP_diff(DOWN_subset), accept(DOWN_subset), 'binomial', 'logit');
- DOWN_P_UP_diff_fit = glmval(DOWN_betas_P_UP_diff, P_UP_diff(DOWN_subset), 'logit');
- DOWN_P_UP_diff_fit_toplot = sortrows([P_UP_diff(DOWN_subset), DOWN_P_UP_diff_fit]); % only to make plotting fit as line easier
- % UP trials
- % logistic regression: choice as a function of P-UP
- [UP_betas_P_UP_diff, ~, UP_stats_P_UP_diff] = glmfit(P_UP_diff(UP_subset), accept(UP_subset), 'binomial', 'logit');
- UP_P_UP_diff_fit = glmval(UP_betas_P_UP_diff, P_UP_diff(UP_subset), 'logit');
- UP_P_UP_diff_fit_toplot = sortrows([P_UP_diff(UP_subset), UP_P_UP_diff_fit]); % only to make plotting fit as line easier
- %%%% PSE calculation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % calculate point of subjective equality
- %http://rstudio-pubs-static.s3.amazonaws.com/446272_5aa2c51c9e2d4e71b2cf8229e205ce64.html
- UP_PSE_P_UP_diff(iSub, 1) = -(UP_betas_P_UP_diff(1)/UP_betas_P_UP_diff(2)); % if you let a + BX =0, then p = .50
- DOWN_PSE_P_UP_diff(iSub, 1) = -(DOWN_betas_P_UP_diff(1)/DOWN_betas_P_UP_diff(2)); % if you let a + BX =0, then p = .50
- % plot glms
- if options.plot_optional_figI
- figure('Position',[100 100 150 150]);
- cmap = [[0.4660 0.6740 0.1880]; [0.6350 0.0780 0.1840]]; %red, green
- g1 = gramm('x', UP_P_UP_diff_fit_toplot(:,1), 'y', UP_P_UP_diff_fit_toplot(:,2));
- g1.geom_line();
- g1.set_line_options('base_size', 2);
- g1.set_title(sprintf('Subject %d', iSub));
- g1.set_names('x', 'P- UP value', 'y', 'Choice');
- g1.axe_property('YLim', [0 1], 'XGrid', 'on', 'YGrid', 'on');
- g1.set_color_options('map', [0.6350 0.0780 0.1840; 0 0 0]);
- g1.update('x', DOWN_P_UP_diff_fit_toplot(:,1), 'y', DOWN_P_UP_diff_fit_toplot(:,2));
- g1.geom_line();
- g1.set_color_options('map', [0.4660 0.6740 0.1880; 0 0 0]);
- g1.draw();
- end
- % f_saveToMultipleFormats(fullfile(PLOTS_PATH, strcat(subjects(iSub).name,'P_UP_diff_regression_', roi_name)));
- %%%%%%% MODEL FOR PAPER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % logistic regression: predict choice with weights for pleasant and unpleasant values, for up and down trials separately
- xP_UP = [P_value_zscored,UP_value_zscored]; % column 1: Pleasant rating values; 2: Unpleasant rating values
- % up trials
- [UP_betas_P_UP,~,UP_stats_P_UP] = glmfit(xP_UP(UP_subset, :), accept(UP_subset),'binomial','link','logit');
- UP_fit_pleasant = glmval(UP_betas_P_UP(1:2), xP_UP(UP_subset, 1), 'logit');
- UP_fit_toplot_pleasant = sortrows([xP_UP(UP_subset, 1), UP_fit_pleasant]); % only to make plotting fit as line easier
- UP_fit_unpleasant = glmval(UP_betas_P_UP([1, 3]), xP_UP(UP_subset, 2), 'logit');
- UP_fit_toplot_unpleasant = sortrows([xP_UP(UP_subset, 2), UP_fit_unpleasant]); % only to make plotting fit as line easier
- stats.(roi_name).UP.glm_P_UP_betas(count, :) = UP_betas_P_UP;
- % down trials
- [DOWN_betas_P_UP,~,DOWN_stats_P_UP] = glmfit(xP_UP(DOWN_subset, :),accept(DOWN_subset),'binomial','link','logit');
- DOWN_fit_pleasant = glmval(DOWN_betas_P_UP(1:2), xP_UP(DOWN_subset, 1), 'logit');
- DOWN_fit_toplot_pleasant = sortrows([xP_UP(DOWN_subset, 1), DOWN_fit_pleasant]); % only to make plotting fit as line easier
- DOWN_fit_unpleasant = glmval(DOWN_betas_P_UP([1, 3]), xP_UP(DOWN_subset, 2), 'logit');
- DOWN_fit_toplot_unpleasant = sortrows([xP_UP(DOWN_subset, 2), DOWN_fit_unpleasant]); % only to make plotting fit as line easier
- stats.(roi_name).DOWN.glm_P_UP_betas(count, :) = DOWN_betas_P_UP;
- % plot glms: pleasant trials in green, unpleasant in red
- if options.plot_optional_figI
- figure('Position',[100 100 600 150]);
- subplot(1, 4, 1);
- plot(UP_fit_toplot_pleasant(:, 1), UP_fit_toplot_pleasant(:, 2), 'LineWidth', 2);
- title('Pleasant - up');
- ylim([0 1]);
- xlabel('Value');
- ylabel('Choice');
- subplot(1, 4, 2);
- plot(UP_fit_toplot_unpleasant(:, 1), UP_fit_toplot_unpleasant(:, 2), 'LineWidth', 2);
- title('Unpleasant - up');
- ylim([0 1]);
- xlabel('Value');
- ylabel('Choice');
- subplot(1, 4, 3);
- plot(DOWN_fit_toplot_pleasant(:, 1), DOWN_fit_toplot_pleasant(:, 2), 'LineWidth', 2);
- title('Pleasant - down');
- ylim([0 1]);
- xlabel('Value');
- ylabel('Choice');
- subplot(1, 4, 4);
- plot(DOWN_fit_toplot_unpleasant(:, 1), DOWN_fit_toplot_unpleasant(:, 2), 'LineWidth', 2);
- title('Unpleasant - down');
- ylim([0 1]);
- xlabel('Value');
- ylabel('Choice');
- end
- % f_saveToMultipleFormats(fullfile(PLOTS_PATH, strcat(subjects(iSub).name,'glm_w_weights_', roi_name)));
- end
- end
- % stats.options = options;
- stats_Lvl1 = stats;
- % save(fullfile(OUT_PATH, 'subjects.mat'), 'subjects')
- % save(fullfile(OUT_PATH, 'stats_Lvl1.mat'), 'stats_Lvl1')
- end
- %%
- function f_behav_archoices_lvl2_bci(options, subjects, indiv_stats)
- % f_behav_rating_lvl2 Function used to analyze behavioural data from all
- % participants together.
- %
- %
- %
- % Clarissa Baratin, April 2021
- % parts of script adapted from Teddy Landron
- nSub = size(subjects, 2);
- % # create a table for the mixed models
- roidata_allsubs = [];
- for iSub = 1:nSub
- fields = fieldnames(subjects(iSub).trial_characteristics3);
- for iROI = 1:length(fields)
- roi = fields{iROI};
- if isequal(roi,'aIns'); roi_nb = 1; else roi_nb = 2; end
- %if ~exist(fullfile(PLOTS_PATH, roi), 'dir') % Si le dossier d'analyses n'existe pas on le créé
- % mkdir(fullfile(PLOTS_PATH, roi));
- %end
- subdata_forT = [];
- sesdata = subjects(iSub).trial_characteristics3.(roi);
- % get info
- ntrials = length(sesdata);
- subdata_forT(:, 1) = repelem(iSub, ntrials);
- subdata_forT(:, 2) = repelem(roi_nb, ntrials);
- subdata_forT(:, 3) = normalize(sesdata(:, 6)); %P-UP values
- subdata_forT(:, 4) = sesdata(:, 8); % accept = 1, reject = 0
- subdata_forT(:, 5) = sesdata(:, 10); % 1 = down, 2 = up
- subdata_forT(:, 6) = sesdata(:, 9); %RT
- subdata_forT(:, 7) = normalize(sesdata(:, 9)); %RT normalized
- %inter-trial interval
- subdata_forT(:, 8) = [NaN; subjects(iSub).trial_characteristics3.(roi)(2:ntrials, 12) - subjects(iSub).trial_characteristics3.(roi)(1:ntrials-1, 13)];
- subdata_forT(:, 9) = abs(sesdata(:, 6)); %P-UP values, not normalized
- % % add pleasant and unpleasant stimulus values, z-scored
- % subdata_forT(:, 9) = normalize(sesdata(:, 4)); %P value
- % subdata_forT(:, 10) = normalize(sesdata(:, 5)); %UP value
- for itrial = 1:ntrials
- if subdata_forT(itrial, 8) > 60 || subdata_forT(itrial, 8) == 0; subdata_forT(itrial, 8) = NaN; end %avoid counting re-launched trials or between different sessions
- end
- roidata_allsubs = vertcat(roidata_allsubs, subdata_forT);
- T_data = array2table(roidata_allsubs, 'VariableNames',{'Sub', 'ROI', 'Value_diff', 'Accept', 'Up_down', 'RT', 'RT-zscored', 'ItI_s', 'Value_diff_nonorm_abs'});
- end
- RT_meanpersub(iSub, 1) = mean(subdata_forT(:, 6));
- end
- %% ADDED 26/10/2025: PREDICT RT FROM UNSIGNED VALUE DIFF
- % #Mixed linear regression
- % predict RT with a random slope and intercept per subject
- glme2 = [];
- glme2 = fitglme(T_data,'RT~Value_diff_nonorm_abs+(Value_diff_nonorm_abs|Sub)', 'Distribution', 'Normal', 'Link', 'identity')
- [fixed_betas,fixedbetanames] = fixedEffects(glme2);
- fixed_rows_valuediff = strcmp(fixedbetanames.Name, 'Value_diff_nonorm_abs');
- [random_betas,beta_names] = randomEffects(glme2);
- fixed_effects_predictions_valuediff = glmval(fixed_betas(fixed_rows_valuediff, :), T_data.Value_diff_nonorm_abs, 'identity');
- fixed_effects_predictions_toplot_valuediff = sortrows([T_data.Value_diff_nonorm_abs, fixed_effects_predictions_valuediff]); %sorts the rows of a matrix in ascending order based on the elements in the first column
- if options.plot_optional_figII
- figure('Position',[100 100 130 130]);
- for iSub = 1:nSub
- rows = strcmp(beta_names.Level, num2str(iSub)) & (strcmp(beta_names.Name, 'Value_diff_nonorm_abs') | strcmp(beta_names.Name, '(Intercept)'));
- random_betas_persub = fixed_betas(fixed_rows_valuediff, :) + random_betas(rows);
- random_effects_predictions_persub = glmval(random_betas_persub, T_data.Value_diff_nonorm_abs, 'identity');
- random_effects_predictions_toplot_persub = sortrows([T_data.Value_diff_nonorm_abs, random_effects_predictions_persub]);
- hold on
- plot(random_effects_predictions_toplot_persub(:, 1), random_effects_predictions_toplot_persub(:, 2), 'Color', [0.8 0.8 0.8])
- end
- plot(fixed_effects_predictions_toplot_valuediff(:, 1), fixed_effects_predictions_toplot_valuediff(:, 2), 'LineWidth', 3, 'Color', 'black')
- % title(blk)
- xlabel('|Pleasant-unpleasant rating|')
- xticks([min(fixed_effects_predictions_toplot_valuediff(:, 1)) max(fixed_effects_predictions_toplot_valuediff(:, 1))])
- %xticklabels({'0', '100'})
- ylabel('RT')
- xlim([min(fixed_effects_predictions_toplot_valuediff(:, 1)) max(fixed_effects_predictions_toplot_valuediff(:, 1))])
- % saveas(gcf, fullfile('Mixed models - RT by abs(pleas-unpleas).png'));
- end
- % #GLM WEIGHTS for pleasant and unpleasant/up and down/vmPFC and aIns
- % Bar plots with two bars: up-down pleasant trials and up-down unpleasant trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- P_UP_col_vmPFC = [repelem({'Pleasant'}, length(indiv_stats.vmPFC.subject)), repelem({'Unpleasant'}, length(indiv_stats.vmPFC.subject))]';
- %UP_DOWN_col_vmPFC = [repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject))]';
- UP_minus_DOWN_betas_col_vmPFC = [indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 2)-indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 2); indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 3)-indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 3)]; % col 2 = pleasant betas, col 3 = unpleasant betas
- T_glm_vmPFC = table(P_UP_col_vmPFC, UP_minus_DOWN_betas_col_vmPFC);
- if options.plot_optional_figII
- % Bar plot of pleasant vs unpleasant regression coefficients in the vmPFC for UP minus DOWN trials
- figure('Position',[100 100 300 300]);
- figfilename = 'barplot_betas_UPminusDOWN_vmPFC';
- g = gramm('x', T_glm_vmPFC.P_UP_col_vmPFC, 'y', T_glm_vmPFC.UP_minus_DOWN_betas_col_vmPFC);
- g.set_title('vmPFC');
- g.stat_summary('geom', {'bar', 'black_errorbar'}, 'width', 0.6);
- %g.set_color_options('map', [0.8 0.8 0.8]); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- %g.axe_property('XLim', [0.5 2.5], 'XTick', [0.75 2.25], 'XTickLabels', {'Pleas','Unpleas'}); %
- g.set_names('y', 'Regression coefficients', 'x', ' ');
- g.geom_hline('yintercept', 0);
- %g.no_legend();
- g.update('x', T_glm_vmPFC.P_UP_col_vmPFC, 'y', T_glm_vmPFC.UP_minus_DOWN_betas_col_vmPFC);
- g.geom_jitter('dodge', 0.5);
- g.set_point_options('base_size', 4);
- %g.set_color_options('map', [0.1 0.1 0.1]); %
- g.no_legend();
- g.draw();
- % saveas(gcf, fullfile(PLOTS_PATH,[figfilename '.png']));
- end
- % ttests against zero
- % Pleasant betas - vmPFC
- fprintf('T-test pleasant regression coefficients vmPFC \n')
- [h,p,ci,stats] = ttest(indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 2)-indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 2))
- % Unpleasant betas - vmPFC
- fprintf('T-test unpleasant regression coefficients vmPFC \n')
- %[h,p,ci,stats] = ttest(indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 3)indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 3))
- % Bar plot of pleasant vs unpleasant regression coefficients in the aIns for UP minus DOWN trials
- P_UP_col_aIns = [repelem({'Pleasant'}, length(indiv_stats.aIns.subject)), repelem({'Unpleasant'}, length(indiv_stats.aIns.subject))]';
- %UP_DOWN_col_vmPFC = [repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject))]';
- UP_minus_DOWN_betas_col_aIns = [indiv_stats.aIns.UP.glm_P_UP_betas(:, 2)-indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 2); indiv_stats.aIns.UP.glm_P_UP_betas(:, 3)-indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 3)]; % col 2 = pleasant betas, col 3 = unpleasant betas
- T_glm_aIns = table(P_UP_col_aIns, UP_minus_DOWN_betas_col_aIns);
- if options.plot_optional_figII
- % Bar plot of pleasant vs unpleasant regression coefficients in the vmPFC for UP and DOWN trials
- figure('Position',[100 100 300 300]);
- figfilename = 'barplot_betas_UPminusDOWN_aIns';
- g = gramm('x', T_glm_aIns.P_UP_col_aIns, 'y', T_glm_aIns.UP_minus_DOWN_betas_col_aIns);
- g.set_title('aIns');
- g.stat_summary('geom', {'bar', 'black_errorbar'}, 'width', 0.6);
- %g.set_color_options('map', [0.8 0.8 0.8]); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- %g.axe_property('XLim', [0.5 2.5], 'XTick', [0.75 2.25], 'XTickLabels', {'Pleas','Unpleas'}); %
- g.set_names('y', 'Regression coefficients', 'x', ' ');
- g.geom_hline('yintercept', 0);
- %g.no_legend();
- g.update('x', T_glm_aIns.P_UP_col_aIns, 'y', T_glm_aIns.UP_minus_DOWN_betas_col_aIns);
- g.geom_jitter('dodge', 0.5);
- g.set_point_options('base_size', 4);
- %g.set_color_options('map', [0.1 0.1 0.1]); %
- g.no_legend();
- g.draw();
- % saveas(gcf, fullfile([figfilename '.png']));
- end
- % ttests against zero
- % Pleasant betas - aIns
- fprintf('T-test pleasant regression coefficients aIns \n')
- [h,p,ci,stats] = ttest(indiv_stats.aIns.UP.glm_P_UP_betas(:, 2)-indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 2))
- % Unpleasant betas - aIns
- fprintf('T-test unpleasant regression coefficients aIns \n')
- [h,p,ci,stats] = ttest(indiv_stats.aIns.UP.glm_P_UP_betas(:, 3)-indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 3))
- % Bar plots with four bars: up & down pleasant trials and up & down unpleasant trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % VMPFC
- P_UP_col_vmPFC = [repelem({'Pleasant'}, length(indiv_stats.vmPFC.subject)), repelem({'Unpleasant'}, length(indiv_stats.vmPFC.subject)), repelem({'Pleasant'}, length(indiv_stats.vmPFC.subject)), repelem({'Unpleasant'}, length(indiv_stats.vmPFC.subject))]';
- UP_DOWN_col_vmPFC = [repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Up'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject)), repelem({'Down'}, length(indiv_stats.vmPFC.subject))]';
- UP_DOWN_betas_col_vmPFC = [indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 2); indiv_stats.vmPFC.UP.glm_P_UP_betas(:, 3); indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 2); indiv_stats.vmPFC.DOWN.glm_P_UP_betas(:, 3)]; % col 2 = pleasant betas, col 3 = unpleasant betas
- T_glm_vmPFC2 = table(P_UP_col_vmPFC, UP_DOWN_betas_col_vmPFC, UP_DOWN_col_vmPFC);
- if options.plot_optional_figII
- % Bar plot of pleasant vs unpleasant regression coefficients in the vmPFC for UP and DOWN trials
- figure('Position',[100 100 300 300]);
- figfilename = 'barplot_betas_UPandDOWN_vmPFC';
- g = gramm('x', T_glm_vmPFC2.P_UP_col_vmPFC, 'y', T_glm_vmPFC2.UP_DOWN_betas_col_vmPFC, 'color', T_glm_vmPFC2.UP_DOWN_col_vmPFC);
- g.set_title('vmPFC');
- g.stat_summary('geom', {'bar', 'black_errorbar'}, 'width', 0.6);
- %g.set_color_options('map', [0.8 0.8 0.8]); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.geom_hline('yintercept', 0)
- %g.axe_property('XLim', [0.5 2.5], 'XTick', [0.75 2.25], 'XTickLabels', {'Pleas','Unpleas'}); %
- g.set_names('y', 'Regression coefficients', 'x', ' ');
- %g.no_legend();
- g.update('x', T_glm_vmPFC2.P_UP_col_vmPFC, 'y', T_glm_vmPFC2.UP_DOWN_betas_col_vmPFC, 'color', T_glm_vmPFC2.UP_DOWN_col_vmPFC);
- g.geom_jitter('dodge', 0.5, 'alpha', 0.5);
- g.set_point_options('base_size', 4);
- %g.set_color_options('map', [0.1 0.1 0.1]); %
- g.no_legend();
- g.draw();
- % saveas(gcf, fullfile([figfilename '.png']));
- end
- % aINS
- P_UP_col_aINS = [repelem({'Pleasant'}, length(indiv_stats.aIns.subject)), repelem({'Unpleasant'}, length(indiv_stats.aIns.subject)), repelem({'Pleasant'}, length(indiv_stats.aIns.subject)), repelem({'Unpleasant'}, length(indiv_stats.aIns.subject))]';
- UP_DOWN_col_aINS = [repelem({'Up'}, length(indiv_stats.aIns.subject)), repelem({'Up'}, length(indiv_stats.aIns.subject)), repelem({'Down'}, length(indiv_stats.aIns.subject)), repelem({'Down'}, length(indiv_stats.aIns.subject))]';
- UP_DOWN_betas_col_aINS = [indiv_stats.aIns.UP.glm_P_UP_betas(:, 2); indiv_stats.aIns.UP.glm_P_UP_betas(:, 3); indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 2); indiv_stats.aIns.DOWN.glm_P_UP_betas(:, 3)]; % col 2 = pleasant betas, col 3 = unpleasant betas
- T_glm_aINS2 = table(P_UP_col_aINS, UP_DOWN_betas_col_aINS, UP_DOWN_col_aINS);
- if options.plot_optional_figII
- % Bar plot of pleasant vs unpleasant regression coefficients in the vmPFC for UP and DOWN trials
- figure('Position',[100 100 300 300]);
- figfilename = 'barplot_betas_UPandDOWN_aIns';
- g = gramm('x', T_glm_aINS2.P_UP_col_aINS, 'y', T_glm_aINS2.UP_DOWN_betas_col_aINS, 'color', T_glm_aINS2.UP_DOWN_col_aINS);
- g.set_title('aIns');
- g.stat_summary('geom', {'bar', 'black_errorbar'}, 'width', 0.6);
- %g.set_color_options('map', [0.8 0.8 0.8]); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.geom_hline('yintercept', 0);
- %g.axe_property('XLim', [0.5 2.5], 'XTick', [0.75 2.25], 'XTickLabels', {'Pleas','Unpleas'}); %
- g.set_names('y', 'Regression coefficients', 'x', ' ');
- %g.no_legend();
- g.update('x', T_glm_aINS2.P_UP_col_aINS, 'y', T_glm_aINS2.UP_DOWN_betas_col_aINS, 'color', T_glm_aINS2.UP_DOWN_col_aINS);
- g.geom_jitter('dodge', 0.5, 'alpha', 0.5);
- g.set_point_options('base_size', 4);
- %g.set_color_options('map', [0.1 0.1 0.1]); %
- g.no_legend();
- g.draw();
- % saveas(gcf, fullfile([figfilename '.png']));
- end
- % #MIXED MODELS
- % Mixed logistic regression: overall subject performance
- % predict P(accept based on the Value diff (P-UP) with a random slope and intercept per subject
- glme1 = [];
- glme1 = fitglme(T_data,'Accept~Value_diff+(Value_diff|Sub)', 'Distribution', 'Binomial', 'Link', 'logit')
- [fixed_betas,fixedbetanames] = fixedEffects(glme1);
- fixed_rows_valuediff = strcmp(fixedbetanames.Name, 'Value_diff') | strcmp(fixedbetanames.Name, '(Intercept)');
- [random_betas,beta_names] = randomEffects(glme1);
- fixed_effects_predictions = glmval(fixed_betas, T_data.Value_diff, 'logit');
- fixed_effects_predictions_toplot = sortrows([T_data.Value_diff, fixed_effects_predictions]);
- figfilename = 'P_accept_overall';
- if true %Fig.1.d
- figure('Position',[100 100 130 130]);
- for iSub = 1:nSub
- rows = strcmp(beta_names.Level, num2str(iSub)) & (strcmp(beta_names.Name, 'Value_diff') | strcmp(beta_names.Name, '(Intercept)'));
- random_betas_persub = fixed_betas(fixed_rows_valuediff, :) + random_betas(rows);
- random_effects_predictions_persub = glmval(random_betas_persub, T_data.Value_diff, 'logit');
- random_effects_predictions_toplot_persub = sortrows([T_data.Value_diff, random_effects_predictions_persub]);
- hold on
- plot(random_effects_predictions_toplot_persub(:, 1), random_effects_predictions_toplot_persub(:, 2), 'Color', [0.8 0.8 0.8], 'LineWidth', 1)
- end
- plot(fixed_effects_predictions_toplot(:, 1), fixed_effects_predictions_toplot(:, 2), 'LineWidth', 2, 'Color', [0 0 0]) % , 'Color', options.aesthetics.choice_colors(iblk, :)
- % title(blk)
- xlabel({'Pleasant-unpleasant';'rating'})
- ylabel('P(accept)')
- xticks([min(fixed_effects_predictions_toplot(:, 1)) max(fixed_effects_predictions_toplot(:, 1))])
- xlim([min(fixed_effects_predictions_toplot(:, 1)) max(fixed_effects_predictions_toplot(:, 1))])
- xticklabels({'-100', '100'})
- ax = gca;
- ax.FontSize = 8;
- ax.FontName = 'arial';
- % saveas(gcf, fullfile([figfilename '.png']));
- % saveas(gcf, fullfile(figfilename), 'epsc');
- end
- if options.plot_optional_figII
- % Mixed logistic regressions: per roi and up/down block
- rois = {'aIns', 'vmPFC'};
- for iROI = 1:length(rois) % is aIns, 2 is vmPFC
- roi = rois{iROI};
- if isequal(roi,'aIns'); roi_nb = 1; else roi_nb = 2; end
- figure('Position',[100 100 150 150]);
- hold on
- condis = {'up', 'down'};
- for iCondi = 1:length(condis) % up or down
- condi = condis{iCondi};
- if isequal(condi,'up'); condi_nb = 2; else condi_nb = 1; end
- T = T_data;
- T([find(~(T_data.ROI == roi_nb) & ~(T_data.Up_down == condi_nb))], :) = []; % delete all rows which are not the correct roi and up/down
- glme = [];
- glme = fitglme(T,'Accept~Value_diff+(Value_diff|Sub)', 'Distribution', 'Binomial', 'Link', 'logit')
- fixed_betas = fixedEffects(glme);
- [random_betas1,beta_names] = randomEffects(glme);
- fixed_effects_predictions = glmval(fixed_betas, T.Value_diff, 'logit');
- fixed_effects_predictions_toplot = sortrows([T.Value_diff, fixed_effects_predictions]);
- plot(fixed_effects_predictions_toplot(:, 1), fixed_effects_predictions_toplot(:, 2), 'LineWidth', 2) % , 'Color', options.aesthetics.choice_colors(iblk, :)
- % title(blk)
- xlabel('Pleasant-unpleasant rating')
- ylabel('P(accept)')
- xticks([min(fixed_effects_predictions_toplot(:, 1)) max(fixed_effects_predictions_toplot(:, 1))])
- xlim([min(fixed_effects_predictions_toplot(:, 1)) max(fixed_effects_predictions_toplot(:, 1))])
- xticklabels({'-100', '100'})
- ax = gca;
- ax.FontSize = 8;
- ax.FontName = 'arial';
- end
- hold off
- end
- end
- % Mixed logistic regression: overall subject performance
- % predict P(accept based on the Value diff (P-UP) with a random slope and intercept per subject
- glme2 = [];
- glme2 = fitglme(T_data,'Accept~Value_diff+ItI_s+Up_down+ROI+ROI*Up_down+(Value_diff|Sub)', 'Distribution', 'Binomial', 'Link', 'logit')
- %% Bar plots: ALL BARS ON SAME PLOT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- percent_accept_allcondis = nan(4, max(length(indiv_stats.vmPFC.UP.percentAccept), length(indiv_stats.aIns.UP.percentAccept)));
- percent_accept_allcondis(1, 1:length(indiv_stats.vmPFC.UP.percentAccept)) = indiv_stats.vmPFC.UP.percentAccept;
- percent_accept_allcondis(2, 1:length(indiv_stats.vmPFC.DOWN.percentAccept)) = indiv_stats.vmPFC.DOWN.percentAccept;
- percent_accept_allcondis(3, 1:length(indiv_stats.aIns.UP.percentAccept)) = indiv_stats.aIns.UP.percentAccept;
- percent_accept_allcondis(4, 1:length(indiv_stats.aIns.DOWN.percentAccept)) = indiv_stats.aIns.DOWN.percentAccept;
- if options.plot_optional_figII
- figure('Position',[100 100 150 150]);
- cat_vect = [repmat(0.5, length(percent_accept_allcondis), 1); repmat(1, length(percent_accept_allcondis), 1); repmat(2, length(percent_accept_allcondis), 1); repmat(2.5, length(percent_accept_allcondis), 1)];
- g = gramm('x', cat_vect, 'y', [percent_accept_allcondis(1, :)'; percent_accept_allcondis(2, :)'; percent_accept_allcondis(3, :)'; percent_accept_allcondis(4, :)'], 'color', cat_vect);
- g.stat_summary('geom', {'bar', 'black_errorbar'},'width', 3);
- %g.set_color_options('map', options.aesthetics.choice_colors); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.axe_property('XLim', [0 3], 'XTick', [0.75 2.25], 'XTickLabels', {'vmPFC','aIns'}); %
- g.set_names('y', 'Acceptance (%)', 'x', ' ');
- g.no_legend();
- g.update('x', cat_vect, 'y', [percent_accept_allcondis(1, :)'; percent_accept_allcondis(2, :)'; percent_accept_allcondis(3, :)'; percent_accept_allcondis(4, :)'], 'color', cat_vect);
- g.geom_jitter('alpha', 0.5);
- g.set_point_options('base_size', 3);
- %g.set_color_options('map', options.aesthetics.choice_colors - [0.15 0.15 0.15; 0 0.15 0.15; 0.15 0.15 0.15; 0.15 0.15 0.15]); %
- g.no_legend();
- g.draw();
- end
- [h,p_vmPFC,ci,statsvmPFC] = ttest(indiv_stats.vmPFC.UP.percentAccept,indiv_stats.vmPFC.DOWN.percentAccept)
- [h,p_aIns,ci,stats2] = ttest(indiv_stats.aIns.UP.percentAccept,indiv_stats.aIns.DOWN.percentAccept)
- [h,p_vmPFC_aIns,ci,stats2] = ttest2(indiv_stats.vmPFC.UP.percentAccept-indiv_stats.vmPFC.DOWN.percentAccept, indiv_stats.aIns.UP.percentAccept-indiv_stats.aIns.DOWN.percentAccept)
- % test without AFTl, NAIn and VINm
- %[h,p_vmPFC,ci,statsvmPFC] = ttest(indiv_stats.vmPFC.UP.percentAccept(1, [1,2,5,6]),indiv_stats.vmPFC.DOWN.percentAccept(1, [1,2,5,6]));
- % RT bar plot
- figfilename = strcat('RT_', roi);
- RT_allcondis = nan(4, max(length(indiv_stats.vmPFC.UP.RT), length(indiv_stats.aIns.UP.RT)));
- RT_allcondis(1, 1:length(indiv_stats.vmPFC.UP.RT)) = indiv_stats.vmPFC.UP.RT;
- RT_allcondis(2, 1:length(indiv_stats.vmPFC.DOWN.RT)) = indiv_stats.vmPFC.DOWN.RT;
- RT_allcondis(3, 1:length(indiv_stats.aIns.UP.RT)) = indiv_stats.aIns.UP.RT;
- RT_allcondis(4, 1:length(indiv_stats.aIns.DOWN.RT)) = indiv_stats.aIns.DOWN.RT;
- if options.plot_optional_figII
- figure('Position',[100 100 150 150]);
- cat_vect = [repmat(0.5, length(RT_allcondis), 1); repmat(1, length(RT_allcondis), 1); repmat(2, length(RT_allcondis), 1); repmat(2.5, length(RT_allcondis), 1)];
- g = gramm('x', cat_vect, 'y', [RT_allcondis(1, :)'; RT_allcondis(2, :)'; RT_allcondis(3, :)'; RT_allcondis(4, :)'], 'color', cat_vect);
- g.stat_summary('geom', {'bar', 'black_errorbar'},'width', 3);
- %g.set_color_options('map', options.aesthetics.choice_colors); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.axe_property('XLim', [0 3], 'XTick', [0.75 2.25], 'XTickLabels', {'vmPFC','aIns'}); %
- g.set_names('y', 'Acceptance (%)', 'x', ' ');
- g.no_legend();
- g.update('x', cat_vect, 'y', [RT_allcondis(1, :)'; RT_allcondis(2, :)'; RT_allcondis(3, :)'; RT_allcondis(4, :)'], 'color', cat_vect);
- g.geom_jitter('alpha', 0.5);
- g.set_point_options('base_size', 3);
- %g.set_color_options('map', options.aesthetics.choice_colors - [0.15 0.15 0.15; 0 0.15 0.15; 0.15 0.15 0.15; 0.15 0.15 0.15]); %
- g.no_legend();
- g.draw();
- % saveas(gcf, fullfile(PLOTS_PATH, roi,[figfilename '.png']));
- % saveas(gcf, fullfile(PLOTS_PATH, roi, figfilename), 'epsc');
- end
- % #BAR PLOT PER ROI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- rois = {'aIns', 'vmPFC'};
- for iROI = 1:length(rois) % is aIns, 2 is vmPFC
- roi = rois{iROI};
- percent_accept_UP = indiv_stats.(roi).UP.percentAccept;
- percent_accept_DOWN = indiv_stats.(roi).DOWN.percentAccept;
- switch roi
- case 'vmPFC'
- cmap = [hex2rgb('#7dcb9c'); hex2rgb('#7dcb9c')];
- cmap2 = repmat(hex2rgb('#1d8352'), nSub, 1);
- T_data2 = T_data(T_data.ROI==2, :);
- case 'aIns'
- cmap = [hex2rgb('#f795a2'); hex2rgb('#f795a2')];
- cmap2 = repmat(hex2rgb('#e44369'), nSub, 1);
- T_data2 = T_data(T_data.ROI==1, :);
- end
- figfilename = strcat('UpvsDown_Acceptance_', roi);
- if true % Fig2.b 2.f.
- % acceptance bar plot
- figure('Position',[200 200 120 120]);
- cat_vect = [repmat(1, length(percent_accept_UP), 1); repmat(2, length(percent_accept_DOWN), 1)];
- cat_vect2 = repmat([1:length(percent_accept_UP)], 1, 2);
- g = gramm('x', cat_vect, 'y', [percent_accept_UP'; percent_accept_DOWN']); % , 'color', cat_vect
- g.stat_summary('geom', {'bar', 'black_errorbar'},'width', 0.5);
- %g.set_color_options('map', options.aesthetics.choice_colors); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.axe_property('XLim', [0.5 2.5], 'XTick', [1 2], 'XTickLabels', {'Up','Down'}); %
- g.set_names('y', 'Acceptance (%)', 'x', ' ');
- g.no_legend();
- g.set_color_options('map', cmap);
- g.update('x', cat_vect, 'y', [percent_accept_UP'; percent_accept_DOWN']); %, 'color', cat_vect
- g.geom_point('alpha', 0.5);
- g.set_point_options('base_size', 5);
- g.set_color_options('map', cmap2);
- g.draw();
- g.update('x', cat_vect, 'y', [percent_accept_UP'; percent_accept_DOWN'], 'color', cat_vect2);
- g.set_color_options('map', cmap2);
- g.geom_line()
- %g.set_color_options('map', options.aesthetics.choice_colors - [0.15 0.15 0.15; 0 0.15 0.15; 0.15 0.15 0.15; 0.15 0.15 0.15]); %
- g.no_legend();
- g.draw()
- % saveas(gcf, fullfile(roi,[figfilename '.png']));
- % saveas(gcf, fullfile(roi, figfilename), 'epsc');
- end
- end
- % #BAR PLOT OF vmPFC vs aINS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- percent_accept_upminusdown = nan(2, max(length(indiv_stats.vmPFC.UP.percentAccept), length(indiv_stats.aIns.UP.percentAccept)));
- percent_accept_upminusdown(1, 1:length(indiv_stats.vmPFC.UP.percentAccept)) = indiv_stats.vmPFC.UP.percentAccept-indiv_stats.vmPFC.DOWN.percentAccept;
- percent_accept_upminusdown(2, 1:length(indiv_stats.aIns.UP.percentAccept)) = indiv_stats.aIns.UP.percentAccept-indiv_stats.aIns.DOWN.percentAccept;
- if options.plot_optional_figII
- figure('Position',[200 200 160 170]);
- clear g
- figfilename = 'Up_minus_Down_Acceptance';
- cat_vect = [repmat(1, length(percent_accept_upminusdown), 1); repmat(2, length(percent_accept_upminusdown), 1)];
- g = gramm('x', cat_vect, 'y', [percent_accept_upminusdown(1, :)'; percent_accept_upminusdown(2, :)'], 'color', cat_vect);
- g.stat_boxplot('width', 1); %'geom', {'bar', 'black_errorbar'},'width', 1
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.axe_property('XLim', [0.5 2.5], 'XTick', [1 2], 'YLim', [min(percent_accept_upminusdown(:))-7 max(percent_accept_upminusdown(:))+7], 'XTickLabels', {'vmPFC','aIns'}); %
- g.set_names('y', 'Up-down acceptance (%)', 'x', ' ');
- cmap = [hex2rgb('#1d8352'); hex2rgb('#e44369')];
- g.set_color_options('map', cmap); %
- g.no_legend();
- g.update('x', cat_vect, 'y', [percent_accept_upminusdown(1, :)'; percent_accept_upminusdown(2, :)'], 'color', cat_vect);
- g.geom_jitter('alpha', 0.5);
- g.set_point_options('base_size', 5);
- %g.set_color_options('map', options.aesthetics.choice_colors - [0.15 0.15 0.15; 0 0.15 0.15; 0.15 0.15 0.15; 0.15 0.15 0.15]); %
- g.no_legend();
- g.geom_abline('intercept', 0, 'slope', 0);
- g.draw();
- % saveas(gcf, fullfile([figfilename '.png']));
- % g.export('file_name', figfilename, 'file_type', 'eps')
- end
- if options.plot_optional_figII
- % # RTs bar plot
- figure('Position',[100 100 70 110]);
- g = gramm('x', repelem(1, nSub), 'y', [RT_meanpersub]);
- g.stat_summary('geom', {'bar', 'black_errorbar'}, 'width', 1);
- g.set_color_options('map', [0.8 0.8 0.8]); %
- g.axe_property('FontName', 'Arial', 'FontSize', 8);
- g.axe_property('XLim', [0 2], 'XTick',[]); %
- g.set_names('y', 'Mean RT (s)', 'x', ' ');
- g.no_legend();
- g.update('x', repelem(1, nSub), 'y', [RT_meanpersub]);
- g.geom_jitter('alpha', 0.5);
- g.set_point_options('base_size', 4);
- g.set_color_options('map', [0.1 0.1 0.1]); %
- g.no_legend();
- g.draw();
- end
- mean_RT = mean(RT_meanpersub)
- S_RT = std(RT_meanpersub);
- SEM_RT = S_RT /sqrt(length(RT_meanpersub))
- end
a1_behav_archoices_bci.m, under CC-BY-4.0 · at the source
Overview
- Univ. Grenoble Alpes, Inserm U1216, CHU Grenoble Alpes, Grenoble Institut Neurosciences, GIN, Grenoble, France
- Paris Brain Institute (ICM), Sorbonne Université, Inserm UMR1127, CNRS UMR 7225, Paris, France
- Neurology Department, CHU Grenoble Alpes, Grenoble, France
- Univ. Grenoble Alpes, CNRS, Grenoble INP, GIPSA-Lab, Grenoble, France
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
Zenodo 20545301
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
5 files
- a1_behav_archoices_bci.m
, MATLAB, 837 lines, 2 matches - a2_plot_TF.m, MATLAB, 77 lines
- a3_state_dependent_BGA_d
ynamics.m , MATLAB, 338 lines - b_NCR1_BCI_03_state_depe
ndent_BGA_dynamics.m , MATLAB, 336 lines - README.md, Text, 116 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: Zenodo 20545301
Read it in the paper: doi.org/10.1038/s41467-026-75265-5.
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;
- 4 scripts, each with its path and the digest of its content;
- 2 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 statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- no repository, dataset or request procedure was recognized in it
Read it in the paper: doi.org/10.1038/s41467-026-75265-5.
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 2, 28 September 2026
- Funding: added Agence Nationale de la Recherche: ANR-22-CE17-0057, ANR-15-IDEX-0002; Fondation pour la Recherche Médicale
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 2 keywords, 9 MeSH terms, 52 references.
Cite
This paper
Baratin, C., Pessiglione, M., Kahane, P., Robin, A., Minotti, L., Becq, G. J.-P. C., & Bastin, J. (2026). Closed-loop readout of anterior insula high-gamma activity steers value-based decisions. Nature communications, 17(1), 8325. https://
BibTeX
@article{baratin2026clos
author = {Baratin, Clarissa and Pessiglione, Mathias and Kahane, Philippe and Robin, Alexis and Minotti, Lorella and Becq, Guillaume Jean-Paul Claude and Bastin, Julien},
title = {{Closed-loop readout of anterior insula high-gamma activity steers value-based decisions}},
journal = {Nature communications},
year = {2026},
month = jul,
volume = {17},
number = {1},
pages = {8325},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42401540},
pmcid = {PMC13470483}
}
RIS
TY - JOUR
AU - Baratin, Clarissa
AU - Pessiglione, Mathias
AU - Kahane, Philippe
AU - Robin, Alexis
AU - Minotti, Lorella
AU - Becq, Guillaume Jean-Paul Claude
AU - Bastin, Julien
TI - Closed-loop readout of anterior insula high-gamma activity steers value-based decisions
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 8325
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Closed-loop readout of anterior insula high-gamma activity steers value-based decisions",
"container-title": "Nature communications",
"author": [
{
"family": "Baratin",
"given": "Clarissa"
},
{
"family": "Pessiglione",
"given": "Mathias"
},
{
"family": "Kahane",
"given": "Philippe"
},
{
"family": "Robin",
"given": "Alexis"
},
{
"family": "Minotti",
"given": "Lorella"
},
{
"family": "Becq",
"given": "Guillaume Jean-Paul Claude"
},
{
"family": "Bastin",
"given": "Julien"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "8325",
"DOI": "10.1038/
"PMID": "42401540",
"PMCID": "PMC13470483",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
4
]
]
}
}
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.1038/s41467-026-76593-2 [code]
- Complementary and opponent value signals in the human brain support choosing the best and avoiding the worst.Journal: Nature communicationsIn common: 18 references, 4 authors
- [2] doi:10.1523/eneuro.0008-26.2026 [code]
- Movement Disorder Patients with Depression Have Altered Corticostriatal Alpha-Beta Power Response to Reward and Loss.Journal: eNeuroIn common: Statistics and Machine Learning Toolbox, 3 references
- [3] doi:10.1038/s41467-026-73947-8 [code]
- Frontal cortex organization supporting audiovisual processing during naturalistic viewing.Journal: Nature communicationsIn common: cognitive, 3 references
- [4] doi:10.1371/journal.pbio.3003818 [code]
- Human neuronal firing varies with the frequency of local field potential oscillations.Journal: PLoS biologyIn common: Statistics and Machine Learning Toolbox, 3 references
- [5] doi:10.1371/journal.pbio.3003767 [code]
- Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning.Journal: PLoS biologyIn common: Statistics and Machine Learning Toolbox, cognitive, 2 references
- [6] doi:10.1038/s41598-026-49900-6 [code]
- Global neural oscillations underlie performance variability and attentional state fluctuations in humans.Journal: Scientific reportsIn common: Statistics and Machine Learning Toolbox, cognitive, 2 references
- [7] doi:10.1038/s41467-026-74331-2 [code]
- Trial-by-trial fMRI-neurofeedback dissociates fusiform and occipital contributions to face detection and recognition.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, 2 references
- [8] doi:10.1162/imag.a.1268 [code]
- Real-time fMRI-triggered experience sampling: A proof-of-concept study.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Statistics and Machine Learning Toolbox, 2 references
- [9] doi:10.7554/elife.110685 [code]
- Sensory adaptation and pupil-linked arousal support flexible evidence accumulation during perceptual decision making.Journal: eLifeIn common: Statistics and Machine Learning Toolbox, cognitive, 2 references
- [10] doi:10.1371/journal.pcbi.1014673 [code]
- Modeling the influences of non-local connectomic projections on geometrically constrained cortical dynamics.Journal: PLoS computational biologyIn common: Statistics and Machine Learning Toolbox, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 4 scripts, and 2 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:649d5cd5219af3ab…
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.
