-
Notifications
You must be signed in to change notification settings - Fork 0
/
runnetccle.m
64 lines (49 loc) · 1.79 KB
/
runnetccle.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
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;
ccle = loadCCLE(entrezmap);
gdsc = loadGDSC();
disp('Loading network...');
% Load network
net = loadNet('net/KEGG-ACSN-HI.csv');
% Restrict data to nodes in the network;
cclenet = restrictNet(ccle, net);
gdscnet = restrictNet(gdsc, net);
disp('Computing marginals...');
cclenet = marginalExp(cclenet, 0.9, 5, 2);
gdscnet = marginalExp(gdscnet, 0.9, 5, 2);
idxcommon = cellfun(@(x) ~isempty(find(strcmpi(x, gdsc.allDrugs), 1)), ccle.allDrugs);
cclenet.allDrugs = cclenet.allDrugs(idxcommon);
cclenet.AAMat = cclenet.AAMat(idxcommon, :)/8;
cclenet.IC50Mat = cclenet.IC50Mat(idxcommon, :);
clearvars -except entrezmap ccle gdsc net cclenet gdscnet;
save -v7.3 dataload;
tic;
disp('CCLE:');
numall = zeros(length(cclenet.allDrugs), 1);
threst = numall;
thresp = numall;
numresp = numall;
numrest = numall;
for i=1:length(cclenet.allDrugs)
disp(cclenet.allDrugs{i});
idxpos = cclenet.AAMat(i, :)>=0.7 | cclenet.IC50Mat(i, :)<=0.5;
idxneg = cclenet.AAMat(i, :)<=0.05 | cclenet.IC50Mat(i, :)>=8;
ccle_dgnet{i} = drugGeneNet(cclenet, i, net, idxpos, idxneg);
end
runtime_ccle = toc;
save -v7.3 cclenet2 cclenet ccle_dgnet runtime_ccle;