-
Notifications
You must be signed in to change notification settings - Fork 0
/
screen_models.m
31 lines (19 loc) · 1.31 KB
/
screen_models.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
function [models2keep, solutions, fvals, All_solutions, All_complete_times] = ...
screen_models(Network_Data, Experimental_Data, All_K, All_fractions, ...
knockout, t_interval, screen_fval_threshold)
%%%%%%%%%%%%%%%%%%%%%% Define Model Characteristics %%%%%%%%%%%%%%%%%%%%%%%
calculate_Kset_fitness = str2func(strcat('calculate_Kset_fitness_', ...
Network_Data.model_size));
S = Network_Data.S;
nmodels = size(All_K,2);
fvals = zeros(nmodels,1); % Preallocate fvals vector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Screen Models %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[All_solutions, All_complete_times] = perturb_parent_Ksets(Network_Data,... % Calculate perturbed steady state flux distribution after knocking out enzyme for each parameter set
knockout, All_K, All_fractions, t_interval);
for i = 1:nmodels
fvals(i) = calculate_Kset_fitness(Experimental_Data,... % Calculate fitness value for each parameter set prediction of the knockout steady state flux distribution
All_solutions(:,i), knockout, S);
end
models2keep = find(fvals <= screen_fval_threshold); % Keep models with fitness value less than or equal to provided threshold value
solutions = All_solutions(:,models2keep);
end