reviewSpikeAmplitude.m 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. %% Script to review the spike amplitude using means and sds
  2. % This script calculates average values of the spike amplitudes for
  3. % different groups that were stated in the analysis. To evaluate the
  4. % consistency of the groups and the spike amplitude it self standard
  5. % deviations are reviewed. All results are displayed in the command window
  6. % with a clear layout.
  7. % -------------------------------------------------------------------------
  8. % Program by: Bjarne Schultze [last modified: 08.03.2022]
  9. % -------------------------------------------------------------------------
  10. % load the deanonymization file
  11. load("../AdditionalFiles/deanonymization.mat")
  12. % get the numbers of the cells in each package
  13. pack_1_3 = find(eq(deanonymization.package(:,1),13));
  14. pack_2 = find(eq(deanonymization.package(:,1),2));
  15. pack_4_6 = find(eq(deanonymization.package(:,1),46));
  16. pack_5 = find(eq(deanonymization.package(:,1),5));
  17. % take the assigned cell types into account
  18. int218 = find(eq(deanonymization.cellType(:,1),218));
  19. int162 = find(eq(deanonymization.cellType(:,1),162));
  20. int264 = find(eq(deanonymization.cellType(:,1),264));
  21. int212 = find(eq(deanonymization.cellType(:,1),212));
  22. int201203 = find(eq(deanonymization.cellType(:,1),201203));
  23. int159 = find(eq(deanonymization.cellType(:,1),159));
  24. int157 = find(eq(deanonymization.cellType(:,1),157));
  25. int6061 = find(eq(deanonymization.cellType(:,1),6061));
  26. % obtian the spike amplitudes and the standard deviations (the latter are
  27. % not included in the decisionData file)
  28. [spike_heights,spk_hghts_SD] = intSpikeHeight(1:62);
  29. % remove measurements for the interneurons without spikes
  30. spike_heights([5,10,26,36,38,40],1) = NaN;
  31. spk_hghts_SD([5,10,26,36,38,40],1) = NaN;
  32. % define the three groups for the spike amplitudes: small, medium, large
  33. smallSpikers = find(spike_heights < 9);
  34. mediumSpikers = find(spike_heights >= 9 & spike_heights < 30);
  35. largeSpikers = find(spike_heights >= 30);
  36. % display an overview of the central tendencies for the whole dataset and
  37. % for the three single spike amplitude groups. The sd gives the standard
  38. % deviation of the spike amplitude within the current group. This is an
  39. % estimation of how consistent the groups are regarding the spike amplitude
  40. spikeAmpGroups = ...
  41. sprintf("\nCentral tendencies of the spike amplitude \n" + ...
  42. "(non-spiking interneurons excluded, mean \x00B1 sd): \n" + ...
  43. "\tAll: %0.2f mV (mean), %0.2f mV (median) \n" + ...
  44. "\tSmall spikers: \t%05.2f \x00B1 %0.2f mV \n" + ...
  45. "\tMedium spikers: %0.2f \x00B1 %0.2f mV \n" + ...
  46. "\tLarge spikers: \t%0.2f \x00B1 %0.2f mV", ...
  47. mean(spike_heights,'omitnan'), median(spike_heights,'omitnan'), ...
  48. mean(spike_heights(smallSpikers),'omitnan'),...
  49. std(spike_heights(smallSpikers),'omitnan'), ...
  50. mean(spike_heights(mediumSpikers),'omitnan'), ...
  51. std(spike_heights(mediumSpikers),'omitnan'), ...
  52. mean(spike_heights(largeSpikers),'omitnan'), ...
  53. std(spike_heights(largeSpikers),'omitnan'));
  54. disp(spikeAmpGroups)
  55. % display an overview of the standard deviations of the spike amplitudes of
  56. % each single neuron. Spike amplitude deviations are averaged for the
  57. % stated groups and give an estimation about how constant the spike
  58. % amplitude was for one cell.
  59. sd_spikeAmpNeurons = sprintf("\nStandard deviations of the spike " + ...
  60. "amplitude measured for single cells and then averaged for the " + ...
  61. "stated groups \n(non-spiking interneurons excluded): \n" + ...
  62. "\tAll: \t\t\t%0.2f mV \n" + ...
  63. "\tSmall spikers: \t%0.2f mV\n" + ...
  64. "\tMedium spikers: %0.2f mV \n" + ...
  65. "\tLarge spikers: \t%0.2f mV \n" + ...
  66. "\tSmall and medium spikers: %0.2f mV", ...
  67. mean(spk_hghts_SD, 'omitnan'), ...
  68. mean(spk_hghts_SD(smallSpikers),'omitnan'), ...
  69. mean(spk_hghts_SD(mediumSpikers),'omitnan'), ...
  70. mean(spk_hghts_SD(largeSpikers),'omitnan'),...
  71. mean(spk_hghts_SD([smallSpikers;mediumSpikers]),'omitnan'));
  72. disp(sd_spikeAmpNeurons)
  73. % create an overview about the average spike amplitude for the single
  74. % interneuron cell types as they were assigned based on size and location
  75. % in the ganglion. Sds are within those groups
  76. spikeAmpNeurons = sprintf("\nAverage spike amplitudes for the " + ...
  77. "assigned cell types \n(non-spiking interneurons excluded, " + ...
  78. "mean \x00B1 sd) \n" + ...
  79. "\t Int 60-61: \t%05.2f \x00B1 %05.2f mV \n" + ...
  80. "\t Int 157: \t\t%05.2f \x00B1 %05.2f mV \n" + ...
  81. "\t Int 159: \t\t%05.2f \x00B1 %05.2f mV \n" + ...
  82. "\t Int 162: \t\t%05.2f \x00B1 %05.2f mV \n" + ...
  83. "\t Int 201-203: \t%05.2f \x00B1 %05.2f mV \n" + ...
  84. "\t Int 212: \t\t%05.2f \x00B1 %05.2f mV \n" + ...
  85. "\t without the two large spikers: \n" + ...
  86. "\t\t\t\t\t%05.2f \x00B1 %05.2f mV \n" + ...
  87. "\t Int 218: \t\t%05.2f \x00B1 %05.2f mV \n" + ...
  88. "\t including the two large spikers labelled as 212: \n" + ...
  89. "\t\t\t\t\t%05.2f \x00B1 %05.2f mV \n" + ...
  90. "\t Int 264: \t\t%05.2f \x00B1 %05.2f mV", ...
  91. mean(spike_heights(int6061),'omitnan'), ...
  92. std(spike_heights(int6061),'omitnan'), ...
  93. mean(spike_heights(int157),'omitnan'), ...
  94. std(spike_heights(int157),'omitnan'), ...
  95. mean(spike_heights(int159),'omitnan'), ...
  96. std(spike_heights(int159),'omitnan'), ...
  97. mean(spike_heights(int162),'omitnan'), ...
  98. std(spike_heights(int162),'omitnan'), ...
  99. mean(spike_heights(int201203),'omitnan'), ...
  100. std(spike_heights(int201203),'omitnan'), ...
  101. mean(spike_heights(int212),'omitnan'), ...
  102. std(spike_heights(int212),'omitnan'), ...
  103. mean(spike_heights(int212([2:5,7:11])),'omitnan'), ...
  104. std(spike_heights(int212([2:5,7:11])),'omitnan'), ...
  105. mean(spike_heights(int218),'omitnan'), ...
  106. std(spike_heights(int218),'omitnan'), ...
  107. mean(spike_heights([int218;int212([1,6])]),'omitnan'), ...
  108. std(spike_heights([int218;int212([1,6])]),'omitnan'), ...
  109. mean(spike_heights(int264),'omitnan'), ...
  110. std(spike_heights(int264),'omitnan'));
  111. disp(spikeAmpNeurons)
  112. %% End
  113. % clear workspace
  114. clear