Home > metabolic-economics > metabolic-economics-utils > cba_constraints_reduce_to_active.m

cba_constraints_reduce_to_active

PURPOSE ^

CBA_CONSTRAINTS_REDUCE_TO_ACTIVE - Remove inactive reactions in cba_constraints

SYNOPSIS ^

function cba_constraints_act = cba_constraints_reduce_to_active(cba_constraints,ind_active,ind_met_active,network,network_act)

DESCRIPTION ^

 CBA_CONSTRAINTS_REDUCE_TO_ACTIVE - Remove inactive reactions in cba_constraints

 cba_constraints_act = cba_constraints_reduce_to_active(cba_constraints,ind_active,ind_met_active,network,network_act)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cba_constraints_act = cba_constraints_reduce_to_active(cba_constraints,ind_active,ind_met_active,network,network_act)
0002 
0003 % CBA_CONSTRAINTS_REDUCE_TO_ACTIVE - Remove inactive reactions in cba_constraints
0004 %
0005 % cba_constraints_act = cba_constraints_reduce_to_active(cba_constraints,ind_active,ind_met_active,network,network_act)
0006 
0007 cba_constraints_act             = cba_constraints;
0008 cba_constraints_act.v_min       = cba_constraints.v_min(ind_active); 
0009 cba_constraints_act.v_max       = cba_constraints.v_max(ind_active); 
0010 cba_constraints_act.v_sign      = cba_constraints.v_sign(ind_active); 
0011 cba_constraints_act.v_mean      = cba_constraints.v_mean(ind_active); 
0012 cba_constraints_act.v_std       = cba_constraints.v_std(ind_active); 
0013 cba_constraints_act.v_fix       = cba_constraints.v_fix(ind_active); 
0014 cba_constraints_act.ext_sign    = cba_constraints_act.ext_sign(ind_met_active);
0015 cba_constraints_act.dmu_min     = cba_constraints.dmu_min(ind_active); 
0016 cba_constraints_act.dmu_max     = cba_constraints.dmu_max(ind_active); 
0017 cba_constraints_act.dmu_fix     = cba_constraints.dmu_fix(ind_active); 
0018 cba_constraints_act.dmu_sign    = cba_constraints.dmu_sign(ind_active); 
0019 cba_constraints_act.mu_min      = cba_constraints.mu_min(ind_met_active); 
0020 cba_constraints_act.mu_max      = cba_constraints.mu_max(ind_met_active); 
0021 cba_constraints_act.mu_fix      = cba_constraints.mu_fix(ind_met_active); 
0022 cba_constraints_act.z_int       = cba_constraints.z_int(ind_active);
0023 cba_constraints_act.u           = cba_constraints.u(ind_active);
0024 cba_constraints_act.ind_ignore  = nan;    %%%%%%%%%%%% FIX!!!
0025 cba_constraints_act.N_tot       = cba_constraints.N_tot(ind_met_active,ind_active);
0026 cba_constraints_act.zv          = [];
0027 
0028 if isfield(cba_constraints_act,'hu'),
0029   cba_constraints_act.hu       = cba_constraints.hu(ind_active);
0030 end
0031 
0032 if isfield(cba_constraints_act,'ind_controllable'),
0033   cba_constraints_act       = rmfield(cba_constraints_act,'ind_controllable');
0034 end
0035 
0036 if length(cba_constraints.z_ext),
0037   nm = length(network.metabolites);
0038   dummi = zeros(nm,1);
0039   dummi(find(network.external)) = cba_constraints.z_ext;
0040   dummi = dummi(ind_met_active);
0041   new_external = network.external(ind_met_active);
0042   cba_constraints_act.z_ext = dummi(find(new_external));
0043 end
0044 
0045 cba_constraints_act = cba_update_constraints(cba_constraints_act,network_act.N(find(network_act.external),:));

Generated on Fri 12-Feb-2016 20:18:22 by m2html © 2003