Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning.
The 1 match
- [1] § MATERIALS AND METHODS › Shuttle box active avoidance ↔ Arturo_SAA Matlab Analysis Codes/Group_session_behav_analysis_table.m, lines 335–396 · score 0.51 · opposite chamber, onset, boxes, movement, crossed
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 · 613 lines · 33 KB · MIT · 1 match
- function Group_session_behav_analysis_table(PATH2RESULTS,show_plot,save_plot,reanalysis,overwrite)
- % Created by Arturo Torres Herraez in 2025
- % The program sumarize the results in a table in which each row is a trial
- % and the different columns contain the information regarding identity of
- % the animal, the genotype, the sex, the session, the trials number, the latencies,
- % and the outcome of the trial. It also generate diverse plots summarizing
- % the results
- if contains(PATH2RESULTS,'\')
- connector = '\';
- else
- connector = '/';
- end
- PATH2RESULTS = [PATH2RESULTS,connector];
- mice2analyze = dir(PATH2RESULTS);
- for m = length(mice2analyze):-1:1
- if mice2analyze(m).isdir == 0 || strcmp(mice2analyze(m).name(1),'.') == 1
- mice2analyze(m) = [];
- end
- end
- genotypePerMouse = cell(length(mice2analyze),1);
- sexPerMouse = cell(length(mice2analyze),1);
- for i = length(mice2analyze):-1:1
- if strcmp(mice2analyze(i).name,'.') == 1 || strcmp(mice2analyze(i).name,'..') == 1 ...
- || mice2analyze(i).isdir == 0
- mice2analyze(i) = [];
- genotypePerMouse(i) = [];
- sexPerMouse(i) = [];
- else
- tmp = split(mice2analyze(i).name);
- genotypePerMouse{i} = tmp{2};
- sexPerMouse{i} = tmp{3};
- end
- end
- Nmice = length(mice2analyze);
- genotypes = unique(genotypePerMouse);
- sex = unique(sexPerMouse);
- sex{length(sex)+1,1} = 'all';
- for g = 1:length(genotypes)
- countpergenotype.(genotypes{g}).all = 0;
- for s = 1:length(sex)-1
- countpergenotype.(genotypes{g}).(sex{s}) = 0;
- end
- end
- for m = 1:Nmice
- countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m}) = ...
- countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})+1;
- countpergenotype.(genotypePerMouse{m}).all = countpergenotype.(genotypePerMouse{m}).all + 1;
- % Create a folder to save the data for this mouse and define the path
- Path2savingfolder = strcat(PATH2RESULTS,connector,mice2analyze(m).name,connector);
- if exist(strcat(Path2savingfolder,'All_sessions_behavior.mat'),'file') == 0
- done = 0;
- else
- done = 1;
- end
- if done == 0 || reanalysis == 1
- % Find sessions to analyze
- path2sessions = [PATH2RESULTS,connector,mice2analyze(m).name];
- sessions2analyze = dir(path2sessions);
- for i = length(sessions2analyze):-1:1
- if strcmp(sessions2analyze(i).name,'.') == 1 ...
- || strcmp(sessions2analyze(i).name,'..') == 1 ...
- || sessions2analyze(i).isdir == 0
- sessions2analyze(i) = [];
- end
- end
- sessionIdx = nan(length(sessions2analyze),1);
- for i = 1:length(sessions2analyze)
- idx = split(sessions2analyze(i).name,'_');
- sessionIdx(i) = str2double(idx{1});
- end
- count = 0;
- for i = 1:length(sessions2analyze)
- folder_name = [path2sessions,connector,sessions2analyze(i).name,connector];
- % Load behavior data
- if exist([folder_name,'Behavioral_results.mat'],'file') == 2
- load([folder_name,'Behavioral_results.mat'])
- count = count + 1;
- if count == 1
- All_sessions_summary_tab = SessionTab;
- All_sessions_Stim_Data = Stim_data;
- if m == 1
- LatencyPerSession = cell(length(sessions2analyze),1);
- meanStimDataPerSession = cell(length(sessions2analyze),1);
- for g = 1:length(genotypes)
- for s = 1:length(sex)
- if strcmp(sex{s},'All')
- PercPerSession.(genotypes{g}).(sex{s}).Avoidance = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- PercPerSession.(genotypes{g}).(sex{s}).Escape = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- PercPerSession.(genotypes{g}).(sex{s}).Stay = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- medianAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- medianEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- medianFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- medianLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- SessionBaselineActivityPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- medianBaselineCrossingLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
- latencyNames = fieldnames(latency);
- for l = 1:length(latencyNames)
- if contains(latencyNames{l},'tone')
- LatencyPerSession{i}.(genotypes{g}).(sex{s}).(latencyNames{l}) = ...
- nan(size(latency.(latencyNames{l}),1),sum(strcmp(genotypePerMouse,genotypes{g})));
- end
- end
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).all = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).avoid = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).escape = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).stay = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
- end
- else
- PercPerSession.(genotypes{g}).(sex{s}).Avoidance = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- PercPerSession.(genotypes{g}).(sex{s}).Escape = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- PercPerSession.(genotypes{g}).(sex{s}).Stay = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- medianAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- medianEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- medianFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- medianLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- SessionBaselineActivityPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- medianBaselineCrossingLatencyPerSession.(genotypes{g}).(sex{s}) = ...
- nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- latencyNames = fieldnames(latency);
- for l = 1:length(latencyNames)
- if contains(latencyNames{l},'tone')
- LatencyPerSession{i}.(genotypes{g}).(sex{s}).(latencyNames{l}) = ...
- nan(size(latency.(latencyNames{l}),1),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- end
- end
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).all = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).avoid = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).escape = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).stay = ...
- nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
- & strcmp(sexPerMouse,sex{s})));
- end
- end
- end
- end
- end
- else
- [All_sessions_summary_tab] = vertcat(All_sessions_summary_tab,SessionTab);
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- All_sessions_Stim_Data.(baselining{b}) = [All_sessions_Stim_Data.(baselining{b});...
- Stim_data.(baselining{b})];
- end
- end
- for specificSex = 1
- PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Avoidance(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- PercAvoidance;
- PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Escape(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- PercEscape;
- PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Stay(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- PercStay;
- meanAvoidanceLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean_AvoidanceLatency;
- meanEscapeLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean_EscapeLatency;
- meanFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean_FirstCrossingDirectedMoveLatency;
- meanLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean_LastCrossingDirectedMoveLatency;
- medianAvoidanceLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- median_AvoidanceLatency;
- medianEscapeLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- median_EscapeLatency;
- medianFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- median_FirstCrossingDirectedMoveLatency;
- medianLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- median_LastCrossingDirectedMoveLatency;
- SessionBaselineActivityPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- SessionbaselineActivity;
- medianBaselineCrossingLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- median_Baseline_crossingLatency;
- latencyNames = fieldnames(latency);
- for l = 1:length(latencyNames)
- if contains(latencyNames{l},'tone')
- LatencyPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(latencyNames{l})(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- latency.(latencyNames{l});
- end
- end
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).all(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean(Stim_data.(baselining{b}),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).avoid(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isAvoid),:),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).escape(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isEscape),:),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).stay(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isStay),:),1,'omitnan')';
- end
- end
- for all = 1
- PercPerSession.(genotypePerMouse{m}).all.Avoidance(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- PercAvoidance;
- PercPerSession.(genotypePerMouse{m}).all.Escape(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- PercEscape;
- PercPerSession.(genotypePerMouse{m}).all.Stay(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- PercStay;
- meanAvoidanceLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean_AvoidanceLatency;
- meanEscapeLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean_EscapeLatency;
- meanFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean_FirstCrossingDirectedMoveLatency;
- meanLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean_LastCrossingDirectedMoveLatency;
- medianAvoidanceLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- median_AvoidanceLatency;
- medianEscapeLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- median_EscapeLatency;
- medianFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- median_FirstCrossingDirectedMoveLatency;
- medianLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- median_LastCrossingDirectedMoveLatency;
- SessionBaselineActivityPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- SessionbaselineActivity;
- medianBaselineCrossingLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
- median_Baseline_crossingLatency;
- latencyNames = fieldnames(latency);
- for l = 1:length(latencyNames)
- if contains(latencyNames{l},'tone')
- LatencyPerSession{i}.(genotypePerMouse{m}).all.(latencyNames{l})(:,countpergenotype.(genotypePerMouse{m}).all) = ...
- latency.(latencyNames{l});
- end
- end
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).all(:,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean(Stim_data.(baselining{b}),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).avoid(:,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isAvoid),:),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).escape(:,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isEscape),:),1,'omitnan')';
- meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).stay(:,countpergenotype.(genotypePerMouse{m}).all) = ...
- mean(Stim_data.(baselining{b})(logical(SessionTab.isStay),:),1,'omitnan')';
- end
- end
- end
- end
- if exist('All_sessions_summary_tab','var') == 1
- save([Path2savingfolder,'All_sessions_summary_tab.mat'],'All_sessions_summary_tab')
- end
- if exist('All_sessions_Stim_data','var') == 1
- FPmice = FPmice + 1;
- save([Path2savingfolder,'All_sessions_Stim_data.mat'],'All_sessions_Stim_Data','t_trials')
- end
- if m == 1
- AllMiceTab = All_sessions_summary_tab;
- AllMiceStimData = All_sessions_Stim_Data;
- else
- [AllMiceTab] = vertcat(AllMiceTab,All_sessions_summary_tab);
- baselining = fieldnames(Stim_data);
- for b = 1:length(baselining)
- AllMiceStimData.(baselining{b}) = [AllMiceStimData.(baselining{b});...
- All_sessions_Stim_Data.(baselining{b})];
- end
- end
- end
- end
- %% Plot figures
- %%% Plot latencies across trials
- for i = 1:size(LatencyPerSession,1)
- % Plot latencies to crossing to opposite chamber after CS onset per trial
- figure
- if show_plot == 0
- set(gcf,'visible','off')
- end
- subplot(2,1,1)
- hold on
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing,2,'omitnan');
- Y = std(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing,1,2,'omitnan')./...
- sqrt(sum(~isnan(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:N_trials,X,Y,'r',0.25)
- else
- error_area(1:N_trials,X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:N_trials,X,Y,'b',0.25)
- else
- error_area(1:N_trials,X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- xlabel('Trial Number')
- ylabel('Latency to cross (s)')
- title(['Mean Latency to crossing per trial Session ',num2str(i)])
- % Plot latencies to the moveent leading to crossing to opposite chamber after CS onset per trial
- subplot(2,1,2)
- hold on
- for g= 1:length(genotypes)
- for s = 1:2
- X = mean(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove,2,'omitnan');
- Y = std(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove,1,2,'omitnan')./...
- sqrt(sum(~isnan(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:N_trials,X,Y,'r',0.25)
- else
- error_area(1:N_trials,X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:N_trials,X,Y,'b',0.25)
- else
- error_area(1:N_trials,X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- xlabel('Trial Number')
- ylabel('Latency to crossing movement onset (s)')
- title(['Mean Latency to crossing movement onset per trial Session ',num2str(i)])
- end
- %%% Plot movement aligned to CS onset
- trial_types = fieldnames(meanStimDataPerSession{1}.(genotypes{1}).(sex{1}).(baselining{1}));
- for i = 1:size(meanStimDataPerSession,1)
- for b = 1:length(baselining)
- figure
- if show_plot == 0
- set(gcf,'visible','off')
- end
- for ttype = 1:length(trial_types)
- subplot(2,2,ttype)
- hold on
- for g= 1:length(genotypes)
- for s = 1:2
- X = mean(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype}),2,'omitnan');
- Y = std(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype}),1,2,'omitnan')./...
- sqrt(sum(~isnan(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype})),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(t_trials,X,Y,'r',0.25)
- else
- error_area(t_trials,X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(t_trials,X,Y,'b',0.25)
- else
- error_area(t_trials,X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- xlabel('Time (s)')
- xlim([-5 12])
- ylim([-5 20])
- ylabel('Average BeamBreakPerSec')
- xline(0,'k')
- xline(7,'m')
- title([trial_types{ttype},' trials'])
- end
- sgt = sgtitle(['Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i)]);
- sgt.FontSize = 12;
- if save_plot
- saveas(gcf,[PATH2RESULTS,'Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i),'.png'])
- saveas(gcf,[PATH2RESULTS,'Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i),'.fig'])
- end
- end
- end
- %%% Plot percentage of avoidance or escape across sessions
- % Per genotype and sex
- figure
- if show_plot == 0
- set(gcf,'visible','off')
- end
- hold on
- subplot(2,1,1)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(PercPerSession.(genotypes{g}).(sex{s}).Avoidance,2,'omitnan');
- Y = std(PercPerSession.(genotypes{g}).(sex{s}).Avoidance,1,2,'omitnan')./...
- sqrt(sum(~isnan(PercPerSession.(genotypes{g}).(sex{s}).Avoidance),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'b',0.25)
- else
- error_area(1:size(X,1),X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- ylim([0 100])
- xlabel('Session Number')
- ylabel('Percentage of avoidance')
- subplot(2,1,2)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(PercPerSession.(genotypes{g}).(sex{s}).Escape,2,'omitnan');
- Y = std(PercPerSession.(genotypes{g}).(sex{s}).Escape,1,2,'omitnan')./...
- sqrt(sum(~isnan(PercPerSession.(genotypes{g}).(sex{s}).Escape),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'b',0.25)
- else
- error_area(1:size(X,1),X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- ylim([0 100])
- xlabel('Session Number')
- ylabel('Percentage of escape')
- % Per genotype
- figure
- if show_plot == 0
- set(gcf,'visible','off')
- end
- hold on
- subplot(2,1,1)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(PercPerSession.(genotypes{g}).all.Avoidance,2,'omitnan');
- Y = std(PercPerSession.(genotypes{g}).all.Avoidance,1,2,'omitnan')./...
- sqrt(sum(~isnan(PercPerSession.(genotypes{g}).all.Avoidance),2));
- if strcmp(genotypes{g},'KO')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'b',0.25)
- end
- end
- end
- box off
- ylim([0 100])
- xlabel('Session Number')
- ylabel('Percentage of avoidance')
- subplot(2,1,2)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(PercPerSession.(genotypes{g}).all.Escape,2,'omitnan');
- Y = std(PercPerSession.(genotypes{g}).all.Escape,1,2,'omitnan')./...
- sqrt(sum(~isnan(PercPerSession.(genotypes{g}).all.Escape),2));
- if strcmp(genotypes{g},'KO')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'b',0.25)
- end
- end
- end
- box off
- ylim([0 100])
- xlabel('Session Number')
- ylabel('Percentage of escape')
- %%% Plot mean latency to avoidance or escape across sessions
- % Per genotype and sex
- figure
- if show_plot == 0
- set(gcf,'visible','off')
- end
- hold on
- subplot(2,1,1)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}),2,'omitnan');
- Y = std(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}),1,2,'omitnan')./...
- sqrt(sum(~isnan(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s})),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'b',0.25)
- else
- error_area(1:size(X,1),X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- xlabel('Session Number')
- ylabel('Mean latency to avoid')
- subplot(2,1,2)
- for g = 1:length(genotypes)
- for s = 1:2
- X = mean(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}),2,'omitnan');
- Y = std(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}),1,2,'omitnan')./...
- sqrt(sum(~isnan(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s})),2));
- if strcmp(genotypes{g},'KO')
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'r',0.25)
- else
- error_area(1:size(X,1),X,Y,'m',0.25)
- end
- else
- if strcmp(sex{s},'F')
- error_area(1:size(X,1),X,Y,'b',0.25)
- else
- error_area(1:size(X,1),X,Y,'c',0.25)
- end
- end
- end
- end
- box off
- xlabel('Session Number')
- ylabel('Mean latency to escape')
- %% Save data
- if contains(PATH2RESULTS,'\')
- save([PATH2RESULTS,'\All_mice_summary_tab.mat'],'AllMiceTab')
- if exist('AllMice_Stim_data','var') == 1
- save([PATH2RESULTS,'\AllMice_Stim_data.mat'],'AllMice_Stim_data','AllMice_zscore_Stim_data','t_trials','-v7.3')
- end
- else
- save([PATH2RESULTS,'/All_mice_summary_tab.mat'],'AllMiceTab')
- if exist('AllMice_Stim_data','var') == 1
- save([PATH2RESULTS,'/AllMice_Stim_data.mat'],'AllMice_Stim_data','AllMice_zscore_Stim_data','t_trials', '-v7.3')
- end
- end
Group_session_behav_analysis_table.m at commit 59e2555, under MIT · at the source
Overview
- Department of Pharmacology, University of Colorado School of Medicine, Anschutz Medical Campus, Aurora, CO 80045, USA
- Howard Hughes Medical Institute, Janelia Research Campus, Ashburn, VA 20147, USA
- Department of Psychiatry, Columbia University Vagelos College of Physicians & Surgeons, New York, NY 10032, USA
- Division of Molecular Therapeutics, New York State Psychiatric Institute, New York, NY 10032, USA
- Barnard College of Columbia University, New York, NY 10032, USA
- Department of Molecular Pharmacology and Therapeutics, Columbia University Vagelos College of Physicians & Surgeons, New York, NY 10032, USA
Abstract
Dopamine D2 receptors (D2Rs) modulate reward learning and aversive behaviors, with dysfunction linked to addiction and psychiatric disorders. D2Rs regulate behavior through modulation of striatal glutamatergic transmission, yet how D2Rs control postsynaptic glutamate signaling remains poorly understood. Using molecular tools to selectively disrupt heteromeric interactions while preserving canonical signaling, we show that physical coupling between D2Rs and GluN2B-containing N-methyl-d-aspartate (NMDA) receptors in nucleus accumbens medium spiny neurons enables D2Rs to suppress NMDA receptor function independent of canonical G protein and arrestin signaling. This modulation was input specific, occurred at thalamic but not cortical synapses converging on the same neurons, constrained long-term potentiation, and, within the medial ventral nucleus accumbens, facilitated aversive learning. These findings reveal that D2Rs can bypass second messenger systems to tune glutamatergic transmission through receptor-receptor interactions, providing a mechanism by which dopamine selectively gates specific glutamatergic inputs to control striatal plasticity and behavioral adaptation.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
Zenodo 19076090
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
10 files
- Arturo_SAA Matlab Analysis Codes/
Full_pipeline_SSA_analys — MATLAB, 30 linesis.m - Arturo_SAA Matlab Analysis Codes/
Group_session_behav_anal — MATLAB, 613 linesysis_table.m - Arturo_SAA Matlab Analysis Codes/
Loop_extraction_behav_da — MATLAB, 86 linesta.m - Arturo_SAA Matlab Analysis Codes/
Loop_individual_sessions — MATLAB, 91 lines.m - Arturo_SAA Matlab Analysis Codes/
analyze_from_group_table — MATLAB, 144 lines.m - Arturo_SAA Matlab Analysis Codes/
error_area.m — MATLAB, 38 lines - Arturo_SAA Matlab Analysis Codes/
getintensities_Arturo.m — MATLAB, 55 lines - Arturo_SAA Matlab Analysis Codes/
getrawdata100ths.m — MATLAB, 141 lines - Arturo_SAA Matlab Analysis Codes/
individual_behav_session — MATLAB, 581 lines_analysis.m - LICENSE — License, 21 lines
fordlab/d2-glun2b-paper
59e25559529e22b9de9ed527c90a1ab7e806692a, 17 March 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
10 files
- Arturo_SAA Matlab Analysis Codes/
Full_pipeline_SSA_analys — MATLAB, 30 linesis.m - Arturo_SAA Matlab Analysis Codes/
Group_session_behav_anal — MATLAB, 613 lines, 1 matchysis_table.m - Arturo_SAA Matlab Analysis Codes/
Loop_extraction_behav_da — MATLAB, 86 linesta.m - Arturo_SAA Matlab Analysis Codes/
Loop_individual_sessions — MATLAB, 91 lines.m - Arturo_SAA Matlab Analysis Codes/
analyze_from_group_table — MATLAB, 144 lines.m - Arturo_SAA Matlab Analysis Codes/
error_area.m — MATLAB, 38 lines - Arturo_SAA Matlab Analysis Codes/
getintensities_Arturo.m — MATLAB, 55 lines - Arturo_SAA Matlab Analysis Codes/
getrawdata100ths.m — MATLAB, 141 lines - Arturo_SAA Matlab Analysis Codes/
individual_behav_session — MATLAB, 581 lines_analysis.m - LICENSE — License, 21 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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 18 scripts, each with its path and the digest of its content;
- 1 match 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, code, and materials availability
All data and code needed to evaluate and reproduce the results in the paper are present in the paper and/
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 12 MeSH terms, 3 funders, 135 references.
Cite
This paper
Gong, S., Adler, J., Zhu, Y., Szeto, C., Lin, L., Rauffenbart, C., Torres-Herraez, A., Asher, W. B., Javitch, J. A., & Ford, C. P. (2026). Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning. Science advances, 12(30), eaee6579. https://
BibTeX
@article{gong2026dopamin
author = {Gong, Sheng and Adler, Joy and Zhu, Ying and Szeto, Charlize and Lin, Lisa and Rauffenbart, Caroline and Torres-Herraez, Arturo and Asher, Wesley B. and Javitch, Jonathan A. and Ford, Christopher P.},
title = {{Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning}},
journal = {Science advances},
year = {2026},
month = jul,
volume = {12},
number = {30},
pages = {eaee6579},
publisher = {American Association for the Advancement of Science},
issn = {2375-2548},
doi = {10.1126/
url = {https://
pmid = {42490424},
pmcid = {PMC13394467}
}
RIS
TY - JOUR
AU - Gong, Sheng
AU - Adler, Joy
AU - Zhu, Ying
AU - Szeto, Charlize
AU - Lin, Lisa
AU - Rauffenbart, Caroline
AU - Torres-Herraez, Arturo
AU - Asher, Wesley B.
AU - Javitch, Jonathan A.
AU - Ford, Christopher P.
TI - Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning
T2 - Science advances
J2 - Sci Adv
PY - 2026
DA - 2026/
VL - 12
IS - 30
SP - eaee6579
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1126/
"type": "article-journal",
"title": "Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning",
"container-title": "Science advances",
"author": [
{
"family": "Gong",
"given": "Sheng"
},
{
"family": "Adler",
"given": "Joy"
},
{
"family": "Zhu",
"given": "Ying"
},
{
"family": "Szeto",
"given": "Charlize"
},
{
"family": "Lin",
"given": "Lisa"
},
{
"family": "Rauffenbart",
"given": "Caroline"
},
{
"family": "Torres-Herraez",
"given": "Arturo"
},
{
"family": "Asher",
"given": "Wesley B."
},
{
"family": "Javitch",
"given": "Jonathan A."
},
{
"family": "Ford",
"given": "Christopher P."
}
],
"container-title-short":
"volume": "12",
"issue": "30",
"page": "eaee6579",
"DOI": "10.1126/
"PMID": "42490424",
"PMCID": "PMC13394467",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
23
]
]
}
}
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.117278
- Altered striatal long-term potentiation in the eIF4E-TG mouse model of autism spectrum disorder.Journal: iScienceIn common: mouse, cellular / molecular, 7 references
- [2] doi:10.1038/s41467-026-73906-3 [code]
- A synaptic mechanism for encoding the learned value of action-derived safety.Journal: Nature communicationsIn common: mouse, cellular / molecular, 6 references
- [3] doi:10.1016/j.isci.2026.116598
- Complementary δ2-protocadherin expression delineates parallel basal ganglia circuits in primates.Journal: iScienceIn common: 5 references
- [4] doi:10.1016/j.isci.2026.117130 [code]
- Region-specific weighting of sensory intensity and reward prediction error by dopamine signals.Journal: iScienceIn common: 5 references
- [5] doi:10.1126/sciadv.aee3529 [code]
- Learning dynamically regulates stimulus discrimination of ventral striatal D1 receptor expressing neurons.Journal: Science advancesIn common: mouse, cellular / molecular, 4 references
- [6] doi:10.1038/s41467-026-77168-x [code]
- Cholinergic-dependent dopamine signals in mouse dorsomedial striatum are regulated by frontal but not sensory cortices.Journal: Nature communicationsIn common: mouse, 4 references
- [7] doi:10.1016/j.isci.2026.115789
- Noise-evoked dopamine dynamics in the nucleus accumbens and tail of the striatum.Journal: iScienceIn common: cellular / molecular, 4 references
- [8] doi:10.1016/j.celrep.2026.117298 [code]
- Midbrain endocannabinoids actuate dopamine-based action selection.Journal: Cell reportsIn common: mouse, cellular / molecular, 3 references
- [9] doi:10.1126/sciadv.aeb5352 [code]
- Indirect pathway neurons in the tail of the striatum regulate inhibitory control over sensory driven behavior.Journal: Science advancesIn common: mouse, 3 references
- [10] doi:10.1038/s41467-026-73994-1 [code]
- Prediction error correlates in the striosome-dopamine circuit emerge from information gain.Journal: Nature communicationsIn common: 3 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: 2 repositories of the authors' code, each at its verified commit and with its license, 18 scripts, and 1 match 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:8da80dbfdfd2c613…
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
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: 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.
