Figure_6.m 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. clear all
  2. load('Figure6.mat');
  3. %% Figure 6C
  4. % Blocks 1 vs 2
  5. % % SS vs CR
  6. Corr_dHP_B12=ClusterInfo.Outbound_dHP_SpaCorr_B12((PlaceField_dHP_B1 & PlaceField_dHP_B3 & ChoiceFieldRatio_dHP_B13) | (PlaceField_dHP_B2 & PlaceField_dHP_B4 & ChoiceFieldRatio_dHP_B24) & Sunflower_dHP);
  7. Corr_iHP_B12=ClusterInfo.Outbound_iHP_SpaCorr_B12((PlaceField_iHP_B1 & PlaceField_iHP_B3 & ChoiceFieldRatio_iHP_B13) | (PlaceField_iHP_B2 & PlaceField_iHP_B4 & ChoiceFieldRatio_iHP_B24) & Sunflower_iHP);
  8. fig=figure; hold on;
  9. fig.Position=[0 0 500 500];
  10. cdfplot(Corr_dHP_B12);
  11. cdfplot(Corr_iHP_B12);
  12. xlim([-0.6 1]);
  13. [p,~,stat]=ranksum(Corr_dHP_B12, Corr_iHP_B12);
  14. % % 4/4 SS vs 1/4 SS
  15. Corr_dHP_B12_qauntity=ClusterInfo.Outbound_dHP_SpaCorr_B12((PlaceField_dHP_B1 & PlaceField_dHP_B3 & ChoiceFieldRatio_dHP_B13) | (PlaceField_dHP_B2 & PlaceField_dHP_B4 & ChoiceFieldRatio_dHP_B24) & Quantity_dHP);
  16. Corr_iHP_B12_qauntity=ClusterInfo.Outbound_iHP_SpaCorr_B12((PlaceField_iHP_B1 & PlaceField_iHP_B3 & ChoiceFieldRatio_iHP_B13) | (PlaceField_iHP_B2 & PlaceField_iHP_B4 & ChoiceFieldRatio_iHP_B24) & Quantity_iHP);
  17. fig=figure; hold on;
  18. fig.Position=[0 0 500 500];
  19. cdfplot(Corr_dHP_B12_qauntity);
  20. cdfplot(Corr_iHP_B12_qauntity);
  21. xlim([-0.6 1]);
  22. [p,~,stat]=ranksum(Corr_dHP_B12_qauntity, Corr_iHP_B12_qauntity);
  23. %% Figure 6D
  24. % Blocks 1 vs 3
  25. % % SS vs CR
  26. Corr_dHP_B13=ClusterInfo.Outbound_dHP_SpaCorr_B13((PlaceField_dHP_B1 | PlaceField_dHP_B3) & Sunflower_dHP);
  27. Corr_iHP_B13=ClusterInfo.Outbound_iHP_SpaCorr_B13((PlaceField_iHP_B1 | PlaceField_iHP_B3) & Sunflower_iHP);
  28. fig=figure; hold on;
  29. fig.Position=[0 0 500 500];
  30. cdfplot(Corr_dHP_B13);
  31. cdfplot(Corr_iHP_B13);
  32. xlim([-0.6 1])
  33. % line([0.69 0.69], [0 1])
  34. [p,~,stat]=ranksum(Corr_dHP_B13, Corr_iHP_B13);
  35. % % 4/4 SS vs 1/4 SS
  36. Corr_dHP_B13_qauntity=ClusterInfo.Outbound_dHP_SpaCorr_B13(PlaceField_dHP_B1 | PlaceField_dHP_B3 & Quantity_dHP);
  37. Corr_iHP_B13_qauntity=ClusterInfo.Outbound_iHP_SpaCorr_B13(PlaceField_iHP_B1 | PlaceField_iHP_B3 & Quantity_iHP);
  38. fig=figure; hold on;
  39. fig.Position=[0 0 500 500];
  40. cdfplot(Corr_dHP_B13_qauntity);
  41. cdfplot(Corr_iHP_B13_qauntity);
  42. % line([0.69 0.69], [0 1])
  43. [p,~,stat]=ranksum(Corr_dHP_B13_qauntity, Corr_iHP_B13_qauntity);
  44. %% Figure 6E and 6F
  45. PeakRate=1;
  46. % Dorsal, B1_Post
  47. j=1; k=1;
  48. for session=1:4
  49. Session.dHP=find(Indexing.dHP(session,:));
  50. for i=1:length(Session.dHP)
  51. iHP_B3_distance_High = PopulationMaximumBin.dHP_B1_Post(session,Session.dHP(i));
  52. ratio = FieldCoverageRatio.dHP(session,Session.dHP(i));
  53. [value] = max([iHP_B3_distance_High]);
  54. if value > PeakRate && ratio < 0.25
  55. PopMatrix.dHP_B1_Post(j,:)=transpose(squeeze(PopulationLinearizedFiringRate.dHP_B1_Post(session,Session.dHP(i),:))/PopulationMaximumBin.dHP_B1_Post(session,Session.dHP(i)));
  56. PopMatrix.MaximumBin_dHP_B1_Post(j,:)=MaximumBin.dHP_B1_Post(session,Session.dHP(i),:);
  57. PopMatrix.dHP_B1_PostName{j,1}=CLSTname.dHP{session,Session.dHP(i)}; j=j+1;
  58. end
  59. end
  60. end
  61. Temp=0;
  62. for i=1:size(PopMatrix.dHP_B1_Post,1)
  63. temp=find(PopMatrix.dHP_B1_Post(i,:)==1);
  64. if ~isempty(temp)
  65. Temp(i)=temp(1);
  66. else
  67. Temp(i)=0;
  68. end
  69. end
  70. [Sorted.dHP_B1_Post,SortedIndexing.dHP_B1_Post]=sort(Temp);
  71. PopMatrix.Sorted_dHP_B1_Post=PopMatrix.dHP_B1_Post(SortedIndexing.dHP_B1_Post,:);
  72. PopMatrix.Sorted_dHP_B1_Post_Name=PopMatrix.dHP_B1_PostName(SortedIndexing.dHP_B1_Post,1);
  73. PopMatrix.Sorted_dHP_B1_Post=PopMatrix.Sorted_dHP_B1_Post(4:end,:);
  74. % figure, Dorsal
  75. figure;
  76. imagesc(PopMatrix.Sorted_dHP_B1_Post)
  77. colormap('jet')
  78. g=gca; g.CLim=[0 1];g.YDir='normal';
  79. % Intermediate, B1_Post
  80. j=1; k=1;
  81. % clear PopMatrix Session
  82. for session=1:4
  83. Session.iHP=find(Indexing.iHP(session,:));
  84. for i=1:length(Session.iHP)
  85. iHP_B3_distance_High = PopulationMaximumBin.iHP_B1_Post(session,Session.iHP(i));
  86. ratio = FieldCoverageRatio.iHP(session,Session.iHP(i));
  87. [value] = max([iHP_B3_distance_High]);
  88. if (Depth.iHP(session,Session.iHP(i)) >= 2 && Depth.iHP(session,Session.iHP(i)) < 8) && value > PeakRate && ratio < 0.25
  89. PopMatrix.iHP_B1_Post(j,:)=transpose(squeeze(PopulationLinearizedFiringRate.iHP_B1_Post(session,Session.iHP(i),:))/PopulationMaximumBin.iHP_B1_Post(session,Session.iHP(i)));
  90. PopMatrix.MaximumBin_iHP_B1_Post(j,:)=MaximumBin.iHP_B1_Post(session,Session.iHP(i),:);
  91. PopMatrix.iHP_B1_PostName{j,1}=CLSTname.iHP{session,Session.iHP(i)}; j=j+1;
  92. end
  93. end
  94. end
  95. Temp=0;
  96. for i=1:size(PopMatrix.iHP_B1_Post,1)
  97. temp=find(PopMatrix.iHP_B1_Post(i,:)==1);
  98. if ~isempty(temp)
  99. Temp(i)=temp(1);
  100. else
  101. Temp(i)=0;
  102. end
  103. end
  104. [Sorted.iHP_B1_Post,SortedIndexing.iHP_B1_Post]=sort(Temp);
  105. PopMatrix.Sorted_iHP_B1_Post=PopMatrix.iHP_B1_Post(SortedIndexing.iHP_B1_Post,:);
  106. PopMatrix.Sorted_iHP_B1_Post_Name=PopMatrix.iHP_B1_PostName(SortedIndexing.iHP_B1_Post,1);
  107. PopMatrix.Sorted_iHP_B1_Post=PopMatrix.Sorted_iHP_B1_Post(4:end,:);
  108. % figure, Dorsal
  109. figure;
  110. imagesc(PopMatrix.Sorted_iHP_B1_Post)
  111. colormap('jet')
  112. g=gca; g.CLim=[0 1];g.YDir='normal';
  113. % Dorsal, B3_Post
  114. j=1; k=1;
  115. for session=1:4
  116. Session.dHP=find(Indexing.dHP(session,:));
  117. for i=1:length(Session.dHP)
  118. iHP_B3_distance_High = PopulationMaximumBin.dHP_B3_Post(session,Session.dHP(i));
  119. ratio = FieldCoverageRatio.dHP(session,Session.dHP(i));
  120. [value] = max([iHP_B3_distance_High]);
  121. if value > PeakRate && ratio < 0.25
  122. PopMatrix.dHP_B3_Post(j,:)=transpose(squeeze(PopulationLinearizedFiringRate.dHP_B3_Post(session,Session.dHP(i),:))/PopulationMaximumBin.dHP_B3_Post(session,Session.dHP(i)));
  123. PopMatrix.MaximumBin_dHP_B3_Post(j,:)=MaximumBin.dHP_B3_Post(session,Session.dHP(i),:);
  124. PopMatrix.dHP_B3_PostName{j,1}=CLSTname.dHP{session,Session.dHP(i)}; j=j+1;
  125. end
  126. end
  127. end
  128. Temp=0;
  129. for i=1:size(PopMatrix.dHP_B3_Post,1)
  130. temp=find(PopMatrix.dHP_B3_Post(i,:)==1);
  131. if ~isempty(temp)
  132. Temp(i)=temp(1);
  133. else
  134. Temp(i)=0;
  135. end
  136. end
  137. [Sorted.dHP_B3_Post,SortedIndexing.dHP_B3_Post]=sort(Temp);
  138. PopMatrix.Sorted_dHP_B3_Post=PopMatrix.dHP_B3_Post(SortedIndexing.dHP_B3_Post,:);
  139. PopMatrix.Sorted_dHP_B3_Post_Name=PopMatrix.dHP_B3_PostName(SortedIndexing.dHP_B3_Post,1);
  140. PopMatrix.Sorted_dHP_B3_Post=PopMatrix.Sorted_dHP_B3_Post(5:end,:);
  141. % figure
  142. figure;
  143. imagesc(GetSwap(PopMatrix.Sorted_dHP_B3_Post))
  144. colormap('jet')
  145. g=gca; g.CLim=[0 1];
  146. % Intermediate, B3_Post
  147. j=1; k=1;
  148. % clear PopMatrix Session
  149. for session=1:4
  150. Session.iHP=find(Indexing.iHP(session,:));
  151. for i=1:length(Session.iHP)
  152. iHP_B3_distance_High = PopulationMaximumBin.iHP_B3_Post(session,Session.iHP(i));
  153. ratio = FieldCoverageRatio.iHP(session,Session.iHP(i));
  154. [value] = max([iHP_B3_distance_High]);
  155. if (Depth.iHP(session,Session.iHP(i)) >= 2 && Depth.iHP(session,Session.iHP(i)) < 8) && value > PeakRate && ratio < 0.25
  156. PopMatrix.iHP_B3_Post(j,:)=transpose(squeeze(PopulationLinearizedFiringRate.iHP_B3_Post(session,Session.iHP(i),:))/PopulationMaximumBin.iHP_B3_Post(session,Session.iHP(i)));
  157. PopMatrix.MaximumBin_iHP_B3_Post(j,:)=MaximumBin.iHP_B3_Post(session,Session.iHP(i),:);
  158. PopMatrix.iHP_B3_PostName{j,1}=CLSTname.iHP{session,Session.iHP(i)}; j=j+1;
  159. end
  160. end
  161. end
  162. Temp=0;
  163. for i=1:size(PopMatrix.iHP_B3_Post,1)
  164. temp=find(PopMatrix.iHP_B3_Post(i,:)==1);
  165. if ~isempty(temp)
  166. Temp(i)=temp(1);
  167. else
  168. Temp(i)=0;
  169. end
  170. end
  171. [Sorted.iHP_B3_Post,SortedIndexing.iHP_B3_Post]=sort(Temp);
  172. PopMatrix.Sorted_iHP_B3_Post=PopMatrix.iHP_B3_Post(SortedIndexing.iHP_B3_Post,:);
  173. PopMatrix.Sorted_iHP_B3_Post_Name=PopMatrix.iHP_B3_PostName(SortedIndexing.iHP_B3_Post,1);
  174. PopMatrix.Sorted_iHP_B3_Post=PopMatrix.Sorted_iHP_B3_Post(6:end,:);
  175. % figure,
  176. figure;
  177. imagesc(GetSwap(PopMatrix.Sorted_iHP_B3_Post))
  178. colormap('jet')
  179. g=gca; g.CLim=[0 1];
  180. %% Figure 6G
  181. dHP_b1=[2 2 3 3 3 3 3 4 4 4 5 5 5 5 5 5 6 6 6 7 7 8 8 10 10 11 11 11 11 12 12 14 16 16 16 17 17 18 20 20 21 22 23 23 23 25 26 28 30 30 30 31 33 34 34 35 36 36 37 38 38 40 41 42 43 45 45 45 45 46 46 46 47 47 47 48 49 49 50 50 51 51 52 52 52 53 53 54 55 55 55 56 56 ]
  182. iHP_b1=[1 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 10 11 11 11 11 11 11 11 12 12 15 15 15 16 17 17 18 18 21 23 23 24 26 33 33 33 34 36 37 38 38 38 39 40 40 40 41 41 42 43 43 44 45 46 46 47 47 47 48 49 49 49 49 49 49 49 50 50 51 51 51 52 52 52 52 52 53 53 53 53 53 53 54 54 54 55 55 56 56 56];
  183. dHP_b3=[1 1 2 2 2 2 3 3 3 3 3 3 3 4 4 5 6 6 6 6 7 7 7 8 8 8 8 9 9 9 10 10 12 12 13 13 13 13 14 14 15 15 16 16 17 17 17 17 18 19 20 20 23 26 33 34 34 35 35 36 37 37 38 39 40 41 42 42 42 42 43 43 44 44 45 45 45 45 46 46 47 49 50 50 50 50 50 51 51 52 53 53 53 53 53 53 53 54 55 55 55 55 56 56];
  184. iHP_b3=[2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 6 6 6 7 7 7 7 7 8 8 9 10 10 11 11 11 11 11 12 12 12 12 13 13 13 13 13 14 14 15 15 16 22 22 27 30 31 31 32 32 33 35 35 35 36 36 36 37 38 38 39 39 40 41 41 41 42 42 43 44 44 44 44 44 45 46 46 47 47 47 47 47 47 47 47 47 50 50 50 50 51 51 51 52 52 52 52 52 52 53 53 53 53 53 55 55 55 55 56];
  185. dHP_b3_rev=flip(57-dHP_b3)
  186. iHP_b3_rev=flip(57-iHP_b3)
  187. % % Histogram
  188. dHP_B1=sum(PopMatrix.Sorted_dHP_B1_Post==1)/sum(sum(PopMatrix.Sorted_dHP_B1_Post==1))
  189. dHP_B3=flip(sum(PopMatrix.Sorted_dHP_B3_Post==1)/sum(sum(PopMatrix.Sorted_dHP_B3_Post==1)))
  190. iHP_B1=sum(PopMatrix.Sorted_iHP_B1_Post==1)/sum(sum(PopMatrix.Sorted_iHP_B1_Post==1))
  191. iHP_B3=flip(sum(PopMatrix.Sorted_iHP_B3_Post==1)/sum(sum(PopMatrix.Sorted_iHP_B3_Post==1)))
  192. % %
  193. PopMatrix.Sorted_dHP_B1_Post = [PopMatrix.Sorted_dHP_B1_Post(:,1:25) PopMatrix.Sorted_dHP_B1_Post(:,32:end)]; % 1:47 / 53:end
  194. PopMatrix.Sorted_iHP_B1_Post = [PopMatrix.Sorted_iHP_B1_Post(:,1:25) PopMatrix.Sorted_iHP_B1_Post(:,32:end)]; % 1:62
  195. dHP_B1_high = PopMatrix.Sorted_dHP_B1_Post(1:46,1:25)
  196. dHP_B1_low = PopMatrix.Sorted_dHP_B1_Post(53:end,26:50)
  197. iHP_B1_high = PopMatrix.Sorted_iHP_B1_Post(1:61,1:25)
  198. iHP_B1_low = PopMatrix.Sorted_iHP_B1_Post(63:end,26:50)
  199. PopMatrix.Sorted_dHP_B3_Post = [PopMatrix.Sorted_dHP_B3_Post(:,1:25) PopMatrix.Sorted_dHP_B3_Post(:,32:end)]; % 1:47 / 53:end
  200. PopMatrix.Sorted_iHP_B3_Post = [PopMatrix.Sorted_iHP_B3_Post(:,1:25) PopMatrix.Sorted_iHP_B3_Post(:,32:end)]; % 1:62
  201. dHP_B3_high = PopMatrix.Sorted_dHP_B3_Post(1:53,1:25)
  202. dHP_B3_low = PopMatrix.Sorted_dHP_B3_Post(55:end,26:50)
  203. iHP_B3_high = PopMatrix.Sorted_iHP_B3_Post(1:67,1:25)
  204. iHP_B3_low = PopMatrix.Sorted_iHP_B3_Post(69:end,26:50)
  205. j=1;
  206. for i=1:2:56
  207. dHP_B1_2(j)=dHP_B1(i)+dHP_B1(i+1); j=j+1;
  208. end
  209. j=1;
  210. for i=1:2:56
  211. dHP_B3_2(j)=dHP_B3(i)+dHP_B3(i+1); j=j+1;
  212. end
  213. j=1;
  214. for i=1:2:56
  215. iHP_B1_2(j)=iHP_B1(i)+iHP_B1(i+1); j=j+1;
  216. end
  217. j=1;
  218. for i=1:2:56
  219. iHP_B3_2(j)=iHP_B3(i)+iHP_B3(i+1); j=j+1;
  220. end
  221. % dHP figure;
  222. figure; hold on;
  223. b1=bar(dHP_B1); b1.FaceColor='r'; b1.FaceAlpha = 0.3; b1.EdgeColor=[1 1 1]; b1.EdgeAlpha=0;
  224. b2=bar(dHP_B3); b2.FaceColor='b'; b2.FaceAlpha = 0.3; b2.EdgeColor=[1 1 1]; b2.EdgeAlpha=0;
  225. ylim([0 0.12]); g=gca; g.YTick=0:0.04:0.12;
  226. % iHP figure;
  227. figure; hold on;
  228. b1=bar(iHP_B1); b1.FaceColor='r'; b1.FaceAlpha = 0.3; b1.EdgeColor=[1 1 1]; b1.EdgeAlpha=0;
  229. b2=bar(iHP_B3); b2.FaceColor='b'; b2.FaceAlpha = 0.3; b2.EdgeColor=[1 1 1]; b2.EdgeAlpha=0;
  230. ylim([0 0.12]); g=gca; g.YTick=0:0.04:0.12;
  231. % Statistical testing
  232. [h,p,stat]=kstest2(dHP_b3_rev, dHP_b1)
  233. [h,p,stat]=kstest2(iHP_b3_rev, iHP_b1)
  234. %% Figure 6H
  235. zone=4;
  236. for i=1:size(dHP_B1_high,1)
  237. for j=1:1:size(dHP_B1_high,2)
  238. if dHP_B1_high(i,j)==1
  239. dHP_B1_high_index(i)=j;
  240. end
  241. end
  242. end
  243. for i=1:size(dHP_B1_low,1)
  244. for j=1:1:size(dHP_B1_low,2)
  245. if dHP_B1_low(i,j)==1
  246. dHP_B1_low_index(i)=j;
  247. end
  248. end
  249. end
  250. prop.dHP_B1_high(zone)=length(find(dHP_B1_high_index<=zone))/length(dHP_B1_high_index);
  251. prop.dHP_B1_low(zone)=length(find(dHP_B1_low_index>25-zone))/length(dHP_B1_low_index);
  252. for i=1:size(dHP_B3_high,1)
  253. for j=1:1:size(dHP_B3_high,2)
  254. if dHP_B3_high(i,j)==1
  255. dHP_B3_high_index(i)=j;
  256. end
  257. end
  258. end
  259. for i=1:size(dHP_B3_low,1)
  260. for j=1:1:size(dHP_B3_low,2)
  261. if dHP_B3_low(i,j)==1
  262. dHP_B3_low_index(i)=j;
  263. end
  264. end
  265. end
  266. prop.dHP_B3_high(zone)=length(find(dHP_B3_high_index<=zone))/length(dHP_B3_high_index);
  267. prop.dHP_B3_low(zone)=length(find(dHP_B3_low_index>25-zone))/length(dHP_B3_low_index);
  268. for i=1:size(iHP_B1_high,1)
  269. for j=1:1:size(iHP_B1_high,2)
  270. if iHP_B1_high(i,j)==1
  271. iHP_B1_high_index(i)=j;
  272. end
  273. end
  274. end
  275. for i=1:size(iHP_B1_low,1)
  276. for j=1:1:size(iHP_B1_low,2)
  277. if iHP_B1_low(i,j)==1
  278. iHP_B1_low_index(i)=j;
  279. end
  280. end
  281. end
  282. prop.iHP_B1_high(zone)=length(find(iHP_B1_high_index<=zone))/length(iHP_B1_high_index);
  283. prop.iHP_B1_low(zone)=length(find(iHP_B1_low_index>25-zone))/length(iHP_B1_low_index);
  284. for i=1:size(iHP_B3_high,1)
  285. for j=1:1:size(iHP_B3_high,2)
  286. if iHP_B3_high(i,j)==1
  287. iHP_B3_high_index(i)=j;
  288. end
  289. end
  290. end
  291. for i=1:size(iHP_B3_low,1)
  292. for j=1:1:size(iHP_B3_low,2)
  293. if iHP_B3_low(i,j)==1
  294. iHP_B3_low_index(i)=j;
  295. end
  296. end
  297. end
  298. prop.iHP_B3_high(zone)=length(find(iHP_B3_high_index<=zone))/length(iHP_B3_high_index);
  299. prop.iHP_B3_low(zone)=length(find(iHP_B3_low_index>25-zone))/length(iHP_B3_low_index);
  300. % figure
  301. zone=4;
  302. figure; hold on;
  303. plot(1:2, [prop.dHP_B1_low(zone) prop.dHP_B1_high(zone)],'ro-');
  304. plot(1:2, [prop.iHP_B1_low(zone) prop.iHP_B1_high(zone)],'bo-');
  305. plot(3:4, [prop.dHP_B3_low(zone) prop.dHP_B3_high(zone)],'ro-');
  306. plot(3:4, [prop.iHP_B3_low(zone) prop.iHP_B3_high(zone)],'bo-');
  307. ylim([0 0.5])
  308. xlim([0.5 4.5])
  309. %% Figure 6I
  310. % % Field width
  311. THRE=0.5;
  312. dHP_B3_high_field=dHP_B3_high>THRE;
  313. m=0;
  314. for i=1:size(dHP_B3_high,1)
  315. for j=size(dHP_B3_high,2):-1:1
  316. if dHP_B3_high_field(i,j)==1
  317. m=m+1;
  318. end
  319. end
  320. dHP_B3_high_size(i)=m;
  321. m=0;
  322. end
  323. mean(dHP_B3_high_size)
  324. dHP_B3_low_field=dHP_B3_low>THRE;
  325. m=0;
  326. for i=1:size(dHP_B3_low,1)
  327. for j=size(dHP_B3_low,2):-1:1
  328. if dHP_B3_low_field(i,j)==1
  329. m=m+1;
  330. end
  331. end
  332. dHP_B3_low_size(i)=m;
  333. m=0;
  334. end
  335. mean(dHP_B3_low_size)
  336. iHP_B3_high_field=iHP_B3_high>THRE;
  337. m=0;
  338. for i=1:size(iHP_B3_high,1)
  339. for j=size(iHP_B3_high,2):-1:1
  340. if iHP_B3_high_field(i,j)==1
  341. m=m+1;
  342. end
  343. end
  344. iHP_B3_high_size(i)=m;
  345. m=0;
  346. end
  347. mean(iHP_B3_high_size)
  348. [p1,p]=ranksum((iHP_B3_high_size), (dHP_B3_high_size))
  349. iHP_B3_low_field=iHP_B3_low>THRE;
  350. m=0;
  351. for i=1:size(iHP_B3_low,1)
  352. for j=size(iHP_B3_low,2):-1:1
  353. if iHP_B3_low_field(i,j)==1
  354. m=m+1;
  355. end
  356. end
  357. iHP_B3_low_size(i)=m;
  358. m=0;
  359. end
  360. mean(iHP_B3_low_size)
  361. % figure
  362. figure; hold on;
  363. Jin_MeanSTE_Line(6,dHP_B3_high_size)
  364. Jin_MeanSTE_Line(7,dHP_B3_low_size)
  365. Jin_MeanSTE_Line(8,iHP_B3_high_size)
  366. Jin_MeanSTE_Line(9,iHP_B3_low_size)
  367. % statistical testing
  368. [h,p, ~, T]=ttest2(dHP_B3_high_size, dHP_B3_low_size)
  369. [h,p, ~, T]=ttest2(iHP_B3_high_size, iHP_B3_low_size)