figS6GHK.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. %% fig. S6G, H & K - Anticipatory Lick
  2. % Load necessary data for fig.S4E at first
  3. clear all
  4. close all
  5. % ==========================================================================
  6. %% Load data
  7. % ==========================================================================
  8. %Prepare variables
  9. load('figS6G.mat');
  10. load('figS6H.mat');
  11. load('figS6K.mat');
  12. % ==================================================================
  13. %% figS6G: Lick trial propotion
  14. % ==================================================================
  15. fig1 = figure('Name','NofLickHistogram_Hit');
  16. fig1.Position = [511 526 950 330];
  17. for iPhase = 1:4
  18. switch iPhase
  19. case 1
  20. subplot(1,2,iPhase);
  21. EColor = [0.75 0.75 0.75]; FColor = [0.75 0.75 0.75];
  22. case 2
  23. subplot(1,2,iPhase-1);
  24. EColor = 'r'; FColor = 'r';
  25. case 3
  26. subplot(1,2,iPhase-1);
  27. EColor = [0.75 0.75 0.75]; FColor = [0.75 0.75 0.75];
  28. case 4
  29. subplot(1,2,iPhase-2);
  30. EColor = 'r'; FColor = 'r';
  31. end
  32. %ALick_Proportion
  33. x = 1:1:size(ALick_Proportion{iPhase},2);
  34. h1 = bar(x, ALick_Proportion{iPhase}, 'EdgeColor', EColor, 'FaceColor', FColor);
  35. hold on;
  36. if (iPhase == 1 || iPhase == 3)
  37. xlim([-1 15]);
  38. xticks([1 6 11 16]);
  39. xticklabels({'0', '5', '10', '15'});
  40. ylim([0 1]);
  41. xlabel('N of Lick during delay (2.0 s)')
  42. end
  43. box off
  44. hold on
  45. end%iPhase
  46. suptitle('Hit trial Lick during delay - Mouse averaged - overlay')
  47. % ==================================================================
  48. %% figS6H: Lickprobability line plot
  49. % ==================================================================
  50. fig2 = figure('Name','HitLickProbability_MovAverage');
  51. TimeWinFrame = [-15:1:120]; %-0.5s to 4s after stimulus presentation
  52. fs = 30;
  53. for iPhase = 1:4
  54. switch iPhase
  55. case 1 %Initial Naive
  56. LineColor = 'k';
  57. subplot(1,2,1);
  58. case 2 %Initial Expert
  59. LineColor = 'r';
  60. subplot(1,2,1);
  61. ylabel('Lick probability in Hit trials (%)')
  62. title('Initial')
  63. case 3 %Reversal Naive
  64. LineColor = 'k';
  65. subplot(1,2,2);
  66. case 4 %Reversal Expert
  67. LineColor = 'r';
  68. subplot(1,2,2);
  69. ylabel('Lick probability in Hit trials (%)')
  70. title('Reversal')
  71. end%switch
  72. h2=shadedErrorBar(TimeWinFrame/fs, MeanLickProbability{iPhase}, SEMLickProbability{iPhase}, 'lineprops', LineColor);
  73. h2.mainLine.LineWidth = 1.5;
  74. hold on;
  75. set([h2.edge], 'Visible', 'off')
  76. h3 = legend({'Naive', 'Expert'});
  77. h3.AutoUpdate = 'off';
  78. legend boxoff
  79. xlim([-0.5 4.0])
  80. xticks([0 2 4]);
  81. ylim([0 20])
  82. yticks([0 10 20]);
  83. box off
  84. %saxis square
  85. end%iPhase
  86. suptitle('Lick probability in Hit trial');
  87. % =========================================================================
  88. %% figS6K - Anticipatory Lick freq per trial vs the proportion of ramp cell
  89. % =========================================================================
  90. figure('Name','AnticipatoryLick-vs-RamCells');
  91. fig3 = gcf;
  92. fig3.Position = [421 645 630 320];
  93. for iPhase = 1:2 %Only Expert phase
  94. switch iPhase
  95. case 1
  96. ProportionRampCell = ProportionRampCell_Ini;
  97. subplot(1,2,1);
  98. xrange = [0 5];
  99. xt = [0 1 2 3 4 5];
  100. GraphTitle = 'Initial Learning';
  101. case 2
  102. ProportionRampCell = ProportionRampCell_Rev;
  103. subplot(1,2,2);
  104. xrange = [0 5];
  105. xt = [0 1 2 3 4 5];
  106. GraphTitle = 'Reversal Learning';
  107. end%switch
  108. sz = 75;
  109. scatter(NofALick_per_Trial(:, iPhase), ProportionRampCell*100, sz, 'k');
  110. title(GraphTitle)
  111. axis square
  112. xlim(xrange);
  113. ylim([0 70]);
  114. box off
  115. xlabel('N of anticipatory licks during the delay')
  116. ylabel('Proportion of RampCells (%)')
  117. xticks(xt);
  118. yticks([0 35 70]);
  119. end
  120. suptitle('AnticipatoryLick - RampCell ')