Skip to content

Commit

Permalink
feat: reportEnzymeUsage input and output
Browse files Browse the repository at this point in the history
- use fluxes from usageData
- give protein pool in usageReport instead of printing to command window
  • Loading branch information
edkerk authored Apr 28, 2024
1 parent 2ab84b2 commit 1b45edd
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/geckomat/utilities/reportEnzymeUsage.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function usageReport = topEnzymeUsage(ecModel, usageData, highCapUsage, topAbsUsage)
function usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage, topAbsUsage)
% reportEnzymeUsage
% Summarizes the results from enzymeUsage.
%
% Input:
% ecModel a GECKO3 ecModel
% usageData output from reportEnzymeUsage
% usageData output from enzymeUsage
% highCapUsage minimum ratio of enzyme capacity usage to be considered
% as high usage (Optional, default 0.9, refering to a
% minimum of 90% capacity usage)
Expand Down Expand Up @@ -64,12 +64,7 @@
% Calculate the protein pool flux from the 'prot_pool_exchange' reaction
protPoolExchangeFlux = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange'));

% Obtain the fluxes
sol = solveLP(ecModel);
if isempty(sol.x)
error('No solution found.');
end
fluxValues = sol.x;
fluxValues = usageData.fluxes;

% Sum fluxes for all 'usage_prot_' reactions, excluding the 'usage_prot_standard'
usageProtIndices = startsWith(ecModel.rxns, 'usage_prot_') & ...
Expand All @@ -81,10 +76,6 @@
% Define the new protein pool as the sum of prot_pool_exchange flux and total usage_prot fluxes
protPool = (protPoolExchangeFlux + totalUsageProtFlux)/100;

fprintf('Total Protein Pool Flux: %f\n', protPoolExchangeFlux);
fprintf('total UsageProt Flux: %f\n', totalUsageProtFlux);


for i=1:numel(topEnzyme)
[rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,topEnzyme{i});
rxnNumber = numel(rxns);
Expand All @@ -98,5 +89,7 @@
topUsage.rxnNames(end+1:end+rxnNumber,1) = rxnNames;
topUsage.grRules(end+1:end+rxnNumber,1) = grRules;
end
usageReport.topAbsUsage = struct2table(topUsage);
usageReport.topAbsUsage = struct2table(topUsage);
usageReport.totalProtPool = protPoolExchangeFlux;
usageReport.totalUsageFlux = totalUsageProtFlux;
end

0 comments on commit 1b45edd

Please sign in to comment.