Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

MainFigures.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. %% Paper Figures
  2. % This script calls most others such that you can generate all main
  3. % figures by running it (excluding optogenetics experiments)
  4. %% Reset
  5. clearvars;
  6. close all;
  7. load ('RAWintBlocks.mat');
  8. load ('R_intBlocks.mat');
  9. load ('RAWCued');
  10. load ('R_cued_all');
  11. load ('RAWTH');
  12. load ('R_TH');
  13. load ('RewHist2R');
  14. load ('RewHistCued');
  15. load ('RewHistTH');
  16. load ('evolution_data.mat')
  17. load ('evolution_info.mat')
  18. Colors = load_colors();
  19. %% Behavior
  20. % Produces most of the behavior panels in the paper
  21. disp('Behavior')
  22. plot_sub_figures = true;
  23. perform_stats = true;
  24. plot_region = 'VP'; %'VP' 'NA' or 'Both'
  25. BehavStats=all_behavior(RAWblocks, RAWCued, plot_region, plot_sub_figures, perform_stats, Colors);
  26. %% Interspersed sucrose/maltodextrin
  27. plot_value=1;
  28. load_fits=1;
  29. if load_fits
  30. load ('intBlocks_MLEfits.mat');
  31. bm_RD=select_RPEmods(os, 'RD', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false);
  32. bm_RD_BIC=select_RPEmods(os, 'RD', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false,'scoretouse','BIC');
  33. bm_cue=select_RPEmods(os, 'cue', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false);
  34. end
  35. disp('First experiment figures')
  36. IntStats=plot_int(Colors, R_blocks, RewHist2R, bm_RD, RAWblocks, os, bm_cue, plot_value, bm_RD_BIC);
  37. %% Three rewards (sucrose/maltodextrin/water)
  38. load_fits=1;
  39. if load_fits
  40. load ('threeOutcomes_MLEfits.mat');
  41. bm_RD=select_RPEmods(os, 'RD', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false);
  42. bm_RD_BIC=select_RPEmods(os, 'RD', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false,'scoretouse','BIC');
  43. bm_cue=select_RPEmods(os, 'cue', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false);
  44. end
  45. plot_sub_figures = true;
  46. disp('Three outcomes figure')
  47. ThreeStats=plot_TH(Colors, R_TH, RewHistTH, bm_RD, bm_cue, RAWTH, os, plot_sub_figures, bm_RD_BIC);
  48. %% Blocks
  49. %blocks data
  50. disp('Blocks figure')
  51. plot_sub_figures = true;
  52. load_fits=1;
  53. if load_fits
  54. load ('intBlocks_MLEfits.mat');
  55. bm_RD=select_RPEmods(os, 'RD', 'particularModels', {'mean','curr','base'},'plotmodels_Flag',false);
  56. end
  57. selectivity_time_periods = [0, 1;-2.6, 0; 0.4, 3]; %seconds, cue, PE, RD
  58. R_blocks=plot_blocks(Colors, R_blocks, events, trial_info, plot_sub_figures ,bm_RD);
  59. %% Cued figure
  60. %summary of cue experiment
  61. disp('Cued figure')
  62. load_fits=1;
  63. if load_fits
  64. load ('cue_MLEfits.mat');
  65. bm_RD=select_RPEmods(os, 'RD', 'particularModels', {'mean','mean_cue','curr','curr_cue','base','base_cue'},'plotmodels_Flag',false);
  66. bm_cue=select_RPEmods(os, 'cue', 'particularModels', {'mean','mean_cue','base','base_cue'},'plotmodels_Flag',false);
  67. end
  68. ROI=[3 4 9 10];
  69. DOI=11:20;
  70. CuedStats=plot_cued(Colors, R_cued, RewHistCued, bm_RD, DOI, ROI, os, bm_cue, RAWCued);