OSCR

Dopamine D2 receptors bypass canonical signaling to directly tune NMDA receptor function and aversive learning.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 1 match
  1. [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

  1. function Group_session_behav_analysis_table(PATH2RESULTS,show_plot,save_plot,reanalysis,overwrite)
  2. % Created by Arturo Torres Herraez in 2025
  3. % The program sumarize the results in a table in which each row is a trial
  4. % and the different columns contain the information regarding identity of
  5. % the animal, the genotype, the sex, the session, the trials number, the latencies,
  6. % and the outcome of the trial. It also generate diverse plots summarizing
  7. % the results
  8. if contains(PATH2RESULTS,'\')
  9. connector = '\';
  10. else
  11. connector = '/';
  12. end
  13. PATH2RESULTS = [PATH2RESULTS,connector];
  14. mice2analyze = dir(PATH2RESULTS);
  15. for m = length(mice2analyze):-1:1
  16. if mice2analyze(m).isdir == 0 || strcmp(mice2analyze(m).name(1),'.') == 1
  17. mice2analyze(m) = [];
  18. end
  19. end
  20. genotypePerMouse = cell(length(mice2analyze),1);
  21. sexPerMouse = cell(length(mice2analyze),1);
  22. for i = length(mice2analyze):-1:1
  23. if strcmp(mice2analyze(i).name,'.') == 1 || strcmp(mice2analyze(i).name,'..') == 1 ...
  24. || mice2analyze(i).isdir == 0
  25. mice2analyze(i) = [];
  26. genotypePerMouse(i) = [];
  27. sexPerMouse(i) = [];
  28. else
  29. tmp = split(mice2analyze(i).name);
  30. genotypePerMouse{i} = tmp{2};
  31. sexPerMouse{i} = tmp{3};
  32. end
  33. end
  34. Nmice = length(mice2analyze);
  35. genotypes = unique(genotypePerMouse);
  36. sex = unique(sexPerMouse);
  37. sex{length(sex)+1,1} = 'all';
  38. for g = 1:length(genotypes)
  39. countpergenotype.(genotypes{g}).all = 0;
  40. for s = 1:length(sex)-1
  41. countpergenotype.(genotypes{g}).(sex{s}) = 0;
  42. end
  43. end
  44. for m = 1:Nmice
  45. countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m}) = ...
  46. countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})+1;
  47. countpergenotype.(genotypePerMouse{m}).all = countpergenotype.(genotypePerMouse{m}).all + 1;
  48. % Create a folder to save the data for this mouse and define the path
  49. Path2savingfolder = strcat(PATH2RESULTS,connector,mice2analyze(m).name,connector);
  50. if exist(strcat(Path2savingfolder,'All_sessions_behavior.mat'),'file') == 0
  51. done = 0;
  52. else
  53. done = 1;
  54. end
  55. if done == 0 || reanalysis == 1
  56. % Find sessions to analyze
  57. path2sessions = [PATH2RESULTS,connector,mice2analyze(m).name];
  58. sessions2analyze = dir(path2sessions);
  59. for i = length(sessions2analyze):-1:1
  60. if strcmp(sessions2analyze(i).name,'.') == 1 ...
  61. || strcmp(sessions2analyze(i).name,'..') == 1 ...
  62. || sessions2analyze(i).isdir == 0
  63. sessions2analyze(i) = [];
  64. end
  65. end
  66. sessionIdx = nan(length(sessions2analyze),1);
  67. for i = 1:length(sessions2analyze)
  68. idx = split(sessions2analyze(i).name,'_');
  69. sessionIdx(i) = str2double(idx{1});
  70. end
  71. count = 0;
  72. for i = 1:length(sessions2analyze)
  73. folder_name = [path2sessions,connector,sessions2analyze(i).name,connector];
  74. % Load behavior data
  75. if exist([folder_name,'Behavioral_results.mat'],'file') == 2
  76. load([folder_name,'Behavioral_results.mat'])
  77. count = count + 1;
  78. if count == 1
  79. All_sessions_summary_tab = SessionTab;
  80. All_sessions_Stim_Data = Stim_data;
  81. if m == 1
  82. LatencyPerSession = cell(length(sessions2analyze),1);
  83. meanStimDataPerSession = cell(length(sessions2analyze),1);
  84. for g = 1:length(genotypes)
  85. for s = 1:length(sex)
  86. if strcmp(sex{s},'All')
  87. PercPerSession.(genotypes{g}).(sex{s}).Avoidance = ...
  88. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  89. PercPerSession.(genotypes{g}).(sex{s}).Escape = ...
  90. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  91. PercPerSession.(genotypes{g}).(sex{s}).Stay = ...
  92. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  93. meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  94. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  95. meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  96. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  97. meanFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  98. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  99. meanLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  100. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  101. medianAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  102. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  103. medianEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  104. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  105. medianFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  106. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  107. medianLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  108. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  109. SessionBaselineActivityPerSession.(genotypes{g}).(sex{s}) = ...
  110. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  111. medianBaselineCrossingLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  112. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})));
  113. latencyNames = fieldnames(latency);
  114. for l = 1:length(latencyNames)
  115. if contains(latencyNames{l},'tone')
  116. LatencyPerSession{i}.(genotypes{g}).(sex{s}).(latencyNames{l}) = ...
  117. nan(size(latency.(latencyNames{l}),1),sum(strcmp(genotypePerMouse,genotypes{g})));
  118. end
  119. end
  120. baselining = fieldnames(Stim_data);
  121. for b = 1:length(baselining)
  122. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).all = ...
  123. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
  124. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).avoid = ...
  125. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
  126. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).escape = ...
  127. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
  128. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).stay = ...
  129. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})));
  130. end
  131. else
  132. PercPerSession.(genotypes{g}).(sex{s}).Avoidance = ...
  133. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  134. & strcmp(sexPerMouse,sex{s})));
  135. PercPerSession.(genotypes{g}).(sex{s}).Escape = ...
  136. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  137. & strcmp(sexPerMouse,sex{s})));
  138. PercPerSession.(genotypes{g}).(sex{s}).Stay = ...
  139. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  140. & strcmp(sexPerMouse,sex{s})));
  141. meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  142. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  143. & strcmp(sexPerMouse,sex{s})));
  144. meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  145. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  146. & strcmp(sexPerMouse,sex{s})));
  147. meanFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  148. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  149. & strcmp(sexPerMouse,sex{s})));
  150. meanLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  151. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  152. & strcmp(sexPerMouse,sex{s})));
  153. medianAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  154. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  155. & strcmp(sexPerMouse,sex{s})));
  156. medianEscapeLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  157. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  158. & strcmp(sexPerMouse,sex{s})));
  159. medianFirstCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  160. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  161. & strcmp(sexPerMouse,sex{s})));
  162. medianLastCrossingDirectedMoveLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  163. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  164. & strcmp(sexPerMouse,sex{s})));
  165. SessionBaselineActivityPerSession.(genotypes{g}).(sex{s}) = ...
  166. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  167. & strcmp(sexPerMouse,sex{s})));
  168. medianBaselineCrossingLatencyPerSession.(genotypes{g}).(sex{s}) = ...
  169. nan(length(sessions2analyze),sum(strcmp(genotypePerMouse,genotypes{g})...
  170. & strcmp(sexPerMouse,sex{s})));
  171. latencyNames = fieldnames(latency);
  172. for l = 1:length(latencyNames)
  173. if contains(latencyNames{l},'tone')
  174. LatencyPerSession{i}.(genotypes{g}).(sex{s}).(latencyNames{l}) = ...
  175. nan(size(latency.(latencyNames{l}),1),sum(strcmp(genotypePerMouse,genotypes{g})...
  176. & strcmp(sexPerMouse,sex{s})));
  177. end
  178. end
  179. baselining = fieldnames(Stim_data);
  180. for b = 1:length(baselining)
  181. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).all = ...
  182. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
  183. & strcmp(sexPerMouse,sex{s})));
  184. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).avoid = ...
  185. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
  186. & strcmp(sexPerMouse,sex{s})));
  187. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).escape = ...
  188. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
  189. & strcmp(sexPerMouse,sex{s})));
  190. meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).stay = ...
  191. nan(length(t_trials),sum(strcmp(genotypePerMouse,genotypes{g})...
  192. & strcmp(sexPerMouse,sex{s})));
  193. end
  194. end
  195. end
  196. end
  197. end
  198. else
  199. [All_sessions_summary_tab] = vertcat(All_sessions_summary_tab,SessionTab);
  200. baselining = fieldnames(Stim_data);
  201. for b = 1:length(baselining)
  202. All_sessions_Stim_Data.(baselining{b}) = [All_sessions_Stim_Data.(baselining{b});...
  203. Stim_data.(baselining{b})];
  204. end
  205. end
  206. for specificSex = 1
  207. PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Avoidance(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  208. PercAvoidance;
  209. PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Escape(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  210. PercEscape;
  211. PercPerSession.(genotypePerMouse{m}).(sexPerMouse{m}).Stay(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  212. PercStay;
  213. meanAvoidanceLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  214. mean_AvoidanceLatency;
  215. meanEscapeLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  216. mean_EscapeLatency;
  217. meanFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  218. mean_FirstCrossingDirectedMoveLatency;
  219. meanLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  220. mean_LastCrossingDirectedMoveLatency;
  221. medianAvoidanceLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  222. median_AvoidanceLatency;
  223. medianEscapeLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  224. median_EscapeLatency;
  225. medianFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  226. median_FirstCrossingDirectedMoveLatency;
  227. medianLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  228. median_LastCrossingDirectedMoveLatency;
  229. SessionBaselineActivityPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  230. SessionbaselineActivity;
  231. medianBaselineCrossingLatencyPerSession.(genotypePerMouse{m}).(sexPerMouse{m})(i,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  232. median_Baseline_crossingLatency;
  233. latencyNames = fieldnames(latency);
  234. for l = 1:length(latencyNames)
  235. if contains(latencyNames{l},'tone')
  236. LatencyPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(latencyNames{l})(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  237. latency.(latencyNames{l});
  238. end
  239. end
  240. baselining = fieldnames(Stim_data);
  241. for b = 1:length(baselining)
  242. meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).all(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  243. mean(Stim_data.(baselining{b}),1,'omitnan')';
  244. meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).avoid(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  245. mean(Stim_data.(baselining{b})(logical(SessionTab.isAvoid),:),1,'omitnan')';
  246. meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).escape(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  247. mean(Stim_data.(baselining{b})(logical(SessionTab.isEscape),:),1,'omitnan')';
  248. meanStimDataPerSession{i}.(genotypePerMouse{m}).(sexPerMouse{m}).(baselining{b}).stay(:,countpergenotype.(genotypePerMouse{m}).(sexPerMouse{m})) = ...
  249. mean(Stim_data.(baselining{b})(logical(SessionTab.isStay),:),1,'omitnan')';
  250. end
  251. end
  252. for all = 1
  253. PercPerSession.(genotypePerMouse{m}).all.Avoidance(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  254. PercAvoidance;
  255. PercPerSession.(genotypePerMouse{m}).all.Escape(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  256. PercEscape;
  257. PercPerSession.(genotypePerMouse{m}).all.Stay(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  258. PercStay;
  259. meanAvoidanceLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  260. mean_AvoidanceLatency;
  261. meanEscapeLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  262. mean_EscapeLatency;
  263. meanFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  264. mean_FirstCrossingDirectedMoveLatency;
  265. meanLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  266. mean_LastCrossingDirectedMoveLatency;
  267. medianAvoidanceLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  268. median_AvoidanceLatency;
  269. medianEscapeLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  270. median_EscapeLatency;
  271. medianFirstCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  272. median_FirstCrossingDirectedMoveLatency;
  273. medianLastCrossingDirectedMoveLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  274. median_LastCrossingDirectedMoveLatency;
  275. SessionBaselineActivityPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  276. SessionbaselineActivity;
  277. medianBaselineCrossingLatencyPerSession.(genotypePerMouse{m}).all(i,countpergenotype.(genotypePerMouse{m}).all) = ...
  278. median_Baseline_crossingLatency;
  279. latencyNames = fieldnames(latency);
  280. for l = 1:length(latencyNames)
  281. if contains(latencyNames{l},'tone')
  282. LatencyPerSession{i}.(genotypePerMouse{m}).all.(latencyNames{l})(:,countpergenotype.(genotypePerMouse{m}).all) = ...
  283. latency.(latencyNames{l});
  284. end
  285. end
  286. baselining = fieldnames(Stim_data);
  287. for b = 1:length(baselining)
  288. meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).all(:,countpergenotype.(genotypePerMouse{m}).all) = ...
  289. mean(Stim_data.(baselining{b}),1,'omitnan')';
  290. meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).avoid(:,countpergenotype.(genotypePerMouse{m}).all) = ...
  291. mean(Stim_data.(baselining{b})(logical(SessionTab.isAvoid),:),1,'omitnan')';
  292. meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).escape(:,countpergenotype.(genotypePerMouse{m}).all) = ...
  293. mean(Stim_data.(baselining{b})(logical(SessionTab.isEscape),:),1,'omitnan')';
  294. meanStimDataPerSession{i}.(genotypePerMouse{m}).all.(baselining{b}).stay(:,countpergenotype.(genotypePerMouse{m}).all) = ...
  295. mean(Stim_data.(baselining{b})(logical(SessionTab.isStay),:),1,'omitnan')';
  296. end
  297. end
  298. end
  299. end
  300. if exist('All_sessions_summary_tab','var') == 1
  301. save([Path2savingfolder,'All_sessions_summary_tab.mat'],'All_sessions_summary_tab')
  302. end
  303. if exist('All_sessions_Stim_data','var') == 1
  304. FPmice = FPmice + 1;
  305. save([Path2savingfolder,'All_sessions_Stim_data.mat'],'All_sessions_Stim_Data','t_trials')
  306. end
  307. if m == 1
  308. AllMiceTab = All_sessions_summary_tab;
  309. AllMiceStimData = All_sessions_Stim_Data;
  310. else
  311. [AllMiceTab] = vertcat(AllMiceTab,All_sessions_summary_tab);
  312. baselining = fieldnames(Stim_data);
  313. for b = 1:length(baselining)
  314. AllMiceStimData.(baselining{b}) = [AllMiceStimData.(baselining{b});...
  315. All_sessions_Stim_Data.(baselining{b})];
  316. end
  317. end
  318. end
  319. end
  320. %% Plot figures
  321. %%% Plot latencies across trials
  322. for i = 1:size(LatencyPerSession,1)
  323. % Plot latencies to crossing to opposite chamber after CS onset per trial
  324. figure
  325. if show_plot == 0
  326. set(gcf,'visible','off')
  327. end
  328. subplot(2,1,1)
  329. hold on
  330. for g = 1:length(genotypes)
  331. for s = 1:2
  332. X = mean(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing,2,'omitnan');
  333. Y = std(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing,1,2,'omitnan')./...
  334. sqrt(sum(~isnan(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2crossing),2));
  335. if strcmp(genotypes{g},'KO')
  336. if strcmp(sex{s},'F')
  337. error_area(1:N_trials,X,Y,'r',0.25)
  338. else
  339. error_area(1:N_trials,X,Y,'m',0.25)
  340. end
  341. else
  342. if strcmp(sex{s},'F')
  343. error_area(1:N_trials,X,Y,'b',0.25)
  344. else
  345. error_area(1:N_trials,X,Y,'c',0.25)
  346. end
  347. end
  348. end
  349. end
  350. box off
  351. xlabel('Trial Number')
  352. ylabel('Latency to cross (s)')
  353. title(['Mean Latency to crossing per trial Session ',num2str(i)])
  354. % Plot latencies to the moveent leading to crossing to opposite chamber after CS onset per trial
  355. subplot(2,1,2)
  356. hold on
  357. for g= 1:length(genotypes)
  358. for s = 1:2
  359. X = mean(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove,2,'omitnan');
  360. Y = std(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove,1,2,'omitnan')./...
  361. sqrt(sum(~isnan(LatencyPerSession{i}.(genotypes{g}).(sex{s}).tone2LastCrossingDirectedMove),2));
  362. if strcmp(genotypes{g},'KO')
  363. if strcmp(sex{s},'F')
  364. error_area(1:N_trials,X,Y,'r',0.25)
  365. else
  366. error_area(1:N_trials,X,Y,'m',0.25)
  367. end
  368. else
  369. if strcmp(sex{s},'F')
  370. error_area(1:N_trials,X,Y,'b',0.25)
  371. else
  372. error_area(1:N_trials,X,Y,'c',0.25)
  373. end
  374. end
  375. end
  376. end
  377. box off
  378. xlabel('Trial Number')
  379. ylabel('Latency to crossing movement onset (s)')
  380. title(['Mean Latency to crossing movement onset per trial Session ',num2str(i)])
  381. end
  382. %%% Plot movement aligned to CS onset
  383. trial_types = fieldnames(meanStimDataPerSession{1}.(genotypes{1}).(sex{1}).(baselining{1}));
  384. for i = 1:size(meanStimDataPerSession,1)
  385. for b = 1:length(baselining)
  386. figure
  387. if show_plot == 0
  388. set(gcf,'visible','off')
  389. end
  390. for ttype = 1:length(trial_types)
  391. subplot(2,2,ttype)
  392. hold on
  393. for g= 1:length(genotypes)
  394. for s = 1:2
  395. X = mean(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype}),2,'omitnan');
  396. Y = std(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype}),1,2,'omitnan')./...
  397. sqrt(sum(~isnan(meanStimDataPerSession{i}.(genotypes{g}).(sex{s}).(baselining{b}).(trial_types{ttype})),2));
  398. if strcmp(genotypes{g},'KO')
  399. if strcmp(sex{s},'F')
  400. error_area(t_trials,X,Y,'r',0.25)
  401. else
  402. error_area(t_trials,X,Y,'m',0.25)
  403. end
  404. else
  405. if strcmp(sex{s},'F')
  406. error_area(t_trials,X,Y,'b',0.25)
  407. else
  408. error_area(t_trials,X,Y,'c',0.25)
  409. end
  410. end
  411. end
  412. end
  413. box off
  414. xlabel('Time (s)')
  415. xlim([-5 12])
  416. ylim([-5 20])
  417. ylabel('Average BeamBreakPerSec')
  418. xline(0,'k')
  419. xline(7,'m')
  420. title([trial_types{ttype},' trials'])
  421. end
  422. sgt = sgtitle(['Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i)]);
  423. sgt.FontSize = 12;
  424. if save_plot
  425. saveas(gcf,[PATH2RESULTS,'Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i),'.png'])
  426. saveas(gcf,[PATH2RESULTS,'Average BeamBreakPerSec ',baselining{b},' Session ',num2str(i),'.fig'])
  427. end
  428. end
  429. end
  430. %%% Plot percentage of avoidance or escape across sessions
  431. % Per genotype and sex
  432. figure
  433. if show_plot == 0
  434. set(gcf,'visible','off')
  435. end
  436. hold on
  437. subplot(2,1,1)
  438. for g = 1:length(genotypes)
  439. for s = 1:2
  440. X = mean(PercPerSession.(genotypes{g}).(sex{s}).Avoidance,2,'omitnan');
  441. Y = std(PercPerSession.(genotypes{g}).(sex{s}).Avoidance,1,2,'omitnan')./...
  442. sqrt(sum(~isnan(PercPerSession.(genotypes{g}).(sex{s}).Avoidance),2));
  443. if strcmp(genotypes{g},'KO')
  444. if strcmp(sex{s},'F')
  445. error_area(1:size(X,1),X,Y,'r',0.25)
  446. else
  447. error_area(1:size(X,1),X,Y,'m',0.25)
  448. end
  449. else
  450. if strcmp(sex{s},'F')
  451. error_area(1:size(X,1),X,Y,'b',0.25)
  452. else
  453. error_area(1:size(X,1),X,Y,'c',0.25)
  454. end
  455. end
  456. end
  457. end
  458. box off
  459. ylim([0 100])
  460. xlabel('Session Number')
  461. ylabel('Percentage of avoidance')
  462. subplot(2,1,2)
  463. for g = 1:length(genotypes)
  464. for s = 1:2
  465. X = mean(PercPerSession.(genotypes{g}).(sex{s}).Escape,2,'omitnan');
  466. Y = std(PercPerSession.(genotypes{g}).(sex{s}).Escape,1,2,'omitnan')./...
  467. sqrt(sum(~isnan(PercPerSession.(genotypes{g}).(sex{s}).Escape),2));
  468. if strcmp(genotypes{g},'KO')
  469. if strcmp(sex{s},'F')
  470. error_area(1:size(X,1),X,Y,'r',0.25)
  471. else
  472. error_area(1:size(X,1),X,Y,'m',0.25)
  473. end
  474. else
  475. if strcmp(sex{s},'F')
  476. error_area(1:size(X,1),X,Y,'b',0.25)
  477. else
  478. error_area(1:size(X,1),X,Y,'c',0.25)
  479. end
  480. end
  481. end
  482. end
  483. box off
  484. ylim([0 100])
  485. xlabel('Session Number')
  486. ylabel('Percentage of escape')
  487. % Per genotype
  488. figure
  489. if show_plot == 0
  490. set(gcf,'visible','off')
  491. end
  492. hold on
  493. subplot(2,1,1)
  494. for g = 1:length(genotypes)
  495. for s = 1:2
  496. X = mean(PercPerSession.(genotypes{g}).all.Avoidance,2,'omitnan');
  497. Y = std(PercPerSession.(genotypes{g}).all.Avoidance,1,2,'omitnan')./...
  498. sqrt(sum(~isnan(PercPerSession.(genotypes{g}).all.Avoidance),2));
  499. if strcmp(genotypes{g},'KO')
  500. error_area(1:size(X,1),X,Y,'r',0.25)
  501. else
  502. error_area(1:size(X,1),X,Y,'b',0.25)
  503. end
  504. end
  505. end
  506. box off
  507. ylim([0 100])
  508. xlabel('Session Number')
  509. ylabel('Percentage of avoidance')
  510. subplot(2,1,2)
  511. for g = 1:length(genotypes)
  512. for s = 1:2
  513. X = mean(PercPerSession.(genotypes{g}).all.Escape,2,'omitnan');
  514. Y = std(PercPerSession.(genotypes{g}).all.Escape,1,2,'omitnan')./...
  515. sqrt(sum(~isnan(PercPerSession.(genotypes{g}).all.Escape),2));
  516. if strcmp(genotypes{g},'KO')
  517. error_area(1:size(X,1),X,Y,'r',0.25)
  518. else
  519. error_area(1:size(X,1),X,Y,'b',0.25)
  520. end
  521. end
  522. end
  523. box off
  524. ylim([0 100])
  525. xlabel('Session Number')
  526. ylabel('Percentage of escape')
  527. %%% Plot mean latency to avoidance or escape across sessions
  528. % Per genotype and sex
  529. figure
  530. if show_plot == 0
  531. set(gcf,'visible','off')
  532. end
  533. hold on
  534. subplot(2,1,1)
  535. for g = 1:length(genotypes)
  536. for s = 1:2
  537. X = mean(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}),2,'omitnan');
  538. Y = std(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s}),1,2,'omitnan')./...
  539. sqrt(sum(~isnan(meanAvoidanceLatencyPerSession.(genotypes{g}).(sex{s})),2));
  540. if strcmp(genotypes{g},'KO')
  541. if strcmp(sex{s},'F')
  542. error_area(1:size(X,1),X,Y,'r',0.25)
  543. else
  544. error_area(1:size(X,1),X,Y,'m',0.25)
  545. end
  546. else
  547. if strcmp(sex{s},'F')
  548. error_area(1:size(X,1),X,Y,'b',0.25)
  549. else
  550. error_area(1:size(X,1),X,Y,'c',0.25)
  551. end
  552. end
  553. end
  554. end
  555. box off
  556. xlabel('Session Number')
  557. ylabel('Mean latency to avoid')
  558. subplot(2,1,2)
  559. for g = 1:length(genotypes)
  560. for s = 1:2
  561. X = mean(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}),2,'omitnan');
  562. Y = std(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s}),1,2,'omitnan')./...
  563. sqrt(sum(~isnan(meanEscapeLatencyPerSession.(genotypes{g}).(sex{s})),2));
  564. if strcmp(genotypes{g},'KO')
  565. if strcmp(sex{s},'F')
  566. error_area(1:size(X,1),X,Y,'r',0.25)
  567. else
  568. error_area(1:size(X,1),X,Y,'m',0.25)
  569. end
  570. else
  571. if strcmp(sex{s},'F')
  572. error_area(1:size(X,1),X,Y,'b',0.25)
  573. else
  574. error_area(1:size(X,1),X,Y,'c',0.25)
  575. end
  576. end
  577. end
  578. end
  579. box off
  580. xlabel('Session Number')
  581. ylabel('Mean latency to escape')
  582. %% Save data
  583. if contains(PATH2RESULTS,'\')
  584. save([PATH2RESULTS,'\All_mice_summary_tab.mat'],'AllMiceTab')
  585. if exist('AllMice_Stim_data','var') == 1
  586. save([PATH2RESULTS,'\AllMice_Stim_data.mat'],'AllMice_Stim_data','AllMice_zscore_Stim_data','t_trials','-v7.3')
  587. end
  588. else
  589. save([PATH2RESULTS,'/All_mice_summary_tab.mat'],'AllMiceTab')
  590. if exist('AllMice_Stim_data','var') == 1
  591. save([PATH2RESULTS,'/AllMice_Stim_data.mat'],'AllMice_Stim_data','AllMice_zscore_Stim_data','t_trials', '-v7.3')
  592. end
  593. end

Group_session_behav_analysis_table.m at commit 59e2555, under MIT · at the source

Overview

Authors: Sheng Gong1,2, Joy Adler1, Ying Zhu3,4, Charlize Szeto5, Lisa Lin3,4, Caroline Rauffenbart3,4, Arturo Torres-Herraez3,4, Wesley B. Asher3,4, Jonathan A. Javitch3,4,6, Christopher P. Ford1
  1. Department of Pharmacology, University of Colorado School of Medicine, Anschutz Medical Campus, Aurora, CO 80045, USA
  2. Howard Hughes Medical Institute, Janelia Research Campus, Ashburn, VA 20147, USA
  3. Department of Psychiatry, Columbia University Vagelos College of Physicians & Surgeons, New York, NY 10032, USA
  4. Division of Molecular Therapeutics, New York State Psychiatric Institute, New York, NY 10032, USA
  5. Barnard College of Columbia University, New York, NY 10032, USA
  6. Department of Molecular Pharmacology and Therapeutics, Columbia University Vagelos College of Physicians & Surgeons, New York, NY 10032, USA
Institutions: Howard Hughes Medical Institute (United States); Janelia Research Campus (United States); University of Colorado Anschutz (United States); New York State Psychiatric Institute; Columbia University (United States); Barnard College (United States)
Journal: Science advances, volume 12, issue 30, article eaee6579
Dates: received 10 December 2025; accepted 16 June 2026; published online 23 July 2026; in print July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1126/sciadv.aee6579 · PMID 42490424 · PMCID PMC13394467 · OpenAlex W7170170769
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), cellular / molecular (subfield)
Methods: Statistics, Evoked potentials
MeSH: Learning*, Receptors, Dopamine D2*, Receptors, N-Methyl-D-Aspartate*, Signal Transduction*, Animals, Dopamine, Long-Term Potentiation, Medium Spiny Neurons, Mice, Nucleus Accumbens, Synapses, Synaptic Transmission (* major topic)
Journal subjects: Neuroscience, Neurophysiology
Topic: Neurotransmitter Receptor Influence on Behavior (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: National Institutes of Health (R01-DA35821, R01 MH054137, R01-NS95809, R01-NS138043, F31-DA64363); Hope for Depression Research Foundation; St. Jude Children's Research Hospital (GPCR Collaborative)
Citations: not cited yet (Europe PMC); 135 references in the paper

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

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data, code, and materials availability:”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
10 files

fordlab/d2-glun2b-paper

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 59e25559529e22b9de9ed527c90a1ab7e806692a, 17 March 2026
Languages: MATLAB (9)
Size: 12 files, 9 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: license file
Not found: README, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
10 files

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/or the Supplementary Materials. This study did not generate new materials. Code used for behavior analysis of Fig. 7 and fig. S5 can be found at DOI: 10.5281/zenodo.19076090 (http://dx.doi.org/10.5281/zenodo.19076090). The plasmids used to make the minigene, scramble, and dopamine receptor viral constructs can be provided by J.A.J. pending scientific review and a completed material transfer agreement through Columbia University. Requests should be submitted to .

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://doi.org/10.1126/sciadv.aee6579

BibTeX

@article{gong2026dopamine,
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/sciadv.aee6579},
url = {https://doi.org/10.1126/sciadv.aee6579},
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/07/23
VL - 12
IS - 30
SP - eaee6579
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/sciadv.aee6579
UR - https://doi.org/10.1126/sciadv.aee6579
LA - en
ER -

CSL-JSON

{
"id": "10.1126/sciadv.aee6579",
"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": "Sci Adv",
"volume": "12",
"issue": "30",
"page": "eaee6579",
"DOI": "10.1126/sciadv.aee6579",
"PMID": "42490424",
"PMCID": "PMC13394467",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://doi.org/10.1126/sciadv.aee6579",
"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: iScience
In 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 communications
In 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: iScience
In 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: iScience
In common: 5 references
[5] doi:10.1126/sciadv.aee3529 [code]
Learning dynamically regulates stimulus discrimination of ventral striatal D1 receptor expressing neurons.
Journal: Science advances
In 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 communications
In 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: iScience
In common: cellular / molecular, 4 references
[8] doi:10.1016/j.celrep.2026.117298 [code]
Midbrain endocannabinoids actuate dopamine-based action selection.
Journal: Cell reports
In 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 advances
In 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 communications
In 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.

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.