findTransRxns identify all transport reactions in a model [transRxns,nonTransRxns] = findTransRxns(model,inclExc) INPUT model COBRA model structure OPTIONAL INPUT inclExc include exchange reactions as transport? (Default = false) OUTPUT transRxns all transport reactions in the model nonTransRxns all non-transport reactions in the model right now, this function only works with models the compartments [c], [p], and [e] Jeff Orth 8/31/07
0001 function [transRxns,nonTransRxns] = findTransRxns(model,inclExc) 0002 %findTransRxns identify all transport reactions in a model 0003 % 0004 % [transRxns,nonTransRxns] = findTransRxns(model,inclExc) 0005 % 0006 %INPUT 0007 % model COBRA model structure 0008 % 0009 %OPTIONAL INPUT 0010 % inclExc include exchange reactions as transport? 0011 % (Default = false) 0012 % 0013 %OUTPUT 0014 % transRxns all transport reactions in the model 0015 % nonTransRxns all non-transport reactions in the model 0016 % 0017 % right now, this function only works with models the compartments [c], 0018 % [p], and [e] 0019 % 0020 % Jeff Orth 8/31/07 0021 0022 if nargin < 2 0023 inclExc = false; 0024 end 0025 0026 isTrans = zeros(1,length(model.rxns)); 0027 0028 for i = 1:length(model.rxns) 0029 mets = model.mets(find(model.S(:,i))); 0030 cMets = regexp(mets,'\[c\]'); 0031 hasCs = ~isempty([cMets{:}]); 0032 pMets = regexp(mets,'\[p\]'); 0033 hasPs = ~isempty([pMets{:}]); 0034 eMets = regexp(mets,'\[e\]'); 0035 hasEs = ~isempty([eMets{:}]); 0036 0037 if (sum([hasCs,hasPs,hasEs]) > 1) || hasEs&&inclExc 0038 isTrans(i) = 1; 0039 end 0040 end 0041 0042 transRxns = model.rxns(isTrans==1); 0043 nonTransRxns = model.rxns(isTrans==0); 0044 0045 0046