Commit efaf02b9703f0ba7d5146db83741e9d4368c325b
1 parent
624f93a94a
Exists in
master
Updated folder
Showing
1 changed file
with
0 additions
and
28 deletions
Show diff stats
Supporting_Files/Generating_random_networks.m
... | ... | @@ -1,28 +0,0 @@ |
1 | -clear;clc; | |
2 | - | |
3 | -%% Generating Random Networks | |
4 | - | |
5 | -[ndrugs, ntargets] = size(adjacencyR); | |
6 | -nedges = sum(adjacencyR(:)); | |
7 | -A=zeros(ndrugs,ntargets); | |
8 | -t=randperm(numel(A)); | |
9 | -A(t(1:nedges))=1; | |
10 | - | |
11 | -clearvars t | |
12 | -%% Calculate NBI through drug target adjacency matrix | |
13 | -%A=[1, 1, 0, 1;0,1, 1, 0; 0, 1, 1,1]; | |
14 | - | |
15 | -Ky = diag(1./sum(A)); | |
16 | -n = size(A,1); | |
17 | -m = size(A,2); | |
18 | -Ky(isinf(Ky)| isnan(Ky))=0; | |
19 | -kx = sum(A,2)'; | |
20 | -Nx = repmat(1./kx,n,1); | |
21 | -Nx(isinf(Nx) | isnan(Nx))=0; | |
22 | -kx(isinf(kx) | isnan(kx))=0; | |
23 | -W = (A*Ky)'; | |
24 | -W1 = A*W; | |
25 | -W2 = Nx .* W1; | |
26 | -R = W2*A; | |
27 | - | |
28 | -clearvars Ky n m kx Nx W W1 W2 |