getcarbonnum Gets carbon numbers matching the model. Input: model ecModel that was generated by makeEcModel, or loaded from an earlier run. Not compatible with ecModels generated by earlier GECKO versions (pre 3.0). exrxn Exchange reaction to use for counting Output: model ecModel
0001 function [CarbonNum,EXfors,changedmets] = getcarbonnum(model,exrxn) 0002 % getcarbonnum 0003 % Gets carbon numbers matching the model. 0004 % 0005 % Input: 0006 % model ecModel that was generated by makeEcModel, or loaded from 0007 % an earlier run. Not compatible with ecModels generated by 0008 % earlier GECKO versions (pre 3.0). 0009 % exrxn Exchange reaction to use for counting 0010 % Output: 0011 % model ecModel 0012 % 0013 0014 % exrxn must be an exchange rxn and only contain one mets in the equation 0015 [~,idx] = ismember(exrxn,model.rxns); 0016 EXmets = model.S(:,idx); 0017 % find all exchange mets 0018 EXmetsIdx = zeros(length(exrxn),1); 0019 for k = 1:length(EXmets(1,:)) 0020 EXmetsIdx(k) = find(EXmets(:,k)); % 0021 end 0022 EXfors = model.metFormulas(EXmetsIdx); 0023 [Ematrix, elements] = getElementalComposition(EXfors,{'C'}); 0024 Ematrix = Ematrix(:,1); 0025 changedmets = exrxn(isnan(Ematrix)); 0026 Ematrix(isnan(Ematrix)) = 1; 0027 CarbonNum = Ematrix'; 0028 end