-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathID_and_locate_struct_motif_patterns_2.m
executable file
·49 lines (37 loc) · 1.65 KB
/
ID_and_locate_struct_motif_patterns_2.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
function [totalDimerCounts, bigDimerCollection] = ID_and_locate_struct_motif_patterns_2(Cij, trackDimerCollection)
build_motif_lib_2_selfless_from_superpattern_perm();
load motif_lib_2_selfless_EorI motif2selflessIDs motif2selflessConnectionPats
totalNodes = size(Cij,1);
rowSums = sum(Cij,2);
EorIvector = rowSums>0;
numMotifClasses = max(motif2selflessIDs(:,3));
totalDimerCounts = zeros(numMotifClasses,1);
bigDimerCollection = cell(numMotifClasses,1);
if trackDimerCollection
for i = 1:numMotifClasses
bigDimerCollection{i} = zeros(1,2);
end
end
for nodeA = 1:totalNodes
for nodeB = nodeA+1:totalNodes
excitA = EorIvector(nodeA);
A2B = Cij(nodeA,nodeB);
excitB = EorIvector(nodeB);
B2A = Cij(nodeB,nodeA);
miniConnectionMatrixAB = [excitA A2B excitB B2A];
indx = ismember(motif2selflessConnectionPats, miniConnectionMatrixAB, 'rows')==1;
motifClassNum = motif2selflessIDs(indx,3);
totalDimerCounts(motifClassNum) = totalDimerCounts(motifClassNum) + 1;
if trackDimerCollection
bigDimerCollection{motifClassNum}(totalDimerCounts(motifClassNum),1:2) = [nodeA nodeB];
end
end % for nodeB
end % for nodeA
if trackDimerCollection
for i = 1:numMotifClasses
if isequal(bigDimerCollection{i}(1,1:2), [0 0])
bigDimerCollection{i} = NaN;
end
end
end
end