-
Notifications
You must be signed in to change notification settings - Fork 8
/
neighborhood_conn.m
executable file
·39 lines (36 loc) · 1.14 KB
/
neighborhood_conn.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
function [nc]=neighborhood_conn(G,v)
%NEIGHBORHOOD_CONN - neighborhood connectivity
%
% Science 3 May 2002: Vol. 296. no. 5569, pp. 910 - 913
% DOI: 10.1126/science.1065103
% Specificity and Stability in Topology of Protein Networks
% Sergei Maslov and Kim Sneppen
%
% In undirected networks, the neighborhood connectivity of a node v is
% defined as the average connectivity of all neighbors.
%
% The neighborhood connectivity distribution is computed from the average
% of the neighborhood connectivities of all nodes v with k neighbors for k
% = 0,1,....Maslov and Sneppen (2002) used the neighborhood connectivity
% distribution to comparecorrelation patterns in interaction and regulatory
% networks.
%
% Systems Biology and Evolution Toolbox (SBEToolbox).
% Authors: James Cai, Kranti Konganti.
% (C) Texas A&M University.
%
% $LastChangedDate: 2012-12-28 19:01:43 -0600 (Fri, 28 Dec 2012) $
% $LastChangedRevision: 278 $
% $LastChangedBy: konganti $
%
if nargin<2
v=1:size(G,1);
end
nc=zeros(length(v),1);
d=sum(G);
for k=1:length(v)
n=v(k);
i_neib=G(:,n);
d_neib=d(i_neib);
nc(k)=mean(d_neib);
end