-
Notifications
You must be signed in to change notification settings - Fork 0
/
Intersection_Reactions_Genes.m
66 lines (49 loc) · 3 KB
/
Intersection_Reactions_Genes.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
function[T]=Intersection_Reactions_Genes(model_composite,T, Cover_range, REI_range, Optimization_global, printLevel)
% From the composite model, we have the names of present and not present
% reactions/genes. Now, we want to intersect these reactions from the composite
% model with those from every context specific model.
%% Intersection of context model reactions and composite model reactions
comp_rxns_present = T.Reactions_Present;
comp_rxns_not_present =T.Reactions_Not_Present;
Table_spec_rxns_present = cell(100,3);
Table_spec_rxns_not_present = cell(100,3);
Table_spec_genes_present = cell(100,3);
Table_spec_genes_not_present = cell(100,3);
kk= 0;
for c=1:numel(Cover_range)
for p=1:numel(REI_range)
kk = kk + 1;
% A=Optimization(kk).A
Context_Specific_model_rxns=model_composite.rxns(find(Optimization_global(1).A(:,kk)));
% load([extract,'\A_value_of_the_context_Specific_Model_Cover_',num2str(Cover(c)),'_Percentile_',num2str(percent(p)),'.mat']);
%load([extract,'\Context_Specific_Model_Cover_',num2str(Cover(c)),'_Percentile_',num2str(percent(p)),'.mat']);
%%%% Determination of bulk rxns in context specific model
spec_model_rxns = cellfun(@(S) S(1:end-2), Context_Specific_model_rxns, 'Uniform', 0);
spec_rxns_present = intersect(spec_model_rxns, comp_rxns_present);
spec_rxns_not_present = intersect(spec_model_rxns, comp_rxns_not_present);
Table_spec_rxns_present{kk,1} = Cover_range(c);
Table_spec_rxns_present{kk,2} = REI_range(p);
Table_spec_rxns_present{kk,3} = numel(spec_rxns_present);
Table_spec_rxns_not_present{kk,1} = Cover_range(c);
Table_spec_rxns_not_present{kk,2} = REI_range(p);
Table_spec_rxns_not_present{kk,3} = numel(spec_rxns_not_present);
%%%%%%%%%
%%%% Determination of bulk genes in context specific model
% spec_model_genes = Context_Specific_model.genes((sum(Context_Specific_model.rxnGeneMat,1)~=0));
% spec_model_genes = cellfun(@(S) S(1:end-2), spec_model_genes, 'Uniform', 0);
% spec_genes_present = intersect(string(spec_model_genes), string(comp_genes_present));
% spec_genes_not_present = intersect(string(spec_model_genes), string(comp_genes_not_present));
% Table_spec_genes_present{kk,1} = Cover_range(c);
% Table_spec_genes_present{kk,2} = REI_range(p);
% Table_spec_genes_present{kk,3} = numel(spec_genes_present);
% Table_spec_genes_not_present{kk,1} = Cover_range(c);
%Table_spec_genes_not_present{kk,2} = REI_range(p);
%Table_spec_genes_not_present{kk,3} = numel(spec_genes_not_present);
%%%%%%%%%
end
end
T.Table_spec_rxns_present=Table_spec_rxns_present;
T.Table_spec_rxns_not_present=Table_spec_rxns_not_present;
T.Table_spec_genes_present=Table_spec_genes_present;
T.Table_spec_genes_not_present=Table_spec_genes_not_present;
end