function []=my_analyzeremap2_individualneurons stimulatednodes=[2 7 10 26 31 34 39 42 47 50 55 58]; %18 excluded b/c there was an error in loading the file for i=stimulatednodes disp(sprintf('Loading and filtering remap2pin%d . . . ',i)) my_filter_individualneurons(sprintf('remap2pin%d',i)); end %creates list of neurons at each electrode. Assumes that there is at most one neuron of a given type at a given electrode. numneurons=[]; %list of all neurons, first column is location, second colum is shape neurons=cell{64,1} for i=stimulatednodes load(sprintf('remap2pin%d_spikesindivneurons.mat',i)); for j=1:length(spikes) temp=neurons(spikes(2,j),1); temp=temp{:,1}; flag=0; for k=1:length(temp} if temp(k,1)==spikes(1,j) flag=1; end end if flag==0 temp=[temp; spikes(1,j)]; neurons(spikes(2,j),1)=temp; numneurons=[numneurons; spikes(2,j) spikes(1,j)]; end end clear spikes; end %sort neurons (first by location, then by shape) numneurons=sort(numneurons, [1 2]); %determines which neurons were stimulated for i=1:length(numneurons) for j=1:length(stimulatenodes) if stimulatednodes(j)==numneurons(i,1) stimulatedneurons=[stimulatedneurons; i]; end end end time_conversion=20000; connectionsfound=zeros(length(numneurons)); for i=stimulatedneurons load(sprintf('remap2pin%d_spikesindivneurons.mat',i)); disp(sprintf(' Smearing neuron %d . . .', i)) %determine which neuron was stimulated networksize=size(spikes); networksize=networksize(1,2); for j=1:networksize if numneurons(i)==spikes(1:2,j)' stim=j; end end %smear appropriately spikes=[spikes(1:2,:); my_smearspikes(spikes(3:end,:),stim)]; disp(sprintf(' Analyzing simulation of neuron %d stimulation . . .', i)) maxdelay=round(.05*time_conversion); %set connectionsfound correctly holder=my_analyzenetwork(spikes(3:end,:),stim, maxdelay); for j=1:length(holder) for l=1:length(numneurons) if numneurons(l,:)==spikes(1:2,j)' connectionsfound(i,l)=holder(j); end end end end my_graph_connections(connectionsfound); %note my_graph_connections2 will not produce a spatially meaningful result for this analysis of individual neurons. save('remap2_connectionsfound.mat','connectionsfound');