decision_data.m 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. %% Calculate characteristic features
  2. % This script obtains the spike height, the amplitude of the T cell during
  3. % - 2nA and 1.5 nA interneuron stimulation as well as the latency of the
  4. % interneuron response to a T cell spike. All values are obtained for all
  5. % 62 datasets and stored in a data file for later usage.
  6. % This script was written to abolish the need to calculate all the
  7. % data used for the graphical clustering every time they are needed.
  8. % -------------------------------------------------------------------------
  9. % Program by: Bjarne Schultze [last modified: 11.03.2022]
  10. % -------------------------------------------------------------------------
  11. % calculate the spike amplitudes for all interneurons
  12. [spike_heights, ~] = intSpikeHeight(1:62);
  13. % obtain the latencies of the average postsynaptic response (interneuron)
  14. % to a presynaptic spike (in the T cell)
  15. latencies = spikeTrigAvg_postsyn(1:62);
  16. % calculate the amplitudes of the membrane potential during -2 nA and
  17. % 1.5 nA stimulation of the interneuron
  18. AmpIout = ampAtStim(1:62,'Stimuli',[-2,1.5],'StimCell','INT',...
  19. 'Filter','hn');
  20. % preallocate vectors for the amplitudes at -2 nA and 1.5 nA
  21. amp_minus2nA_stim = zeros(62,1);
  22. amp_1_5nA_stim = zeros(62,1);
  23. % extract the results from the AmpIout variable
  24. for file = 1:62
  25. amp_minus2nA_stim(file,1) = AmpIout{file,1}.MeanAmplitudeT(1);
  26. amp_1_5nA_stim(file,1) = AmpIout{file,1}.MeanAmplitudeT(2);
  27. end
  28. % set all files were no latency was measured to 60 (important to plot the
  29. % results later)
  30. latencies(isnan(latencies)) = 60;
  31. % set latency for dataset 5, 20 and 50 to 60, because in these datasets the
  32. % T cell is not spiking. Hence, there can't be a response to T cell spikes
  33. latencies([5,20,50]) = 60;
  34. % set spike height of non-spinking interneurons to -10 (function can't
  35. % handle them in an adequat way)
  36. spike_heights([5,10,26,36,38,40],1) = -10;
  37. % manually adapt two hyperpolarization measurements because the function
  38. % did not measure actual graded hyperpolarizations
  39. amp_minus2nA_stim([31,57]) = 0;
  40. % save all values for later usage in other functions
  41. save("../AdditionalFiles/decisionData.mat", "amp_minus2nA_stim", ...
  42. "spike_heights", "latencies", "amp_1_5nA_stim")
  43. %% End
  44. % clear workspace
  45. clear