-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathessFBA.m
More file actions
29 lines (27 loc) · 799 Bytes
/
essFBA.m
File metadata and controls
29 lines (27 loc) · 799 Bytes
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
function egenes = essFBA(model)
biomass = model.biomass_rxn;
ngenes = length(model.genes);
egenes = zeros(ngenes,1);
sO = optimizeCbModel(model);
for i = 1 : ngenes
x = ones(ngenes,1);
x(i) = 0;
r = find(~cellfun(@isempty,strfind(model.rules,sprintf('x(%d)',i)))>0);
new_model = knockdown(model,r,x);
sM = optimizeCbModel(new_model);
if (sO.x(biomass)*0.1 > sM.x(biomass))
egenes(i) = 1;
%fprintf('%d\n',i);
end
end
fprintf('FBA: found %d essential genes\n', sum(egenes));
end
function new_model = knockdown(model,reaction,x)
new_model = model;
for i = 1 : length(reaction)
if (eval(model.rules{reaction(i)})<1)
new_model.lb(reaction(i)) = 0;
new_model.ub(reaction(i)) = 0;
end
end
end