0001 function usageReport = reportEnzymeUsage(ecModel, usageData, highCapUsage, topAbsUsage)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
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
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
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
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
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
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
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
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
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