-
Notifications
You must be signed in to change notification settings - Fork 0
/
runnetgdsc2.m
73 lines (55 loc) · 1.97 KB
/
runnetgdsc2.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
addpath(genpath('l1ktools-master/'))
disp('Loading Entrez - Gene name mapping...');
entr2name = readtable('data/entrez2name.csv');
entrez2name = containers.Map('keytype', 'double', 'valuetype', 'char');
name2entrez = containers.Map('keytype', 'char', 'valuetype', 'double');
for i=1:height(entr2name)
entrez2name(entr2name.entrezid(i)) = entr2name.genename{i};
name2entrez(entr2name.genename{i}) = entr2name.entrezid(i);
end
name2entrez('ABL') = 25;
name2entrez('MLL') = 4297;
name2entrez('EWRS1') = 2130;
name2entrez('FTSJD1') = 55783;
name2entrez('MLL2') = 8085;
name2entrez('MLL3') = 58508;
entrezmap.name2entrez = name2entrez;
entrezmap.entrez2name = entrez2name;
gdsc = loadGDSC();
disp('Loading network...');
% Load network
net = loadNet('net/KEGG-ACSN-HI.csv');
% Restrict data to nodes in the network;
gdscnet = restrictNet(gdsc, net);
disp('Computing marginals...');
gdscnet = marginalExp(gdscnet, 0.9, 5, 2);
clearvars -except entrezmap gdsc net gdscnet;
gdsc_ic50th = readtable('data/GDSC_TH.csv');
seldrugs = readtable('data/seldrugs.csv', 'Delimiter', ',');
tic;
disp('GDSC:');
numall = zeros(length(gdscnet.allDrugs), 1);
threst = numall;
thresp = numall;
numresp = numall;
numrest = numall;
for i=1:length(gdscnet.allDrugs)
drug = gdscnet.allDrugs{i};
if(~sum(strcmpi(seldrugs.DRUG_NAME, drug)))
continue;
end
disp(gdscnet.allDrugs{i});
idxth = strcmpi(gdsc_ic50th.Drug_Name, gdscnet.allDrugs{i});
if(sum(idxth)==0)
continue;
end
curthic50 = gdsc_ic50th.Threshold(idxth);
idxpos = gdscnet.AAMat(i, :)>=0.4 | gdscnet.IC50Mat(i, :)<=curthic50;
idxneg = gdscnet.AAMat(i, :)<=0.1 & gdscnet.IC50Mat(i, :) > curthic50;
% idxpos = gdscnet.IC50Mat(i, :) <= curthic50;
% idxneg = gdscnet.IC50Mat(i, :) > curthic50;
gdsc_dgnet{i} = drugGeneNetAA(gdscnet, i, net, idxpos, idxneg);
save -v7.3 kfgdscnetaa gdscnet gdsc_dgnet;
end
runtime_gdsc = toc;
save -v7.3 kfgdscnetaa gdscnet gdsc_dgnet runtime_gdsc;