CBA_FEASIBLE_EFM - Test flux mode for economic feasibility (given non-beneficial flux modes) [isFeasible, ind_conflict] = cba_feasible_efm(v, C_efm) Test a flux mode v for economic feasibility by comparing it to elementary non-beneficial flux modes (in matrix C_efm) ind_conflict: indices of those modes in C_efm that are in conflict with v
0001 function [isFeasible, ind_conflict] = cba_feasible_efm(v, C_efm) 0002 0003 % CBA_FEASIBLE_EFM - Test flux mode for economic feasibility (given non-beneficial flux modes) 0004 % 0005 % [isFeasible, ind_conflict] = cba_feasible_efm(v, C_efm) 0006 % 0007 % Test a flux mode v for economic feasibility by comparing it to 0008 % elementary non-beneficial flux modes (in matrix C_efm) 0009 % 0010 % ind_conflict: indices of those modes in C_efm that are in conflict with v 0011 0012 if find(v==0), 0013 0014 warning('Inactive reactions encountered. Feasibility cannot be directly tested'); 0015 isFeasible = nan; 0016 ind_conflict = []; 0017 0018 else, 0019 0020 isFeasible = 1; 0021 ind_conflict = []; 0022 0023 for it = size(C_efm,2), 0024 ind_intersect = find( [v~=0] .* [C_efm(:,it)~=0]); 0025 if length(unique(sign(v(ind_intersect).*C_efm(ind_intersect,it))))==1, 0026 isFeasible = 0; 0027 ind_conflict = [ind_conflict, it]; 0028 end 0029 end 0030 0031 end