-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fig3E.m
51 lines (40 loc) · 1.46 KB
/
Fig3E.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%loading the connectome / network map
load Neuro279_EJ.mat; %matrix containing gap junctions
load Neuro279_Syn.mat; %matrix containing chemical synapses
load Order279.mat; %array containing the neuron order of matrices above
load LRpairs.mat; %loading L-R pairs within the connectome (Neuron names correspond to Order279.mat)
%calculating all possible neuronal pairs within the connectome
comb_pairs=nchoosek(1:size(Neuro279_EJ,1),2);
%finding non L-R pairs (will be named RemainingPairs)
count=1;
for i=1:size(comb_pairs,1);
clear temprow
temprow=comb_pairs(i,:);
clear test
for j=1:size(LRpairs,1);
test(j)=isequal(LRpairs(j,:),temprow);
end
if ~sum(test)>0;
Remaining_pairs(count,1:2)=temprow;
count=count+1;
end
end
%%
%generating the combined network
cg=Neuro279_Syn+Neuro279_EJ;
cg_t=double(cg>0); %combined network - unweighted
%calculating primary input similarity (cosine similarity) for L-R pairs
secon_LR=calculateSIP_t(cg_t,LRpairs,'cos');
%calculating primary input similarity (cosine similarity) for all remaining pairs (non L-R pairs)
secon_Remaining=calculateSIP_t(cg_t,Remaining_pairs,'cos');
%% plotting Figure 3E
figure;
histogram(secon_Remaining,[0:0.05:1],'Normalization','Probability')
hold on
histogram(secon_LR,[0:0.05:1],'Normalization','Probability')
box off
ylabel('Fraction')
xlabel('Secondary Input Similarity')
set(gca,'FontSize',18)
set(gca,'TickDir', 'out');
legend('All pairs','L-R pairs')