File tree Expand file tree Collapse file tree 8 files changed +25
-106
lines changed Expand file tree Collapse file tree 8 files changed +25
-106
lines changed Original file line number Diff line number Diff line change 3
3
% modules in multiple networks
4
4
%
5
5
% INPUT:
6
- % multiNetworks : a cell contains multiple networks, each of which is
7
- % presented by edgelist format or a full matrix
8
- % with N nodes
6
+ % multiNetworks: a cell contains multiple networks, each is
7
+ % presented by a sparse matrix or a full matrix with N nodes
9
8
% N: the number of all nodes
10
9
% K: the number of hidden factors
11
- % lambda: a vector which contains the parameters for balancing the relative
10
+ % lambda: a vector containing the parameters for balancing the relative
12
11
% weight among different views
13
12
% xita: the parameter for selecting nodes
14
13
% maxIter: the maximum number of iterations for multi-view NMF
15
14
%
16
15
% OUTPUT:
17
- % modulesfinal: a cell which contains the final conserved modules
16
+ % modulesfinal: a cell contains the final conserved modules
18
17
%
19
18
% Peizhuo Wang ([email protected] )
20
19
20
+ %% parameters
21
+
22
+
21
23
%% Calculting the feature matrices
22
24
disp(' Calculating the strengh matrix and the uniformity matrix...' )
23
25
[Strength , Distribution ] = featureNets(multiNetworks , N );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5
5
% X: the adjacency matrix of a network
6
6
% Hc: initialization for consensus factor matrix
7
7
% H: initialization for factor matrix of each view
8
- % lambda: a vector which contains the parameters for balancing the relative
8
+ % lambda: a vector containing the parameters for balancing the relative
9
9
% weight among different views
10
10
% MaxIter: the maximal number of iterations for alternating minimization
11
11
% epsilon: the convergence parameter
Original file line number Diff line number Diff line change 10
10
% FPR: the False Positive Rate
11
11
% Accuracy:
12
12
% MCC: the Matthews Correlation Coefficient
13
+ % I: Confusion Matrix
13
14
%
14
15
% Peizhuo Wang ([email protected] )
15
16
Original file line number Diff line number Diff line change 2
2
% Compute two feature metrices from multiple networks
3
3
%
4
4
% INPUT:
5
- % multiNetworks : a cell contains multiple networks, each of which is
6
- % presented by edgelist format or a full matrix
5
+ % multiNetworks : a cell contains multiple networks, each is
6
+ % presented by a sparse matrix or a full matrix
7
7
% with N nodes
8
8
% N : the number of all nodes
9
9
%
19
19
Strength = zeros(N );
20
20
temp = zeros(N );
21
21
A = zeros(N );
22
- if (m <= 3 ) % Edgelist format
22
+ if (m <= 3 ) % Sparse matrix format
23
23
for k = 1 : network_count
24
24
theMatrix = multiNetworks{k };
25
25
[edge_count , col_count ] = size(theMatrix );
73
73
Participation = (network_count /(network_count - 1 )) * (1 -(temp ./(A .^ 2 )));
74
74
Participation(isinf(Participation )) = 0 ;
75
75
Participation(isnan(Participation )) = 0 ;
76
- Participation = Participation - diag(diag(Participation )); % The diagonal is 0
76
+ Participation = Participation - diag(diag(Participation ));
77
77
78
78
Strength = A ./ network_count ;
79
- Strength = Strength - diag(diag(Strength )); % The diagonal is 0
79
+ Strength = Strength - diag(diag(Strength ));
80
80
81
81
end
Original file line number Diff line number Diff line change 44
44
%
45
45
% % Selecting nodes from the consensus factors
46
46
% xita = 1.5;
47
- % modules_final = moduleNodesSelection ( Hc, xita );
47
+ % modules_final = modulesTruing ( Hc, xita );
48
48
% runtime = toc;
49
49
% disp(['Running time: ', num2str(runtime), ' sec.'])
50
50
Original file line number Diff line number Diff line change 1
1
function [ modulesFinal ] = moduleNodesSelection( Hc , xita )
2
- % Assigning the module members by a soft node selection procedure
3
- % and then truing the modules to obtain more accurate results
2
+ % A soft node selection procedure from the consensus factors to assign the module members
3
+ % and then truing the modules to obtain more accurate results
4
4
%
5
5
% INPUT:
6
6
% Hc: the consensus factor matrix
7
7
% xita: the parameter for selecting nodes
8
8
%
9
9
% OUTPUT:
10
- % modulesFinal: a cell which contains the final result modules
10
+ % modulesFinal: a cell contains the final result modules
11
11
%
12
12
% Peizhuo Wang ([email protected] )
13
13
26
26
27
27
for i = 1 : size(HPI , 1 )-1
28
28
for j = (i + 1 ): size(HPI , 2 )
29
- if HPI(i ,j )>0.5 % merge these two modules
29
+ if HPI(i ,j )>0.5
30
30
[Y , I ] = max([moduleSignal(i ), moduleSignal(j )]);
31
31
if I == 1
32
32
modulesFinal{j } = [];
43
43
end
44
44
end
45
45
46
- % Only modules with no less than 5 nodes are kept
47
46
i = 1 ;
48
47
while i ~= length(modulesFinal )+1
49
48
if isempty(modulesFinal{i }) || (length(modulesFinal{i })<5)
Original file line number Diff line number Diff line change 2
2
% Multi-View Non-negative symmetric Matrix Factorization
3
3
%
4
4
% INPUT:
5
- % X: a cell which contains symmetric matrices
5
+ % X: a cell containing symmetric matrices
6
6
% K: the number of hidden factors
7
- % lambda: a vector which contains the parameters for balancing the relative
7
+ % lambda: a vector containing the parameters for balancing the relative
8
8
% weight among different views
9
9
% maxiter: the maximum number of iterations
10
10
%
11
11
% OUTPUT:
12
- % H: a cell which contains factor matrices for all views
12
+ % H: a cell containing factor matrices for all views
13
13
% Hc: the result consensus factor matrix
14
14
% objValue: the value of objective function
15
15
%
86
86
obj_consensus = norm(H{i } - Hc , ' fro' )^2 ;
87
87
obj = obj + obj_body + lambda(i )*obj_consensus ;
88
88
89
- % errX = mean(mean(abs(obj_body)))/mean(mean(X{i}));
90
- % errH = mean(mean(abs(obj_consensus)))/mean(mean(H{i}));
91
- % err = errX + errH;
89
+ errX = mean(mean(abs(obj_body )))/mean(mean(X{i }));
90
+ errH = mean(mean(abs(obj_consensus )))/mean(mean(H{i }));
91
+ err = errX + errH ;
92
92
end
93
93
94
94
You can’t perform that action at this time.
0 commit comments