diff --git a/doc/src/geckomat/utilities/enzymeUsage.html b/doc/src/geckomat/utilities/enzymeUsage.html index 012d491c..030ecaa3 100644 --- a/doc/src/geckomat/utilities/enzymeUsage.html +++ b/doc/src/geckomat/utilities/enzymeUsage.html @@ -54,7 +54,6 @@

DESCRIPTION ^SOURCE CODE ^% absUsage vector of absolute enzyme usages 0027 % UB vector of enzyme exchange reaction upper bounds 0028 % protID string array of matching protein IDs -0029 % fluxes vector of fluxes, copy of input fluxes -0030 % -0031 % Usage: -0032 % usageData = enzymeUsage(ecModel,fluxes,zero) -0033 -0034 if nargin<3 -0035 zero=true; -0036 end -0037 if ecModel.ec.geckoLight -0038 error('This function does not work on GECKO light models.') -0039 end -0040 usageData.protID = ecModel.ec.enzymes; -0041 [~,rxnIdx] = ismember(strcat('usage_prot_',ecModel.ec.enzymes),ecModel.rxns); -0042 -0043 usageData.LB = ecModel.lb(rxnIdx); -0044 usageData.absUsage = abs(fluxes(rxnIdx)); -0045 usageData.capUsage = abs(usageData.absUsage./usageData.LB); -0046 usageData.fluxes = fluxes; -0047 -0048 if ~zero -0049 nonzero = usageData.absUsage<0; -0050 usageData.absUsage = usageData.absUsage(nonzero); -0051 usageData.capUsage = usageData.capUsage(nonzero); -0052 usageData.LB = usageData.LB(nonzero); -0053 usageData.protID = usageData.protID(nonzero); -0054 end -0055 end +0029 % +0030 % Usage: +0031 % usageData = enzymeUsage(ecModel,fluxes,zero) +0032 +0033 if nargin<3 +0034 zero=true; +0035 end +0036 if ecModel.ec.geckoLight +0037 error('This function does not work on GECKO light models.') +0038 end +0039 usageData.protID = ecModel.ec.enzymes; +0040 [~,rxnIdx] = ismember(strcat('usage_prot_',ecModel.ec.enzymes),ecModel.rxns); +0041 +0042 usageData.LB = ecModel.lb(rxnIdx); +0043 usageData.absUsage = abs(fluxes(rxnIdx)); +0044 usageData.capUsage = abs(usageData.absUsage./usageData.LB); +0045 +0046 if ~zero +0047 nonzero = usageData.absUsage<0; +0048 usageData.absUsage = usageData.absUsage(nonzero); +0049 usageData.capUsage = usageData.capUsage(nonzero); +0050 usageData.LB = usageData.LB(nonzero); +0051 usageData.protID = usageData.protID(nonzero); +0052 end +0053 end
Generated by m2html © 2005
\ No newline at end of file diff --git a/doc/src/geckomat/utilities/reportEnzymeUsage.html b/doc/src/geckomat/utilities/reportEnzymeUsage.html index 798d2cc0..f1a33b97 100644 --- a/doc/src/geckomat/utilities/reportEnzymeUsage.html +++ b/doc/src/geckomat/utilities/reportEnzymeUsage.html @@ -123,38 +123,24 @@

SOURCE CODE ^% Calculate the protein pool flux from the 'prot_pool_exchange' reaction -0065 protPoolExchangeFlux = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange')); -0066 -0067 fluxValues = usageData.fluxes; -0068 -0069 % Sum fluxes for all 'usage_prot_' reactions, excluding the 'usage_prot_standard' -0070 usageProtIndices = startsWith(ecModel.rxns, 'usage_prot_') & ... -0071 ~contains(ecModel.rxns, 'standard'); -0072 -0073 % Sum the absolute values of the usage fluxes -0074 totalUsageProtFlux = sum(abs(fluxValues(usageProtIndices))); -0075 -0076 % Define the new protein pool as the sum of prot_pool_exchange flux and total usage_prot fluxes -0077 protPool = (protPoolExchangeFlux + totalUsageProtFlux)/100; -0078 -0079 for i=1:numel(topEnzyme) -0080 [rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,topEnzyme{i}); -0081 rxnNumber = numel(rxns); -0082 topUsage.protID(end+1:end+rxnNumber,1) = topEnzyme(i); -0083 topUsage.geneID(end+1:end+rxnNumber,1) = geneIDs(i); -0084 topUsage.absUsage(end+1:end+rxnNumber,1) = usageData.absUsage(topUse(i)); -0085 topUsage.percUsage(end+1:end+rxnNumber,1) = topUsage.absUsage(end-(rxnNumber-1):end,1)/protPool; -0086 topUsage.kcat(end+1:end+rxnNumber,1) = kcat; -0087 topUsage.source(end+1:end+rxnNumber,1) = ecModel.ec.source(idx); -0088 topUsage.rxnID(end+1:end+rxnNumber,1) = rxns; -0089 topUsage.rxnNames(end+1:end+rxnNumber,1) = rxnNames; -0090 topUsage.grRules(end+1:end+rxnNumber,1) = grRules; -0091 end -0092 usageReport.topAbsUsage = struct2table(topUsage); -0093 usageReport.totalProtPool = protPoolExchangeFlux; -0094 usageReport.totalUsageFlux = totalUsageProtFlux; -0095 end +0064 protPool = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange'))/100; +0065 +0066 for i=1:numel(topEnzyme) +0067 [rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,topEnzyme{i}); +0068 rxnNumber = numel(rxns); +0069 topUsage.protID(end+1:end+rxnNumber,1) = topEnzyme(i); +0070 topUsage.geneID(end+1:end+rxnNumber,1) = geneIDs(i); +0071 topUsage.absUsage(end+1:end+rxnNumber,1) = usageData.absUsage(topUse(i)); +0072 topUsage.percUsage(end+1:end+rxnNumber,1) = topUsage.absUsage(end-(rxnNumber-1):end,1)/protPool; +0073 topUsage.kcat(end+1:end+rxnNumber,1) = kcat; +0074 topUsage.source(end+1:end+rxnNumber,1) = ecModel.ec.source(idx); +0075 topUsage.rxnID(end+1:end+rxnNumber,1) = rxns; +0076 topUsage.rxnNames(end+1:end+rxnNumber,1) = rxnNames; +0077 topUsage.grRules(end+1:end+rxnNumber,1) = grRules; +0078 end +0079 usageReport.topAbsUsage = struct2table(topUsage); +0080 usageReport.totalUsageFlux = protPool; +0081 end
Generated by m2html © 2005
\ No newline at end of file diff --git a/src/geckomat/utilities/enzymeUsage.m b/src/geckomat/utilities/enzymeUsage.m index f9a0faca..5d80bf19 100644 --- a/src/geckomat/utilities/enzymeUsage.m +++ b/src/geckomat/utilities/enzymeUsage.m @@ -26,7 +26,6 @@ % absUsage vector of absolute enzyme usages % UB vector of enzyme exchange reaction upper bounds % protID string array of matching protein IDs -% fluxes vector of fluxes, copy of input fluxes % % Usage: % usageData = enzymeUsage(ecModel,fluxes,zero) @@ -43,7 +42,6 @@ usageData.LB = ecModel.lb(rxnIdx); usageData.absUsage = abs(fluxes(rxnIdx)); usageData.capUsage = abs(usageData.absUsage./usageData.LB); -usageData.fluxes = fluxes; if ~zero nonzero = usageData.absUsage<0; diff --git a/src/geckomat/utilities/reportEnzymeUsage.m b/src/geckomat/utilities/reportEnzymeUsage.m index 5d793990..b487bd54 100644 --- a/src/geckomat/utilities/reportEnzymeUsage.m +++ b/src/geckomat/utilities/reportEnzymeUsage.m @@ -61,20 +61,7 @@ topUsage.rxnNames = {}; topUsage.grRules = {}; -% Calculate the protein pool flux from the 'prot_pool_exchange' reaction -protPoolExchangeFlux = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange')); - -fluxValues = usageData.fluxes; - -% Sum fluxes for all 'usage_prot_' reactions, excluding the 'usage_prot_standard' -usageProtIndices = startsWith(ecModel.rxns, 'usage_prot_') & ... - ~contains(ecModel.rxns, 'standard'); - -% Sum the absolute values of the usage fluxes -totalUsageProtFlux = sum(abs(fluxValues(usageProtIndices))); - -% Define the new protein pool as the sum of prot_pool_exchange flux and total usage_prot fluxes -protPool = (protPoolExchangeFlux + totalUsageProtFlux)/100; +protPool = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange'))/100; for i=1:numel(topEnzyme) [rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,topEnzyme{i}); @@ -90,6 +77,5 @@ topUsage.grRules(end+1:end+rxnNumber,1) = grRules; end usageReport.topAbsUsage = struct2table(topUsage); -usageReport.totalProtPool = protPoolExchangeFlux; -usageReport.totalUsageFlux = totalUsageProtFlux; +usageReport.totalUsageFlux = protPool; end