Home > src > geckomat > utilities > reportEnzymeUsage.m

reportEnzymeUsage

PURPOSE ^

reportEnzymeUsage

SYNOPSIS ^

function usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage, topAbsUsage)

DESCRIPTION ^

 reportEnzymeUsage
   Summarizes the results from enzymeUsage.

  Input:
   ecModel         a GECKO3 ecModel
   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)
   topAbsUsage     number of top enzymes with highest absolute usage
                   (Optional, default 10, returning the top 10 enzymes
                   with highest absolute usage. With Inf or 0, all enzymes
                   are returned)

  Output:
   usageReport     table with summary information

 Usage:
   usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage, topAbsUsage)
0002 % reportEnzymeUsage
0003 %   Summarizes the results from enzymeUsage.
0004 %
0005 %  Input:
0006 %   ecModel         a GECKO3 ecModel
0007 %   usageData       output from enzymeUsage
0008 %   highCapUsage    minimum ratio of enzyme capacity usage to be considered
0009 %                   as high usage (Optional, default 0.9, refering to a
0010 %                   minimum of 90% capacity usage)
0011 %   topAbsUsage     number of top enzymes with highest absolute usage
0012 %                   (Optional, default 10, returning the top 10 enzymes
0013 %                   with highest absolute usage. With Inf or 0, all enzymes
0014 %                   are returned)
0015 %
0016 %  Output:
0017 %   usageReport     table with summary information
0018 %
0019 % Usage:
0020 %   usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage)
0021 
0022 if nargin < 3 || isempty(highCapUsage)
0023     highCapUsage = 0.9;
0024 end
0025 if nargin < 4 || isempty(topAbsUsage)
0026     topAbsUsage = 10;
0027 end
0028 
0029 usageReport = {};
0030 
0031 % Highest capacity usage
0032 highUsageProt = find(usageData.capUsage > highCapUsage);
0033 highEnzyme    = usageData.protID(highUsageProt);
0034 [~,enzIdx]    = ismember(highEnzyme,ecModel.ec.enzymes);
0035 geneIDs       = ecModel.ec.genes(enzIdx);
0036 
0037 highUsage.protID     = {};
0038 highUsage.geneID     = {};
0039 highUsage.absUsage   = [];
0040 highUsage.capUsage   = [];
0041 highUsage.kcat       = [];
0042 highUsage.source     = {};
0043 highUsage.rxnID      = {};
0044 highUsage.rxnNames   = {};
0045 highUsage.grRules    = {};
0046 
0047 for i=1:numel(enzIdx)
0048     [rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,ecModel.ec.enzymes(enzIdx(i)));
0049     % See if all reactions carried flux
0050     [~,rIdx] = ismember(rxns,ecModel.rxns);
0051     carriedFlux = usageData.fluxes(rIdx) > 1e-7;
0052     if isscalar(find(carriedFlux))
0053         highUsage.protID(end+1,1)      = highEnzyme(i);
0054         highUsage.geneID(end+1,1)      = geneIDs(i);
0055         highUsage.absUsage(end+1,1)    = usageData.absUsage(enzIdx(i));
0056         highUsage.capUsage(end+1,1)    = usageData.capUsage(enzIdx(i));
0057         highUsage.kcat(end+1,1)        = kcat(carriedFlux);
0058         highUsage.source(end+1,1)      = ecModel.ec.source(idx(carriedFlux));
0059         highUsage.rxnID(end+1,1)       = rxns(carriedFlux);
0060         highUsage.rxnNames(end+1,1)    = rxnNames(carriedFlux);
0061         highUsage.grRules(end+1,1)     = grRules(carriedFlux);
0062     else
0063         % Add one entry for combined usage
0064         highUsage.protID(end+1,1)      = highEnzyme(i);
0065         highUsage.geneID(end+1,1)      = geneIDs(i);
0066         highUsage.absUsage(end+1,1)    = usageData.absUsage(enzIdx(i));
0067         highUsage.capUsage(end+1,1)    = usageData.capUsage(enzIdx(i));
0068         highUsage.kcat(end+1,1)        = nan;
0069         highUsage.source{end+1,1}      = '===';
0070         highUsage.rxnID{end+1,1}       = '===';
0071         highUsage.rxnNames{end+1,1}    = 'involved in multiple rxns, usage combined, individual rxns below';
0072         highUsage.grRules{end+1,1}     = '===';
0073         % Recalculate reaction-specific usage
0074 
0075         rIdx = rIdx(carriedFlux);
0076         enzFlux = usageData.fluxes(rIdx);
0077         enzMet = strcat('prot_',highEnzyme{i});
0078         [~, enzEcIdx] = ismember(enzMet,ecModel.mets);
0079         indAbsUse = full(transpose(-ecModel.S(enzEcIdx,rIdx)).*enzFlux);
0080         indCapUse = (indAbsUse /sum(indAbsUse)) * usageData.capUsage(enzIdx(i));
0081 
0082         rxnNumber = length(rIdx);
0083         highUsage.protID(end+1:end+rxnNumber,1)      = highEnzyme(i);
0084         highUsage.geneID(end+1:end+rxnNumber,1)      = geneIDs(i);
0085         highUsage.absUsage(end+1:end+rxnNumber,1)    = indAbsUse;
0086         highUsage.capUsage(end+1:end+rxnNumber,1)    = indCapUse;
0087         highUsage.kcat(end+1:end+rxnNumber,1)        = kcat(carriedFlux);
0088         highUsage.source(end+1:end+rxnNumber,1)      = ecModel.ec.source(idx(carriedFlux));
0089         highUsage.rxnID(end+1:end+rxnNumber,1)       = rxns(carriedFlux);
0090         highUsage.rxnNames(end+1:end+rxnNumber,1)    = rxnNames(carriedFlux);
0091         highUsage.grRules(end+1:end+rxnNumber,1)     = grRules(carriedFlux);
0092     end    
0093 end
0094 
0095 usageReport.highCapUsage = struct2table(highUsage);
0096 
0097 % Highest absolute usage
0098 [~,topUse]          = sort(usageData.absUsage,'descend');
0099 topEnzyme           = usageData.protID(topUse(1:topAbsUsage));
0100 [~,b]       = ismember(topEnzyme,ecModel.ec.enzymes);
0101 geneIDs     = ecModel.ec.genes(b);
0102 topUsage.protID     = {};
0103 topUsage.geneID     = {};
0104 topUsage.absUsage   = [];
0105 topUsage.percUsage  = [];
0106 topUsage.kcat       = [];
0107 topUsage.source     = {};
0108 topUsage.rxnID      = {};
0109 topUsage.rxnNames   = {};
0110 topUsage.grRules    = {};
0111 
0112 protPool = -ecModel.lb(strcmp(ecModel.rxns,'prot_pool_exchange'));
0113 
0114 for i=1:numel(topEnzyme)
0115     [rxns, kcat, idx, rxnNames, grRules] = getReactionsFromEnzyme(ecModel,topEnzyme{i});
0116     % See if all reactions carried flux
0117     [~,rIdx] = ismember(rxns,ecModel.rxns);
0118     carriedFlux = usageData.fluxes(rIdx) > 1e-7;
0119     if isscalar(find(carriedFlux))
0120         topUsage.protID(end+1,1)      = topEnzyme(i);
0121         topUsage.geneID(end+1,1)      = geneIDs(i);
0122         topUsage.absUsage(end+1,1)    = usageData.absUsage(topUse(i));
0123         topUsage.percUsage(end+1,1)   = topUsage.absUsage(end,1)/protPool*100;
0124         topUsage.kcat(end+1,1)        = kcat(carriedFlux);
0125         topUsage.source(end+1,1)      = ecModel.ec.source(idx(carriedFlux));
0126         topUsage.rxnID(end+1,1)       = rxns(carriedFlux);
0127         topUsage.rxnNames(end+1,1)    = rxnNames(carriedFlux);
0128         topUsage.grRules(end+1,1)     = grRules(carriedFlux);
0129     else
0130         % Add one entry for combined usage
0131         topUsage.protID(end+1,1)      = topEnzyme(i);
0132         topUsage.geneID(end+1,1)      = geneIDs(i);
0133         topUsage.absUsage(end+1,1)    = usageData.absUsage(topUse(i));
0134         topUsage.percUsage(end+1,1)   = topUsage.absUsage(end,1)/protPool*100;
0135         topUsage.kcat(end+1,1)        = nan;
0136         topUsage.source{end+1,1}      = '===';
0137         topUsage.rxnID{end+1,1}       = '===';
0138         topUsage.rxnNames{end+1,1}    = 'involved in multiple rxns, usage combined, individual rxns below';
0139         topUsage.grRules{end+1,1}     = '===';
0140         % Recalculate reaction-specific usage
0141         rIdx = rIdx(carriedFlux);
0142         enzFlux = usageData.fluxes(rIdx);
0143         enzMet = strcat('prot_',topEnzyme{i});
0144         [~, enzIdx] = ismember(enzMet,ecModel.mets);
0145         indUse = full(transpose(-ecModel.S(enzIdx,rIdx)).*enzFlux);
0146         rxnNumber = length(rIdx);
0147         topUsage.protID(end+1:end+rxnNumber,1)      = topEnzyme(i);
0148         topUsage.geneID(end+1:end+rxnNumber,1)      = geneIDs(i);
0149         topUsage.absUsage(end+1:end+rxnNumber,1)    = indUse;
0150         topUsage.percUsage(end+1:end+rxnNumber,1)   = topUsage.absUsage(end-(rxnNumber-1):end,1)/protPool*100;
0151         topUsage.kcat(end+1:end+rxnNumber,1)        = kcat(carriedFlux);
0152         topUsage.source(end+1:end+rxnNumber,1)      = ecModel.ec.source(idx(carriedFlux));
0153         topUsage.rxnID(end+1:end+rxnNumber,1)       = rxns(carriedFlux);
0154         topUsage.rxnNames(end+1:end+rxnNumber,1)    = rxnNames(carriedFlux);
0155         topUsage.grRules(end+1:end+rxnNumber,1)     = grRules(carriedFlux);
0156     end
0157 end
0158 usageReport.topAbsUsage     = struct2table(topUsage);
0159 usageReport.totalUsageFlux  = protPool;
0160 end

Generated by m2html © 2005